The latest version of Chrome (Version 27.0.1453.110 m) as of 5 June 2013 does not play mp4 videos. For an example W3Schools Video Sandbox gives me video controls and nothing else. (Sorry can't post a screen shot, just signed up to StackO.)
Anyone know why?? and a fix?
Yes:
There is an answered question like this
chrome could play html5 mp4 video but html5test said chrome did not support mp4 video codec
and
There is an unanswered question like this:
html5 video issue with chrome
On chrome, it does not play ,mp4 video. On firefox, it does.
If your mp4 video does not play in the web browsers and devices, it's probably because the video is not HTML5 compatible. You can view this tutorial to convert the video file to HTML5 compatible: How to convert video to HTML5 compatible.
After running into the same issue - here're some of my thoughts:
As it affects only Chrome (other browsers work fine with VideoForEverybody solution) the solution I've used is:
apply following js:
if (window.chrome)
$("[type=video\\\/mp4]").each(function()
{
$(this).attr('src', $(this).attr('src').replace(".mp4", "_c.mp4"));
});
Unfortunately it's a bad Chrome hack, but hey, at least it works.
I have had the same problem, Even though I didn't get any answer, I tried to solve it in another way, here is what I did:
First, embed the video in your html:
<video id="videoId" width="100%" autoplay loop>
<source src="main.webm" type="video/webm">
<source src="main.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
Then detect if the Browser is chrome:
var isChrome = !!window.chrome;
var isIE = /*@cc_on!@*/false;
If its chrome, replace the video with webm version. (For those who haven't faced the problem themselves: if you embed both mp4 and webm , chrome will not play any of them, so you have to embed "webm" only)
if( isChrome ) {
$("#videoId").replaceWith($('<video id="videoId" width="100%" autoplay loop><source src="video.webm" type="video/webm"></video>'));
}
And as for IE: In my case I replaced the html5 video with an image:
if( isIE ) {
$("#videoId").replaceWith($('<img id="videoId" src="img/video.jpg" />'));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With