user2204799
user2204799

Reputation: 11

JW Player Auto Pause On Wordpress

I have a wordpress site with a jwplayer but i want to know how can I auto pause it after 30 mins.

please help me with this problem

please be brief on the answer on where can i put the codes to work it properly

thank you

Upvotes: 0

Views: 243

Answers (1)

JeroenW
JeroenW

Reputation: 191

There are two ways to interpret "after 30 minutes". If you want to do this after 30 minutes of calendar time:

setTimeout(function(){
    jwplayer().pause();
},30*60*1000);

If you want to do this when the 30 minute mark of a video is hit:

jwplayer().onTime(function(event){
    if(event.position >  30*60) {
        jwplayer().pause();
    }
});

Upvotes: 1

Related Questions