html5 视频可以在 Android Nexus One 和 Android 版本 2.1 上运行吗?

发布于 2024-08-28 01:38:33 字数 688 浏览 8 评论 0原文

我正在尝试在 Android 2.1 上运行一个 html5 演示页面,已尝试使用 2.1 的 droid 和 Nexus One,但它们只显示海报图像,而不播放视频。按视频不会执行任何操作。 使用视频标签上的onclick处理程序进行编辑-解决

此时是否可以在android 2.1浏览器中使用html5视频?我的演示页面适用于 iPhone 和 iPad。

mp4 视频:avc1、29.97 fps、380 kbps、480 x 370 音频:mp4a、44 kHz、64 kbps

页面的编写方式如下:

<!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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧竹 2024-09-04 01:38:33

更新:使用 Android 2.1,我可以通过向视频标签添加 onclick="this.play(); 来播放视频,但不能在页面中播放,如下所示:

<!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>

但是,这不会在浏览器启动媒体播放器在自己的窗口中播放视频。

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.

心如狂蝶 2024-09-04 01:38:33

不,Android 浏览器目前不支持 HTML5。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文