Does html5 video work on android nexus one with android version 2.1?

和自甴很熟 提交于 2019-12-12 05:44:29

问题


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>

回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/2587125/does-html5-video-work-on-android-nexus-one-with-android-version-2-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!