开发者

Why is firefox can't play HTML5 Video Element from Localhost?

开发者 https://www.devze.com 2023-03-19 13:17 出处:网络
Im try to play a video by HTML5 with the follow code on localhost : <html> <head> <meta charset=\"utf8\">

Im try to play a video by HTML5 with the follow code on localhost :

<html>
<head>
<meta charset="utf8">
    <title>HTML5 &lt;video&gt; content negotiation test</title>
</head>
<body>
</body>
<video src="Firefox.ogv"  autoplay="true" controls="true">
      Your browser does not support the <code>video</code>开发者_开发技巧; element.
</video>
</html>

it work perfectly with Chrome, http://imageshare.web.id/images/60h5p00ixmetpyerd7w.jpg

but why it not work with firefox http://imageshare.web.id/images/4bky59ruk8djra8wtmp.jpg

i Host it on IIS7 and this is my web.config

    <staticContent>
        <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
        <mimeMap fileExtension=".ogv" mimeType="video/ogv" /> 
    </staticContent>


It could be a problem with the way your MIME types are set up in your .htaccess file you may need to add the following to enable .ogv to be displayed properly

AddType video/ogg .ogv

Firefox tends not to play .ogg video if the mime type is incorrect!


You want "video/ogg", not "video/ogv".

0

精彩评论

暂无评论...
验证码 换一张
取 消