Added verbosity and fixed bug in refreshNextTimer
This commit is contained in:
parent
e1528c0155
commit
91c89ba28f
|
|
@ -302,10 +302,11 @@ module.exports = class{
|
||||||
if(currentItem != null && (this.nowPlaying == null || currentItem.uuid != this.nowPlaying.uuid)){
|
if(currentItem != null && (this.nowPlaying == null || currentItem.uuid != this.nowPlaying.uuid)){
|
||||||
//Start the found item at w/ a pre-calculated time stamp to reflect the given start time
|
//Start the found item at w/ a pre-calculated time stamp to reflect the given start time
|
||||||
this.start(currentItem, Math.round((new Date().getTime() - currentItem.startTime) / 1000) + currentItem.startTimeStamp, volatile);
|
this.start(currentItem, Math.round((new Date().getTime() - currentItem.startTime) / 1000) + currentItem.startTimeStamp, volatile);
|
||||||
}
|
console.log("starting now from refreshNextTimer")
|
||||||
|
//Otherwise, if we have a next item
|
||||||
//If we have a next item
|
//CODE CHANGE CODE CHANGE
|
||||||
if(nextItem != null){
|
//Changes this over to an else if so refreshNextTimer wouldn't start it twice when there was no current item or next item
|
||||||
|
}else if(nextItem != null){
|
||||||
//Calculate the amount of time in ms that the next item will start in
|
//Calculate the amount of time in ms that the next item will start in
|
||||||
const startsIn = nextItem.startTime - new Date().getTime();
|
const startsIn = nextItem.startTime - new Date().getTime();
|
||||||
|
|
||||||
|
|
@ -721,6 +722,7 @@ module.exports = class{
|
||||||
|
|
||||||
//Kick off the sync timer
|
//Kick off the sync timer
|
||||||
this.syncTimer = setTimeout(this.sync.bind(this), this.syncDelta);
|
this.syncTimer = setTimeout(this.sync.bind(this), this.syncDelta);
|
||||||
|
console.log('kicking off sync timer from start');
|
||||||
|
|
||||||
//Setup the next video
|
//Setup the next video
|
||||||
this.refreshNextTimer();
|
this.refreshNextTimer();
|
||||||
|
|
@ -746,6 +748,7 @@ module.exports = class{
|
||||||
|
|
||||||
//Call the sync function in another second
|
//Call the sync function in another second
|
||||||
this.syncTimer = setTimeout(this.sync.bind(this), this.syncDelta);
|
this.syncTimer = setTimeout(this.sync.bind(this), this.syncDelta);
|
||||||
|
console.log('re-kicking sync timer from sync');
|
||||||
}else{
|
}else{
|
||||||
//Get leftover video length in ms
|
//Get leftover video length in ms
|
||||||
const leftover = (this.nowPlaying.duration - this.timestamp) * 1000;
|
const leftover = (this.nowPlaying.duration - this.timestamp) * 1000;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue