javascript - Problems with the video slider -


hi i've added simple function javascript pauses video when slider handle being dragged , unpauses when released(this happens if video playing , works properly).if video paused instead, when slider handle released want video remain paused(this part doesn't work) . problem i've encountered after release slider handler resumes playing. i've tried working around problem variable doesn't seem work. here code:

js:

// pause video when slider handle being dragged var control=0; seekslider.addeventlistener("mousedown", function() {      if(video.pause==true)     {         control=1;      }     else {         video.pause();     }          });      // play video when slider handle dropped seekslider.addeventlistener("mouseup", function() {          if(control>0)         {             control=0;         }         else         {             video.play();          }         }); 

add 1 more function

function seektimeupdate(){     var nt = video.currenttime * (100 / video.duration);     seekslider.value = nt; } 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -