HTML5视频“黑屏”在iPad上 [英] HTML5 Video "Black Screen" on iPad

查看:586
本文介绍了HTML5视频“黑屏”在iPad上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个内嵌视频的网​​站。此网站也需要为iPad用户提供服务,但目前我在使用ol' video 标签时遇到问题。我有一个可以在浏览器中播放的视频但不幸的是在iPad上播放。

I'm building a website that has videos embedded within them. This website needs to cater for iPad users as well but I'm having trouble with the ol' video tag at the moment. I have a video that plays fine in browsers but not on an iPad unfortunately.

我只是在iPad上出现黑屏,并且没有任何错误信息可以说。

I'm just getting a black screen with the iPad, and no error message to speak of.

以下是我的视频代码:

<video id="movie" width="790" height="250" controls >
    <source src="anim/intro.ipad.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
    <source src="anim/intro.webm" type='video/webm; codecs="vp8, vorbis"'>
    <source src="anim/intro.theora.ogv"  type='video/ogg; codecs="theora, vorbis"'>
</video>
<script>
    var v = document.getElementById("movie");
    v.onclick = function() {
        if (v.paused) {
            v.play();
        } else {
            v.pause();
        }
    };
</script>

这些视频都是在关于HTML5视频的教程之后创建的。它们都使用Miro Video转换器上的首选iPad设置进行编码。

The videos were all created following tutorials about HTML5 video. They were all encoded using preferred iPad settings on Miro Video converter.

只是因为这很重要(我不确定会不会)我正在iPad上测试视频模拟器。

Just incase this matters (I'm not sure it will) I'm testing the video on an iPad simulator.

无论我做什么,我都无法播放视频:

No matter what I do, I just can't get the video to play:

< img src =https://i.stack.imgur.com/H1wSt.pngalt =在iPad模拟器上>

推荐答案

你确定你的编码是正确的吗?

试试这个来测试它:

Are you sure you got the encoding right?
Try this to test it:

<video src="anim/intro.ipad.mp4" controls>  
      Your browser does not support the video element.  
</video>  

这篇关于HTML5视频“黑屏”在iPad上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆