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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -