fxfuture
fxfuture

Reputation: 1950

JWPlayer - disable clicking on video to pause/resume?

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

Upvotes: 2

Views: 8359

Answers (3)

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.

Upvotes: 1

The Coder
The Coder

Reputation: 5365

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.com/a/9200379/1129108

Upvotes: 0

Pedro Lobito
Pedro Lobito

Reputation: 99041

"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 completely 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

Upvotes: 1

Related Questions