暂停html5视频点击无处不在

Pause html5 video click everywhere

本文关键字:无处不在 视频 html5 暂停      更新时间:2023-09-26

我想在有人点击网站的任何地方时暂停视频。

因此,我尝试了以下代码,但没有成功:
jQuery(document).click(function($) {
      document.getElementById('videojs_id_720598392_html5_api').pause();
});
有人看到我的错误了吗?

不用:

document.getElementById('videojs_id_720598392_html5_api').pause();

使用:

$('#your_element_id').get(0).pause();

你的代码应该可以工作。检查视频元素id