我的html5视频无法在android phonegap构建中运行, 当我按下视频的播放按钮时,我收到以下错误 eclipse控制台:
MediaPlayer(3349): Uri is <URL suppressed>
MediaPlayer(3349): error (1, -2147483648)
MediaPlayer(3349): Error (1,-2147483648)
我正在使用视频js,我的html代码如下:
<video id="example_video_1" class="video-js vjs-intro-skin nilfiskvideo" controls preload="auto" poster="" data-setup="{}">
<source src="./assets/movies/intro/Intro_Film_Edit.mp4" type="video/mp4" />
<source src="./assets/movies/intro/Intro_Film_Edit.webm" type="video/webm" />
<source src="./assets/movies/intro/Intro_Film_Edit.ogg" type="video/ogg" />
</video>
我可能会补充说我的javascript看起来像这样:
var myPlayer = _V_("example_video_1");
myPlayer.src([
{ type: "video/mp4", src: this.model.get("mp4") },
{ type: "video/webm", src: this.model.get("webm") },
{ type: "video/ogg", src: this.model.get("ogg")}
])
myPlayer.play();
感谢。
修改
好的,现在我尝试了不同的解决方案提案,包括使用普通的原生视频对象(没有视频-js)。
但我仍然得到URL抑制错误。
我是否需要设置一些权限以允许Android设备播放本地媒体文件,或者视频是否应该位于某个文件夹中?
答案 0 :(得分:0)
<video id="example_video_1" class="video-js vjs-intro-skin nilfiskvideo" controls preload="auto" poster="" data-setup="{}">
<source src="movies/intro/Intro_Film_Edit.mp4" type='video/mp4; codecs="vc1.42E01E, mp4a.40.2"' />
<source src="movies/intro/Intro_Film_Edit.webm" type='video/webm; codecs="vp8, vorbis"' />
<source src="movies/intro/Intro_Film_Edit.ogg" type='video/ogg; codecs="theora, vorbis"' />
</video>
<script>
$( document ).ready(function() {
//This is on load , You can also use 'example_video_1' click event
var video = $('#example_video_1').get(0);
video.load();
video.play();
});
</script>
答案 1 :(得分:0)
试试这个
<video class="video" class="video-js vjs-intro-skin nilfiskvideo" controls preload="auto" poster="">
<source src="./assets/movies/intro/Intro_Film_Edit.mp4" type="video/mp4" />
<source src="./assets/movies/intro/Intro_Film_Edit.webm" type="video/webm" />
<source src="./assets/movies/intro/Intro_Film_Edit.ogg" type="video/ogg" />
</video>