简体   繁体   中英

error during playing video in phonegap android using phonegap VideoPlayer Plugin

VideoPlayer PLUGIN here is how i add video.js :

<script src="js/cordova.js"></script>
  <script src="js/video.js"></script>

now i create package src/com/phonegap/plugins/video/VideoPlayer.java i am not sure is it c* orect or wrong ? * then in config.xml:

  <feature name="VideoPlayer">
      <param name="android-package" value="com.phonegap.plugins.video.VideoPlayer.java"/>
    </feature>

and then in home.html

 <script>
$(document).ready(function()
{
window.plugins.videoPlayer.play("videos/1970.mp4");
});

</script>

on running application getting error :

 01-03 23:42:04.784: W/System.err(14212): Caused by: java.lang.NoClassDefFoundError: com.phonegap.plugins.video.VideoPlayer.java
01-03 23:42:04.792: I/System.out(14212): Error adding plugin com.phonegap.plugins.video.VideoPlayer.java.

and failed to run application and getting error " the application ha stopped unexpectedly " pls tell me what am i doing wrong ? i want to play local file already saved in WWW/video/1970.mp4

nsawaya has already answered it (.java extension is not needed), I'm adding these lines for further clarification on plugin.xml file.

<platform name="android">

    <config-file target="res/xml/config.xml" parent="/*">
        <feature name="VideoPlayer">
            <param name="android-package" value="com.moust.cordova.videoplayer.VideoPlayer"/>
        </feature>
    </config-file>

    <source-file src="src/android/VideoPlayer.java" target-dir="src/com/moust/cordova/videoplayer" />
    <source-file src="src/android/VideoPlayerView.java" target-dir="src/com/moust/cordova/videoplayer" />


    <source-file src="res/android/layout/video_player.xml" target-dir="res/layout" />
</platform>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM