Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
YaPaY authored Oct 3, 2018
1 parent e42f834 commit 183f062
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@
#progress-wrapper {
width: 100%;
margin: auto;
position: fixed;
position: absolute;
bottom: 10%;
left: 0;
right: 0;
color: white;
font-size: 2em;
display: none;
z-index: 100;
}
#progress-outer {
-webkit-border-radius: 2em;
Expand All @@ -89,6 +90,7 @@
background-color: #444;
}
#progress {
-webkit-border-radius: 2em;
margin: 0;
left: 0;
width: 0%;
Expand Down Expand Up @@ -136,13 +138,17 @@
plotInfo = $("#plot"),
loadingAni = $("#loading"),
isSuspended = false,
isRewinding = false,
O = $("#volume"),
T = $("#vol_text"),
msg = $("#message"),
timeCurrent = $('#time-current'),
timeTotal = $('#time-total'),
progressBar = $('#progress'),
progressBox = $('#progress-wrapper'),
timeShift = 0,
currentPosition = null,
positionTimeout,
progressInterval,
progressTimeout,
gt,
Expand Down Expand Up @@ -176,7 +182,7 @@

function hideLoadingAni() {
loadingAni.hide();
gt && clearTimeout(gt); gt = null;
gt && clearTimeout(gt);
msg.hide();
}

Expand Down Expand Up @@ -270,8 +276,10 @@
}

function updateProgress() {
var tc = v.GetPosTime(),
var tc = ((null == currentPosition) ? v.GetPosTime() : currentPosition) + timeShift,
tt = v.GetMediaLen();
if(tc > tt) tc = tt;
else if(tc < 0) tc = 0;
timeCurrent.text(tc.toHMS());
timeTotal.text(tt.toHMS());
progressBar.css('width', (100/tt*tc)+'%');
Expand All @@ -293,10 +301,23 @@
}

function rewind(i) {
positionTimeout && clearTimeout(positionTimeout);
if(null === currentPosition) {
currentPosition = v.GetPosTime();
timeShift = 0;
}
timeShift += i;
positionTimeout = setTimeout(function() {
var pos = currentPosition + timeShift,
maxpos = v.GetMediaLen();
if(pos < 0) pos = 0;
else if(pos > maxpos) pos = maxpos;
v.SetPosTime(pos);
timeShift = 0;
currentPosition = null;
showProgress();
}, 8e2);
showProgress();
var pos = v.GetPosTime() + i;
if(pos < 0) pos = 0;
v.SetPosTime(pos);
}

function handleDirection(t) {
Expand Down Expand Up @@ -634,21 +655,13 @@
}

$(document.body).keydown(function(t) {

T.text('keyCode=' + t.keyCode + ' which=' + t.which + ' alt=' + t.altKey + ' ctrl=' + t.ctrlKey + ' shift=' + t.shiftKey + ' key=' + t.key);
O.show();

switch(t.keyCode || t.which) {
case 8:
case 83:
goBack();
break;
case 85:
if(t.altKey) {
toggleSuspendState();
} else {
v.Continue();
}
toggleSuspendState();
break;
case 82:
showProgress();
Expand Down

0 comments on commit 183f062

Please sign in to comment.