Developer IT
Developer IT

Reputation: 1213

HTML 5 Video on Android: mp4 problems

This issue has been driving me nuts all week.

I have a html5 video player that works everywhere except Android. I currently have tested it on a Samsung Galaxy Tab and a HTC Amaze 4G and none works.

I thought that it could be because my mp4 file does not have any audio track, so I tried with an other video that is working on another site, i.e. http://broken-links.com/tests/video/comparison.html

The first video works on my Galaxy Tab. If I copy it to my server, I does not.

This is the response header from broken-links.com

HTTP 200 OK
Accept-Ranges:bytes
Connection:Keep-Alive
Content-Length:1842836
Content-Type:video/mp4
Date:Thu, 15 Mar 2012 18:16:31 GMT
Keep-Alive:timeout=5, max=100
Last-Modified:Tue, 27 Jul 2010 20:59:49 GMT
Server:Apache

This is what I have from my server

HTTP 206 Partial Content
Accept-Ranges:bytes
Connection:Keep-Alive
Content-Length:1842836
Content-Range:bytes 0-1842835/1842836
Content-Type:video/mp4
Date:Thu, 15 Mar 2012 18:13:55 GMT
ETag:"780282-1c1e94-4bb4bbff0eaae"
Keep-Alive:timeout=15, max=98
Last-Modified:Thu, 15 Mar 2012 17:52:04 GMT
Server:Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/5.3.2-1ubuntu4.11 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.1

So basicaly I think my problem is down to this:

  1. Does Android accepts Partial Content ?
  2. If not, how can I disable it only for Android ??
  3. If Partial Content is not an issue, may the ETag be the guilty part ?

Thanks for you help.

Upvotes: 3

Views: 6218

Answers (2)

Leo
Leo

Reputation: 1505

I had trouble playing MP4s depending on the compression If I used anything higher than baseline for the profile it would not play. http://trac.ffmpeg.org/wiki/x264EncodingGuide#Compatibility

Upvotes: 1

Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83706

Android and HTML5 <video> is a disaster. It may work on some devices, but on most it doesn't. Don't try to do it until Android 4.0 has all the market share after three years.

Provide direct <a> links to video files on Android instead of trying to <video> tag.

More info

Android webview cannot render youtube video embedded via iframe

how to play html5 video on a webview android

Upvotes: 1

Related Questions