jquery - javascript progressbar and slider -


I'm having some difficulty, I'm making my own control for an html5 video player. I have everything working correctly, but I would like to have a specific color and a different color of thumb left to the thumbs for my slider. I have seen another example here, which is almost done with jquery, but I can only work by clicking on it and not doing the project automatically with the video. I am new to javascript and can really do it with help to work.

  & lt; Script & gt; Var vid, playbtn, mutebtn, fullscreenbtn, finder, volumemider, curtitext, dirtimetext; Function Internal Player () {// Set Object Reference vid = document.getElementById ("my_player"); Playbtn = document.getElementById ("playpausebtn"); Mutebtn = document.getElementById ("mutebtn"); Fullscreenbtn = document.getElementById ("fullscreenbitten"); Seekslider = document.getElementById ("Finder"); Volumeslider = Document. GetElementById ("Volsm"); Curtimetext = document.getElementById ("karmated"); Durtimetext = document.getElementById ("animated"); // Add event listeners to playbtn.addEventListener ("click", playpause, false); Mutebtn.addEventListener ("click", vidmute, false); Fullscreenbtn.addEventListener ("click", toggleFullScreen, false); Seekslider.addEventListener ("change", vidSeek, false); Volumeslider.addEventListener ("change", setvolume, false); Vid.addEventListener ("timeupdate", seektimeupdate, false); } Window.onload = intializePlayer; Function Plays () (if (vid.paused) {vid.play (); Playbtn.style.background = "url (images / pause.png)";} and {vid.pause (); Playbtn.style.background = "Url (images / play pages)";}} function vidSeek () {var seekto = vid.duration * (seekslider.value / 100); Vid.currentTime = seekto;} seektimeupdate () {var nt = vid.currentTime * (100 / vid.duration); Seekslider.value = nt; Var curmins = Math.floor (vid.currentTime / 60); Var cursecs = Math.floor (vid.currentTime - curmins * 60); Var durmins = Math (Dvdscs = "0" Dursecs = "0" + dursecs;} if (Curriman & lt; 10) {curmins = "0" + cream;} if (dermin <10) {durmins = "0" + durmins;} Curtimetext.inn ErHTML = curmins + ":" + cursecs; Durtimetext.innerHTML = durmins + ":" + dursecs;} function vidmute () {if (vid.mute) {vid.mute = false; Mutebtn.style.background = "url ( Images / volume page) "; Volumeslider.value = 100; } And {vid.muted = true; Mutebtn.style.background = "url (Images / Mute Pages)"; Volumeslider.value = 0; }} Function set volume () {vid.volume = volumes.lue.value / 100; } Function toggle fullscreen () {if (vid.requestFullScreen) {vid.requestFullScreen (); } And if (vid.webkitRequestFullScreen) {vid.webkitRequestFullScreen (); } And if (vid.mozRequestFullScreen) {vid.mozRequestFullScreen (); }} & Lt; / Script & gt;    

I think what you are trying to do is "seektimeupdate" function Every second To do this, you can use an object called "setInterval", the code looks something like this.

  var updateBar = setInterval (function () {// Here you put the code you want, here seektimeupdate ();}, 1000)   < P> What is the meaning of code "3", delay in milliseconds, every time the code is removed. You can think of "setInterval" as a loop, which displays its code at a set rate, which is finally specified by number. Sorry, if I misunderstood my question and if you want more help on the "set interval" function see the W3 school documentation about it  

Edit: This code works, assuming it That you can find the duration of the film in seconds and in the seconds of the movie, in the second, whatever problem you may face, the slider is changing, depending on how the user transfers the thumb. Or if they stop the film. I would recommend using the variable to buffer the function. (Note): Just change jquery in jsfiddle link to give me this in the comments with you.

  var movie = {// movie duration, in seconds: 1000, // time in current movie, at current time: 0 var update = setInterval (function () {movie Cc ('background-image', 'webkit-gradient (linear, left top, right top,' + '' Color-stop ('+ wall +', # 94 A14E), '+' color-stop ('+ +', # c5c5c5) '+') ');}, 1000);    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -