mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Merge pull request #223 from zoff-music/fix/offline-fixes
Dragging and loading
This commit is contained in:
@@ -985,7 +985,7 @@ function seekToMove(e){
|
|||||||
|
|
||||||
var acceptable = ["bar", "controls", "duration"];
|
var acceptable = ["bar", "controls", "duration"];
|
||||||
if(acceptable.indexOf($(e.target).attr("id")) >= 0 && dragging) {
|
if(acceptable.indexOf($(e.target).attr("id")) >= 0 && dragging) {
|
||||||
$("#bar").width(((100 / Player.player.getDuration()) * total) + "%");
|
$("#bar").width(((100 / duration) * total) + "%");
|
||||||
}
|
}
|
||||||
} catch(e){}
|
} catch(e){}
|
||||||
}
|
}
|
||||||
@@ -999,13 +999,15 @@ function seekToClick(e){
|
|||||||
|
|
||||||
Helper.log(total);
|
Helper.log(total);
|
||||||
if(!chromecastAvailable){
|
if(!chromecastAvailable){
|
||||||
Player.player.seekTo(total);
|
Player.player.seekTo(total + Player.np.start);
|
||||||
|
|
||||||
dMinutes = Math.floor(duration / 60);
|
dMinutes = Math.floor(duration / 60);
|
||||||
dSeconds = duration - dMinutes * 60;
|
dSeconds = duration - dMinutes * 60;
|
||||||
currDurr = total;
|
currDurr = total;
|
||||||
if(currDurr > duration)
|
if(currDurr - Player.np.start > duration) {
|
||||||
currDurr = duration;
|
currDurr = duration - Player.np.start;
|
||||||
|
}
|
||||||
|
currDurr = currDurr - Player.np.start;
|
||||||
minutes = Math.floor(currDurr / 60);
|
minutes = Math.floor(currDurr / 60);
|
||||||
seconds = currDurr - (minutes * 60);
|
seconds = currDurr - (minutes * 60);
|
||||||
document.getElementById("duration").innerHTML = Helper.pad(minutes)+":"+Helper.pad(seconds)+" <span id='dash'>/</span> "+Helper.pad(dMinutes)+":"+Helper.pad(dSeconds);
|
document.getElementById("duration").innerHTML = Helper.pad(minutes)+":"+Helper.pad(seconds)+" <span id='dash'>/</span> "+Helper.pad(dMinutes)+":"+Helper.pad(dSeconds);
|
||||||
|
|||||||
@@ -447,6 +447,13 @@ var Player = {
|
|||||||
$("#playpause").css("visibility", "hidden");
|
$("#playpause").css("visibility", "hidden");
|
||||||
$("#playpause").css("pointer-events", "none");
|
$("#playpause").css("pointer-events", "none");
|
||||||
$("#player").css("opacity", "1");
|
$("#player").css("opacity", "1");
|
||||||
|
if(offline) {
|
||||||
|
setTimeout(function(){
|
||||||
|
$("#channel-load").css("display", "none");
|
||||||
|
$("#playpause").css("visibility", "visible");
|
||||||
|
$("#playpause").css("pointer-events", "all");
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//$("#channel-load").css("display", "none");
|
//$("#channel-load").css("display", "none");
|
||||||
}
|
}
|
||||||
@@ -594,12 +601,6 @@ var Player = {
|
|||||||
//currDurr = currDurr - Player.np.start;
|
//currDurr = currDurr - Player.np.start;
|
||||||
minutes = Math.floor(currDurr / 60);
|
minutes = Math.floor(currDurr / 60);
|
||||||
seconds = currDurr - (minutes * 60);
|
seconds = currDurr - (minutes * 60);
|
||||||
/*if(isNan(minutes)) {
|
|
||||||
minutes = 0;
|
|
||||||
}
|
|
||||||
if(isNan(seconds)) {
|
|
||||||
seconds = 0;
|
|
||||||
}*/
|
|
||||||
document.getElementById("duration").innerHTML = Helper.pad(minutes)+":"+Helper.pad(seconds)+" <span id='dash'>/</span> "+Helper.pad(dMinutes)+":"+Helper.pad(dSeconds);
|
document.getElementById("duration").innerHTML = Helper.pad(minutes)+":"+Helper.pad(seconds)+" <span id='dash'>/</span> "+Helper.pad(dMinutes)+":"+Helper.pad(dSeconds);
|
||||||
per = (100 / duration) * currDurr;
|
per = (100 / duration) * currDurr;
|
||||||
if(per >= 100) {
|
if(per >= 100) {
|
||||||
|
|||||||
Reference in New Issue
Block a user