Video.js - 防止点击播放功能 [英] Video.js - preventing click-to-play functionality

查看:2165
本文介绍了Video.js - 防止点击播放功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用video.js将视频嵌入到HTML页面中。它将被用作仅限ipad的网络应用程序,因此我相信它使用的是原生HTML5播放器。我正在尝试禁用点击播放功能(以便用户必须使用控件)但我无法这样做。

I'm using video.js to embed a video into an HTML page. It is to be used as a ipad-only web app so I believe that it's using the native HTML5 player. I'm trying to disable the click-to-play functionality (so that the user must use the controls) but I am having trouble doing so.

我尝试从视频/视频播放器/海报中取消绑定点击事件(使用jQuery),我尝试使用addevent添加 e.preventDefault()到视频,但这似乎都不起作用。

I've tried unbinding the click event (using jQuery) form the video/video player/poster and I've tried using addevent to add e.preventDefault() to the video but none of this seems to work.

Ps。我找到了几个帖子,说你可以注释掉一行在代码中,但我的版本中不存在此行 - 也许插件已被重写。

Ps. I found a couple of posts saying you could comment out a line in the code, but this line doesn't exist in my version - maybe the plugin has been rewritten.

推荐答案

点击此处

https://github.com/videojs/video.js/blob/master/docs/api/vjs.MediaTechController.md#removecontrolslisteners

所以例如

v = videojs('scene04-video');
v.tech.removeControlsListeners();

这篇关于Video.js - 防止点击播放功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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