MP4 video delivery via PHP fails in Google Chrome MP4 video delivery via PHP fails in Google Chrome google-chrome google-chrome

MP4 video delivery via PHP fails in Google Chrome


Maybe the problem is with the URL (more specifically, the extension). Normally, you would use Content-Disposition header, but I understand that this is not desirable when delivering content to mobiles.

Try using localhost/myscript.php/myvideo.mp4

It is important not to use the "Content-Disposition" HTTP header, since some phones refuse to accept content when using it. By including the filename on the URL, you will trick the phone to think it's a real file and to accept it.

Now, when you send the download URL to the customer, you don't normally know yet what device the customer has, so you don't know what file formats the device will support. Therefore, you can't include the filename on that URL, and once again, you will need an intermediate download page. Once more, we will use a URL like:

http://wap.mydomain.tld/get.php/123456abcdef

This time, when the customer connects to download the content, the get.php script will not create a temporary file, but point to another script which streams the file contents. Supposing the resultant content to download will be "image.jpg", the intermediate download page could point the customer to a URL like:

http://wap.mydomain.tld/download.php/123456abcdef/image.jpg

From ( http://mobiforge.com/developing/story/content-delivery-mobile-devices )


I understand you're using video-js but I recommend using html5media (also check out the github page for more info). I had to make videos available on a website for work and I tried a few things including video-js but html5media was the only one that I could get working in all browsers.

A side note that might help others: One of the requirements was that we hosted all files so that we wouldn't be reliant on third-party servers to serve JavaScript files or flash players, I can't remember if with video-js this was easy but I know with html5media we were able to download flowplayer and have everything on our servers.

And to generate the 3 recommend video formats (mp4, WebM and Theora) I used Miro Video Converter