javascript - Can't get "If paused" to work in videojs -


i'm trying show overlay on video when video paused. docs took:

var ispaused = myplayer.paused(); var isplaying = !myplayer.paused(); 

and implemented follows:

var ispaused = myplayer.paused(); if (ispaused == true) { $("#social_share").fadein(1500); }  var isplaying = !myplayer.paused(); if (isplaying == true) { $("#social_share").fadeout(1500);  } 

unfortunately did not work, , can't find why. thoughts highly apricaited!

(ps: shows on initial start logical since player paused @ time. idea's on how prevented more welcome.)

thanks!

you're looking events. specifically, pause , play events.

try:

myplayer.on("pause", function () {     $("#social_share").fadein(1500); });  myplayer.on("play", function () {     $("#social_share").fadeout(1500); }); 

reference:


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -