【问题标题】:error during playing video in phonegap android using phonegap VideoPlayer Plugin使用phonegap VideoPlayer插件在phonegap android中播放视频时出错
【发布时间】:2013-09-28 07:28:34
【问题描述】:

VideoPlayer PLUGIN 这是我添加 video.js 的方法:

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

现在我创建 package src/com/phonegap/plugins/video/VideoPlayer.java 我不确定它是 c*orrect 还是错误?* 然后在 config .xml:

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

然后在 home.html 中

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

</script>

在运行应用程序时出现错误:

 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.

未能运行应用程序并出现错误“应用程序意外停止”请告诉我我做错了什么?我想播放已经保存在 WWW/video/1970.mp4 中的本地文件

【问题讨论】:

  • 从名称中删除 .java
  • 是的,它解决了错误问题,但我仍然无法播放视频这是什么原因
  • 所有问题都已解决,但我收到警报(无法播放视频)不支持的文件类型我使用 .mp4 和 android 2.2

标签: java javascript jquery cordova video-player


【解决方案1】:

nsawaya 已经回答(不需要 .java 扩展名),我添加这些行以进一步澄清 plugin.xml 文件。

<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>

【讨论】:

    猜你喜欢
    • 2012-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多