视频标签现在无法在Safari中使用 [英] Video tag not working in Safari now
问题描述
以下代码使视频标签可在IE9,Chrome和Firefox中使用。但是我不能让它在Safari中工作
The code below makes the video tag work in IE9, Chrome and Firefox. However I cant get it to work in Safari
<video width="400" height="300" controls="controls" poster="ContractorTestingVideos/cntrtest1.jpg">
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.ogg" type="video/ogg; codecs='theora, vorbis'"></source>
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.ogg" type="video/webm; codecs='vp8, vorbis'"></source>
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.m4v" type="video/x-m4v"></source>
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.mp4" type="video/mp4; codecs='avc1.42E01E, mp4a.40.2'"></source>
</video>
所以对于Safari,我试过这个,
So for Safari, I tried this,
<video width="400" height="300" controls="controls" poster="ContractorTestingVideos/cntrtest1.jpg" src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.mp4"></video>
仍然不起作用。我确实将网址直接粘贴到了Safari地址栏中,它确实带回了视频并播放了它。
Still doesn't work. I did paste the url directly into a Safari address bar and it did bring back the video and play it.
有关如何让html5视频标签工作的任何想法苹果浏览器?
我的Safari版本是5.0.5(7533.21.1),我正在使用64位虚拟机,操作系统是Windows 7
Any ideas on how to get the html5 video tag to work in safari? My Safari build is 5.0.5(7533.21.1) and I am working on a 64 bit virtual machine, OS is Windows 7
推荐答案
尝试重新排列视频源列表,使您的.mp4视频成为第一位。出于某种原因,我从来没有能够在Mobile Safari上播放视频,而且很少在桌面Safari上播放视频而不这样做。
Try rearranging your list of video sources to that your .mp4 videos come first. For some reason, I've never been able to get a video to play on Mobile Safari, and rarely on desktop Safari, without doing that.
喜欢这样:
<video width="400" height="300" controls="controls" poster="ContractorTestingVideos/cntrtest1.jpg">
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.mp4" type="video/mp4; codecs='avc1.42E01E, mp4a.40.2'"></source>
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.ogg" type="video/ogg; codecs='theora, vorbis'"></source>
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.ogg" type="video/webm; codecs='vp8, vorbis'"></source>
<source src="http://1.1.1.1/Intranet/ContractorTestingVideos/cntrtest1.m4v" type="video/x-m4v"></source>
</video>
这篇关于视频标签现在无法在Safari中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!