Added nonclickable progressbar in the playercontrols

This commit is contained in:
KasperRT
2015-02-24 22:33:34 +01:00
parent bfed58de1b
commit 0e8229c1f2
3 changed files with 21 additions and 1 deletions

View File

@@ -41,6 +41,12 @@ function initYoutubeControls(player)
newElem.appendChild(newChild);
}
container.appendChild(newElem);
newElem = document.createElement("div");
newElem.id = "bar";
container.appendChild(newElem);
initControls();
fitToScreen();
$("#mute").hover(function(){hoverMute(true)}, function(){hoverMute(false)});
@@ -155,6 +161,12 @@ function durationSetter()
minutes = Math.floor(currDurr / 60);
seconds = currDurr - minutes * 60;
document.getElementById("duration").innerHTML = pad(minutes)+":"+pad(seconds)+" <span id='dash'>/</span> "+pad(dMinutes)+":"+pad(dSeconds);
per = (100 / duration) * currDurr;
if(per >= 100)
per = 100;
else if(duration == 0)
per = 0;
$("#bar").width(per+"%");
}
function pad(n)