Firefox Video tag failed
i got a problem when use html5 video tag
I created a sample aspnet mvc project , on a page (named Index), i test video tag
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<video autoplay="true" controls="controls" type="video/mp4" id="vd" >
<source src="/Content/Video/oceans-mini.mp4"></source>
Your browser does not support the <code>video</code> element.
</video>
start debugging this project , it only work in Safari and Chrome, IE and firefox got dump with a gray rectangle and a "X" sign inside ...
after using firebug to check net request/response, i got this
[Response]
HTTP/1.1 206 Partial Content
Server: ASP.NET Development Server/10.0.0.0
Date: Tue, 27 Sep 2011 04:35:46 GMT
X-AspNet-Version: 4.0.30319
Content-Range: bytes 0-4484952/4484953
Etag: "1CC78E2DCD83280"
Cache-Control: public
Content-Type: application/octet-stream
Content-Length: 4484953
Connection: Close
why the connection is "close" , is there any config needs in my project
here my web config/webserver section , remain are default
<system.webServe开发者_如何学Cr>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
appreciate any suggest
firefox doesn't understand proprietary formats like mp4. you should use separate video formats and put them in source elements like so
<video controls> <source src="foo.ogg" type="video/ogg"> <source src="foo.mp4" type="video/mp4">
you can generate different formats online via media.io
Apple uses mp4 while firefox and ie use .ogg/.ogv. OGG was the standard but, Apple refused to use it that is why there are two now.
<video autoplay controls>
<source src="/Content/Video/oceans-mini.mp4" type="video/mp4">
<source src="/Content/Video/oceans-mini.ogv" type="video/ogg">
Your browser does not support the <code>video</code> element.
</video>
精彩评论