PhoneGap3(Android)-视频播放器插件损坏?选择?
可能相关: 我正在尝试从我的Android PhoneGap 3.0应用程序播放youtube视频,但遇到了很多麻烦。根据stackoverflow的几个建议,我安装了android视频播放器插件()。但是,当我从终端使用PhoneGap3(Android)-视频播放器插件损坏?选择?,android,video,plugins,cordova,youtube,Android,Video,Plugins,Cordova,Youtube,可能相关: 我正在尝试从我的Android PhoneGap 3.0应用程序播放youtube视频,但遇到了很多麻烦。根据stackoverflow的几个建议,我安装了android视频播放器插件()。但是,当我从终端使用phonegap run android时,程序无法运行。这个插件在PhoneGap 3.0上不起作用吗/我应该恢复到旧版本的PhoneGap吗 这是我在尝试运行应用程序后收到的相关输出: BUILD SUCCESSFUL Total time: 1 second Buildf
phonegap run android
时,程序无法运行。这个插件在PhoneGap 3.0上不起作用吗/我应该恢复到旧版本的PhoneGap吗
这是我在尝试运行应用程序后收到的相关输出:
BUILD SUCCESSFUL
Total time: 1 second
Buildfile: /home/ian/shtv/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.0.5
[checkenv] Installed at /home/ian/android-sdk-linux_86
-setup:
[echo] Project Name: SHTV
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 18.0.1
[echo] Resolving Build Target for SHTV...
[gettarget] Project Target: Android 4.3
[gettarget] API level: 18
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/ian/shtv/platforms/android/bin
[mkdir] Created dir: /home/ian/shtv/platforms/android/bin/res
[mkdir] Created dir: /home/ian/shtv/platforms/android/gen
[mkdir] Created dir: /home/ian/shtv/platforms/android/bin/classes
[mkdir] Created dir: /home/ian/shtv/platforms/android/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for SHTV...
[dependency] Library dependencies:
[dependency] No Libraries
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 11 source files to /home/ian/shtv/platforms/android/bin/classes
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:26: error: package org.apache.cordova.api does not exist
[javac] import org.apache.cordova.api.CallbackContext;
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:27: error: package org.apache.cordova.api does not exist
[javac] import org.apache.cordova.api.CordovaPlugin;
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:28: error: package org.apache.cordova.api does not exist
[javac] import org.apache.cordova.api.PluginResult;
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:30: error: cannot find symbol
[javac] public class VideoPlayer extends CordovaPlugin {
[javac] ^
[javac] symbol: class CordovaPlugin
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:35: error: cannot find symbol
[javac] public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
[javac] ^
[javac] symbol: class CallbackContext
[javac] location: class VideoPlayer
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:36: error: package PluginResult does not exist
[javac] PluginResult.Status status = PluginResult.Status.OK;
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:36: error: package PluginResult does not exist
[javac] PluginResult.Status status = PluginResult.Status.OK;
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:44: error: package PluginResult does not exist
[javac] status = PluginResult.Status.INVALID_ACTION;
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:46: error: cannot find symbol
[javac] callbackContext.sendPluginResult(new PluginResult(status, result));
[javac] ^
[javac] symbol: class PluginResult
[javac] location: class VideoPlayer
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:48: error: cannot find symbol
[javac] callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
[javac] ^
[javac] symbol: class PluginResult
[javac] location: class VideoPlayer
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:48: error: package PluginResult does not exist
[javac] callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:50: error: cannot find symbol
[javac] callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION));
[javac] ^
[javac] symbol: class PluginResult
[javac] location: class VideoPlayer
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:50: error: package PluginResult does not exist
[javac] callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION));
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:34: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:87: error: cannot find symbol
[javac] File fp = new File(this.cordova.getActivity().getFilesDir() + "/" + filename);
[javac] ^
[javac] symbol: variable cordova
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:93: error: cannot find symbol
[javac] uri = Uri.parse("file://" + this.cordova.getActivity().getFilesDir() + "/" + filename);
[javac] ^
[javac] symbol: variable cordova
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:104: error: cannot find symbol
[javac] this.cordova.getActivity().startActivity(intent);
[javac] ^
[javac] symbol: variable cordova
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:109: error: cannot find symbol
[javac] InputStream in = this.cordova.getActivity().getAssets().open(fileFrom);
[javac] ^
[javac] symbol: variable cordova
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:112: error: cannot find symbol
[javac] FileOutputStream out = this.cordova.getActivity().openFileOutput(fileTo, Context.MODE_WORLD_READABLE);
[javac] ^
[javac] symbol: variable cordova
[javac] /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java:124: error: cannot find symbol
[javac] PackageManager pm = this.cordova.getActivity().getPackageManager();
[javac] ^
[javac] symbol: variable cordova
[javac] Note: /home/ian/shtv/platforms/android/src/com/phonegap/plugins/video/VideoPlayer.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 20 errors
BUILD FAILED
/home/ian/android-sdk-linux_86/tools/ant/build.xml:712: The following error occurred while executing this line:
/home/ian/android-sdk-linux_86/tools/ant/build.xml:726: Compile failed; see the compiler error output for details.
Total time: 3 seconds
此外,如果有人对解决此问题的其他方法有建议,我将不胜感激:)我曾尝试直接链接到youtube视频,但它们在浏览器中打开(而不是本地youtube应用程序或视频播放器),播放音频但不播放图片(当您将视频切换到全屏时,您可以看到视频)该插件的上一次更新是8个月前;它看起来并没有更新到3.0版本。在3.0中,
api
名称空间被删除-您可以看到这是如何在提交中完成的:
您可能只需将该插件转发给repo,然后自己进行类似的更改(基本上,只需删除
api
字符串)。如果它有效,那就太好了,您应该发送一个pull请求,以便更新repo,其他人可以使用它!如果它不起作用,那么可能需要进行一些其他更改,但我们可以在找到它们时查看这些更改 该插件的上一次更新是8个月前;它看起来并没有更新到3.0版本。在3.0中,api
名称空间被删除-您可以看到这是如何在提交中完成的:
您可能只需将该插件转发给repo,然后自己进行类似的更改(基本上,只需删除api
字符串)。如果它有效,那就太好了,您应该发送一个pull请求,以便更新repo,其他人可以使用它!如果它不起作用,那么可能需要进行一些其他更改,但我们可以在找到它们时查看这些更改 In
替换:
import org.apache.cordova.api.CallbackContext;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.PluginResult;
借
在
替换:
import org.apache.cordova.api.CallbackContext;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.PluginResult;
借
Cordova 3.0版的新插件
Cordova 3.0版的新插件
好的,我会试一试,并尝试完成可能需要进行的任何其他更改。非常感谢你的建议,如果我有一些结果,我会给你更新:)不客气,如果你有任何问题,请继续在这里发帖,我会尽力帮助你解决!我删除了“api”,并成功构建了android应用程序!由于设计上的改变,我还不需要在我的JS中调用插件,但是如果它起作用,我会在github上发出一个pull请求。再次感谢!好的,我会试一试,并尝试完成可能需要进行的任何其他更改。非常感谢你的建议,如果我有一些结果,我会给你更新:)不客气,如果你有任何问题,请继续在这里发帖,我会尽力帮助你解决!我删除了“api”,并成功构建了android应用程序!由于设计上的改变,我还不需要在我的JS中调用插件,但是如果它起作用,我会在github上发出一个pull请求。再次感谢!