多个 Html5 视频无法在 ipad 上播放(但请继续阅读,因为我知道视频编码正确)
我已经遵循了许多教程来确保这是正确的,但这对我来说根本不起作用。 如果我将下面的代码粘贴到同一服务器上的新 html 页面中(这是从生成的源中剪切和粘贴的),则下面的代码可以工作:
<source src='http://turner.bionic-comms.co.uk/vids/rc/rc-iPhone.m4v' type="video/mp4" />
<source src='http://turner.bionic-comms.co.uk/vids/rc/rc.mp4' type="video/mp4" />
<source width='254' height='143' src='http://turner.bionic-comms.co.uk/vids/rc/rc.ogg' type="video/ogg" />
<object width="254" height="143" type="application/x-shockwave-flash" data="http://turner.bionic-comms.co.uk/vids/video_player/video_player.swf">
<!-- Firefox uses the `data` attribute above, IE/Safari uses the param below -->
<param name="movie" value="http://turner.bionic-comms.co.uk/vids/video_player/video_player.swf" />
<param name="allowFullScreen" value="true" />
<param name="flashvars" value="file=http://turner.bionic-comms.co.uk/vids/rc/rc.flv&image=http://turner.bionic-comms.co.uk/vids/rc/rc-poster.jpg" />
<!-- Fallback image. -->
<img src="telematics_desktop.jpg" width="254" height="143" alt="telematics" title="No video playback capabilities." />
但是,如果我动态生成此代码以在页面上包含多个视频,它会中断并且不会玩吧。我刚拿到一个黑盒子。 这些图像包含在带有翻页功能的 jquery 小册子中。
有谁知道我如何对其进行排序并使其播放?它适用于 Safari 和 Chrome。 谢谢
I have followed many a tutorial to make sure that this is correct but this simply isn't working for me.
The code below works if I paste it into a fresh html page on the samer server (and this is cut and paste from the generated source):
<source src='http://turner.bionic-comms.co.uk/vids/rc/rc-iPhone.m4v' type="video/mp4" />
<source src='http://turner.bionic-comms.co.uk/vids/rc/rc.mp4' type="video/mp4" />
<source width='254' height='143' src='http://turner.bionic-comms.co.uk/vids/rc/rc.ogg' type="video/ogg" />
<object width="254" height="143" type="application/x-shockwave-flash" data="http://turner.bionic-comms.co.uk/vids/video_player/video_player.swf">
<!-- Firefox uses the `data` attribute above, IE/Safari uses the param below -->
<param name="movie" value="http://turner.bionic-comms.co.uk/vids/video_player/video_player.swf" />
<param name="allowFullScreen" value="true" />
<param name="flashvars" value="file=http://turner.bionic-comms.co.uk/vids/rc/rc.flv&image=http://turner.bionic-comms.co.uk/vids/rc/rc-poster.jpg" />
<!-- Fallback image. -->
<img src="telematics_desktop.jpg" width="254" height="143" alt="telematics" title="No video playback capabilities." />
However, if I dynamically generate this code to have multiple videos on the page it breaks and doesn't play. I just get a black box.
The images are contained within a jquery booklet with pageturns.
Does anyone have any idea how I can sort this and get it playing? It works in safari and chrome.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题不在于编码,问题在于 iOS 不允许视频播放器的多个实例。这是苹果网站上写的。你可以在这个链接中查看
苹果网站中的链接
目前,所有运行 iOS 的设备都仅限于在任何时候播放单个音频或视频流。 iOS 设备目前不支持播放多个视频(并排、部分重叠或完全重叠)。也不支持同时播放多个音频流。但是,您可以动态更改音频或视频源。详细信息请参见“依次更换媒体源”
The problem is not with the encode , the problem is that iOS does not permit multiple instance of video player . this is written in the web site of apple . you can check it in this link
Link in apple Site
Currently, all devices running iOS are limited to playback of a single audio or video stream at any time. Playing more than one video—side by side, partly overlapping, or completely overlaid—is not currently supported on iOS devices. Playing multiple simultaneous audio streams is also not supported. You can change the audio or video source dynamically, however. See “Replacing a Media Source Sequentially” for details