Fixed issue with duration not working on songs without a start and end set

This commit is contained in:
Kasper Rynning-Tønnesen
2017-11-08 15:44:48 +01:00
parent 736ae6abea
commit f90af8d2e1

View File

@@ -75,6 +75,13 @@ var Player = {
end: obj.np[0].end,
duration: obj.np[0].duration,
};
if(!obj.np[0].hasOwnProperty("start")) {
Player.np.start = 0;
}
if(!obj.np[0].hasOwnProperty("end")) {
Player.np.end = Player.np.duration;
}
conf = obj.conf[0];
time = obj.time;
seekTo = (time - conf.startTime) + Player.np.start;
@@ -96,6 +103,12 @@ var Player = {
end: obj.np[0].end,
duration: obj.np[0].duration,
};
if(!obj.np[0].hasOwnProperty("start")) {
Player.np.start = 0;
}
if(!obj.np[0].hasOwnProperty("end")) {
Player.np.end = Player.np.duration;
}
conf = obj.conf[0];
time = obj.time;
seekTo = (time - conf.startTime) + Player.np.start;