javascript VideoJS:不适用于 IOS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17720816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
VideoJS: not working on IOS
提问by f_nosh
I used the videojs and it is working fine all browsers(including IE) and on Android . But it is not working on IOS devices (iphone and ipad IOS version 6).
我使用了 videojs,它在所有浏览器(包括 IE)和 Android 上都运行良好。但它不适用于 IOS 设备(iphone 和 ipad IOS 版本 6)。
Here is the code which I am using to add the video to the page.
这是我用来将视频添加到页面的代码。
<video id="video1" class="video-js vjs-default-skin" width="276" height="153" controls="" preload="auto" data-setup="{}">
<source src=myvideo.mp4 type="video/m4v" >
</video>
I have spent ages and could not find any solution. I m using video.js Version 3.2.0 and getting the loading spinner forever. I tried using version 4 and just black screen comes up.
我已经花了很长时间,找不到任何解决方案。我正在使用 video.js 版本 3.2.0 并永久获取加载微调器。我尝试使用第 4 版,但只出现黑屏。
Any Help please.
请任何帮助。
回答by Andrew Junior Howard
First put double quotes around the source src attribute and try that. If that doesn't solve it, it sounds like the problem is with the mp4 itself, most likely because of the way it's been encoded or it has a huge filesize. Try using videojs's default movie (http://vjs.zencdn.net/v/oceans.mp4) and see if that works. If it works, you know the problem lies with the movie file itself.
首先在源 src 属性周围加上双引号并尝试。如果这不能解决它,听起来问题出在 mp4 本身上,很可能是因为它的编码方式或文件大小很大。尝试使用 videojs 的默认电影(http://vjs.zencdn.net/v/oceans.mp4),看看是否有效。如果它有效,您就知道问题出在电影文件本身上。
回答by pigletfly
Your web server should support byte-range requests,check whether web server support 206 response. If you are using nginx,add mp4 module.
您的 Web 服务器应支持字节范围请求,请检查 Web 服务器是否支持 206 响应。如果您使用的是 nginx,请添加 mp4 模块。