javascript - JWPlayer - disable clicking on video to pauseresume? - Stack Overflow

I'm using the player as a video background for my site and I want to be able to disable the abilit

I'm using the player as a video background for my site and I want to be able to disable the ability to click on the video to pause/resume.

How can I do this?

Thanks

I'm using the player as a video background for my site and I want to be able to disable the ability to click on the video to pause/resume.

How can I do this?

Thanks

Share Improve this question asked Aug 25, 2011 at 1:39 fxfuturefxfuture 1,9504 gold badges26 silver badges41 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 1

"I've solved this problem by editing file "DisplayView.as" in "private function firstClick()", just adding a simple "return;" as the first statemenet. This way I've ignored pletely clicking on the display area, so that Flash can handle the click if needed (for example in Symbian mobile phones, clicking the video makes the player go fullscreen, which is impossible to do without this hack)."

Stolen from Disable play/pause on click

I have found a solution for this in jwplayer version 7. I guess it could work on previous players too. First of all, the div you attach the player must have the following script: I wrote it in jQuery:

$('.divPlayer').setup({...});// you setup the player.
$('.divPlayer').on('click', function (e) {
    e.preventDefault(); 
    e.stopPropagation(); // stop propagating anything...
});

Then you need to add a css rule at the divPlayer:

&::before{
    content:'';
    position:absolute; 
    width:100%; height:100%;
    z-index:1;
}

Finally you need the controls to be higher in z-index than the ::before

.jw-controls {
    z-index:2;
}

Hope that helps.

I've just got this working using the javascript events of the JW Player (both for me and another question). Here's the link to my answer: https://stackoverflow./a/9200379/1129108

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745482338a4629614.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信