views:

1914

answers:

2

I'm trying to get an html5 demo page working on Android 2.1, have tried both droid and nexus one with 2.1 but they only display the poster image, and do not play the video. Pressing on the video does not do anything. Edit- resolved with the onclick handler on the video tag

Is it possible to use html5 video in the android 2.1 browser at this time? My demo page is working for both the iphone and the ipad.

The mp4 video: avc1, 29.97 fps, 380 kbps, 480 x 370 Audio: mp4a, 44 kHz, 64 kbps

Here's how the page is written:

<!DOCTYPE html>
<html><head><title>html5 test</title></head><body>
<video id="movie" width="480" height="370" poster="http://example.com/still.jpg" controls>
<source src="http://example.com/video.mp4" type="video/mp4">
Your browser does not support html5 video.
</video>
</body></html>
A: 

No, the Android Browser doesn't support HTML5 at the current time.

YaW
Why did they write "video tag support in fullscreen mode" here: http://developer.android.com/intl/fr/sdk/android-2.0-highlights.html then?
dar
dar
@dar That statement is from March 2009. `<video>` is supported now, in a limited way.
Roman Nurik
Roman, can you provide a working example page?
dar
+1  A: 

Update: with Android 2.1 I can get the video to play but not in the page by adding an onclick="this.play(); to the video tag like this:

<!DOCTYPE html>
<html><head><title>html5 test</title></head><body>
<video id="movie" width="480" height="370" poster="http://example.com/still.jpg" controls onclick="this.play();">
<source src="http://example.com/video.mp4" type="video/mp4">
Your browser does not support html5 video.
</video>
</body></html>

However, this does not play in the browser, it launches the media player to play the video in its own window.

dar
Why the downvote?
dar
I agree - it should work without the javascript, and I sure wish they had documented it somewhere. All I could find was a post on a mailing list from a year ago hinting it works in a limited fashion but without any information on how to get it to work. Oh well, hopefully this answer helps someone get going faster than it took me to figure it out.
dar