html5视频 - 让整个视频在Android上可点击播放? [英] html5 video - making the whole video clickable on Android to play?

查看:323
本文介绍了html5视频 - 让整个视频在Android上可点击播放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将html5视频添加到我的移动网络应用中,目前为了播放此视频,用户必须点击视频左下方的小播放图标。是否可以设置视频,以便用户点击它播放的任何部分?

I have added an html5 video to my mobile web app, at the moment in order to play this video the user has to click the small play icon at the bottom left of the video. Is it possible to set the video so that if the user clicks any part it plays?

在Android 2.3.3上测试,在iOS上整个视频似乎是可点击的

Testing on Android 2.3.3, on iOS the whole video seems to be clickable

我当前的代码:

<video src="video/video.mp4" type="video/mp4" width="300" height="188" class="video" controls preload="none" poster="img/test.png" webkit-playsinline>
    </video>

谢谢

推荐答案

使用jQuery你可以尝试这样的事情:

Using jQuery you could try something like this:

$('.video').click(function() {
    this.play();
});

这篇关于html5视频 - 让整个视频在Android上可点击播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆