1

I'm having problems with embedding video and audio into a web page using HTML5 for Android browser. Two things i'm not sure about:

  1. The codecs that android browser supports
  2. What javascript callbacks should I use

This is what I wrote, and it’s not working. (However, it works on the desktop.)

<audio src="x.mp3" controls>
    Your browser does not support the audio element.
</audio>
<br/>
<video src="y.mp4"  controls>
    your browser does not support the video tag
</video>

I tried to use jPlayer plugin for jQuery. It works fine with the audio (.mp3) and with the demo video(.m4v). However it don't work with my video. I tried encoding it with no success. Thats the spec of the demo video(that works):

major_brand     : M4VP
    minor_version   : 1
    compatible_brands: M4VPM4A mp42isom
  Duration: 00:00:33.04, start: 0.000000, bitrate: 941 kb/s
    Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16, 127 kb/s
    Stream #0.1(eng): Video: h264, yuv420p, 480x270, 824 kb/s, 25 fps, 25 tbr, 600 tbn, 1200 tbc

and this is my video:

major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
  Duration: 00:00:30.24, start: 0.000000, bitrate: 534 kb/s
    Stream #0.0(eng): Video: h264, yuv420p, 480x320 [PAR 1:1 DAR 3:2], 404 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16, 127 kb/s

(it's the output from ffmpeg)

Michael
  • 133
  • 3
  • 12

1 Answers1

0

Huh. I’ve no experience with Android, but that does look like it should work, according to Dive into HTML5.

Is the video in the right format/profile etc? Is it being served with the right MIME type? Which version of Android are you testing on?

µBio
  • 10,668
  • 6
  • 38
  • 56
Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
  • Im using samsung galaxy s. Its on a basic html page. – Michael May 25 '11 at 22:17
  • There is an jQuery library called jPlayer. It uses HTML5 when it can and flash in other cases. It works on android. Hovewer i'm not sure if it using flash or HTML5 – Michael May 25 '11 at 23:05
  • According to Wikipedia, the Galaxy S shipped with Android 2.1, which I believe should support HTML5 video. There’s some other doscussion of this on Stack Overflow: see e.g. http://stackoverflow.com/questions/1711078/html5-video-element-on-android – Paul D. Waite May 26 '11 at 08:33
  • See also http://stackoverflow.com/questions/2596383/does-android-2-1s-browser-support-html-5-and-what-video-format-does-it-play and http://stackoverflow.com/questions/2911379/html5-video-element-on-android-does-not-play – Paul D. Waite May 26 '11 at 08:36
  • 1
    I think the problem is with the encoding of the video. – Michael May 26 '11 at 10:06
  • @Michael: sure, seems likely. [Dive into HTML5](http://diveintohtml5.org/video.html#miro) reckons that Miro's "iPhone" setting will encode video correctly for Android. It looks like Miro also has settings for specific Android phones if the iPhone option doesn't work. – Paul D. Waite May 26 '11 at 10:53
  • Android 2.3 is recommended for HTML5 playing. – StackOverflowed Apr 18 '12 at 12:30