I am trying to use this plugin and follow the instructions given in the readme.md file.
1) here is my html file
<!DOCTYPE HTML> <html> <head> <title>TryMakan Video</title> <link rel="stylesheet" href="style.css" /> <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script> <script type="text/javascript" charset="utf-8" src="video.js"></script> <script type="text/javascript"> function playVideo(){ window.plugins.videoPlayer.play("http://www.trymakan.my/wp-content/uploads/2011/09/NASI-AYAM-BEREMPAH-KAJANG.mp4"); } </script> </head> <body> <a href="#" onClick="playVideo();">play</a> </body></html>
2) here is my plugins.xml, which is located in the xml folder
<?xml version="1.0" encoding="utf-8"?> <plugins> <plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/> </plugins>
3) I also copied VideoPlayer.java to this src \ com \ phonegap \ plugins \ video folder
4) In addition, some said that I also need to add the plugin to the AndroidManifest.xml file, so this is a fragment of it
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <action android:name="com.phonegap.plugins.video.VideoPlayer"/> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
but still, when I click play, log cat will return this error
08-08 04:54:15.823: I/Web Console(309): Error: Status=2 Message=Class not found at file:
update1: here where VideoPlayer.java is located
here
I do not see VideoPlayer.java in the Gen folder, does this mean that it is not compiled? Could this be a problem? If so, how to solve it?
update2: I checked the bin folder and there VideoPlayer.class in bin \ classes \ com \ phonegap \ plugins \ video, so VideoPlayer.java is actually compiled
android cordova
imin
source share