禁用HTML5的播放/暂停/全屏< video>点击进入YouTube [英] Disable play/pause/full screen for HTML5 <video> on click for YouTube

查看:358
本文介绍了禁用HTML5的播放/暂停/全屏< video>点击进入YouTube的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让我们通过javascript禁用HTML5视频的点击播放/暂停/全屏功能,然后在我们再次需要时将其恢复?

Is there a way for us to disable the "play/pause/full screen on click" functionality for a HTML5 video through javascript and later put it back when we need it again?

推荐答案

我不确定为什么< video> 不承认事件。 preventDefault();

I'm not sure why <video> doesn't honor event.preventDefault();

我解决这个问题的方式非常糟糕。我只是覆盖父div的click和dblclick事件来解决我的问题,因为我只想阻止暂停/播放/全屏。

The way I go around this is pretty hacky. I just override the click and dblclick events of the parent div to solve my problem since I only want to prevent pause/play/full screen.

这篇关于禁用HTML5的播放/暂停/全屏&lt; video&gt;点击进入YouTube的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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