[英]Video Element not being detected in Safari 5.1.7 for Windows
I'm running Safari 5.1.7 on windows 7. 我在Windows 7上运行Safari 5.1.7。
I'm got a HTML 5 Video element playing on my website, and I use modernizr to test if video is supported before running the video script. 我的网站上播放了一个HTML 5视频元素,在运行视频脚本之前,我使用modernizr来测试是否支持视频。
According to caniuse.com, video is supported for Safari 5 . 据caniuse.com称, Safari 5支持视频 。 However, in the console,
Modernizr.video
is returning false. 但是,在控制台中,
Modernizr.video
返回false。 Why is it returning false, when video should be supported for this browser? 当此浏览器支持视频时,为什么返回false?
how did you embed your video? 你是怎么嵌入视频的? which video format are you using?
你使用哪种视频格式? please provide more information!
请提供更多信息!
Safari
only supports MP4
format, if you only provide ogg
or WebM
, this could be one reason for the error. Safari
仅支持MP4
格式,如果您只提供ogg
或WebM
,这可能是导致错误的一个原因。 Another could be that your missing your mime-types. 另一个可能是你错过了你的mime类型。 Either in the videotag (look code example),
在录像带中(看代码示例),
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4"> //safari support
<source src="movie.ogg" type="video/ogg"> //no safari support
</video>
or on the server side. 或者在服务器端。 you can set them in your .htaccess file like
你可以在你的.htaccess文件中设置它们
AddType video/mp4 .mp4
AddType video/mp4 .mov
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.