HTML-5 : video tag. Video not playing
I was trying use/test video tag of HTML-5. Here is the code
<!DOCTYPE HTML>
<html>
<body>
<video src="./Pilot.avi" controls="controls">
your browser does not support the video tag
</video>
</body>
</html>
Pilot.avi is stored in the same same directory as this HTML page.
The problem is, I am seeing the controls being displa开发者_StackOverflow中文版yed but can't play the video.
I tried with,
1) Mozilla Firefox 3.6.13
2) Google Chrome 8.0.552.224
What could be the problem?
Regards, Microkernel
Try a different video format. Check this for reference.
The most likely cause is that the video format isn't supported by the browsers. I think think anything supports AVI containers, and that is before we get into questions about codecs.
.avi container is not supported for HTML5 videos. You'd use other formats, I reccomend VP8 codec (or WebP): is developed by Google and seems to be the future web video format. Here you can find more info about it and here there is a list of tools you can use to convert your videos in this format.
Yours sincerely, Tancredi.
If the file is on your local file system, some browsers may cause a problem.
I was implementing something similar and with Firefox, I couldn't access a video file on my local folder with HTML5 video tag.
But Chrome worked like a charm in my case.
The mp4 codec...although controversial among many open source purists...is the best solution and it is supported by just about every browser. In addition it can be used inside a flash container so you can have one file for html5 and a flash fallback.
Also there is a chance that a long video will not play. Try a short video with a 15s or 20s duration. It might work.
精彩评论