Unable to play video in HTML5

自作多情 提交于 2019-12-13 15:14:19

问题


I just started learning HTML5, I started with normal text file and changed its extension to .html and added the below code.

<!DOCTYPE HTML>
 <html>
 <body>

  <video width="320" height="240" controls="controls">
    <source src="D:\Movies\Troy (2004).avi" type="video/avi" /> 
    Your browser does not support the video tag.
  </video>

 </body>
 </html> 

I am using FireFox 4.0.


回答1:


Firefox doesn't support the avi container format




回答2:


Firefox doesn't support the avi format. Only ogg and webm are supported as also stated in this topic.

Edit: Peter Paul Koch has an more detailed overview of supported codecs in the different browsers available nowadays. See the article here.




回答3:


Convert your movie with Miro Video Converter or similar software

Miro - http://www.mirovideoconverter.com/

and you might want to make the player more compatible with multiple browsers.

<video width="320" height="240" controls="controls">
    <source src="movie.ogg" type="video/ogg" />
    <source src="movie.mp4" type="video/mp4" />
    <source src="movie.webm" type="video/webm" />
Your browser does not support the video tag.
</video>

example from http://www.w3schools.com/html5/html5_video.asp




回答4:


It looks like you're missing a few things to make this work cross-browser, and as stated above, firefox doesn't play well with the AVI container format.

Read this: http://diveintohtml5.ep.io/video.html Or you could check out a javascript solution like this that helps make things a bit easier: http://videojs.com/




回答5:


Firefox and Chrome do not support avi format , but the strange thing is if you just drop a avi file into the browser it plays just fine ! . I wonder when these browser have the capability of playing these files why are they not put in the html5 tag :\



来源:https://stackoverflow.com/questions/6293292/unable-to-play-video-in-html5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!