start next video in timeout

This commit is contained in:
j 2015-03-26 21:02:58 +05:30
parent 7b401cfe28
commit 3408f0d21d

View file

@ -48,7 +48,10 @@ pandora.fs = (function() {
delete that.downloads[id]; delete that.downloads[id];
active = false; active = false;
if (queue.length) { if (queue.length) {
cacheVideo.apply(null, queue.shift()); var next = queue.shift();
setTimeout(function() {
cacheVideo(next[0], next[1]);
});
} }
} else { } else {
downloadPart(part + 1); downloadPart(part + 1);
@ -94,7 +97,10 @@ pandora.fs = (function() {
delete that.downloads[id]; delete that.downloads[id];
active = false; active = false;
if (queue.length) { if (queue.length) {
cacheVideo.apply(null, queue.shift()); var next = queue.shift();
setTimeout(function() {
cacheVideo(next[0], next[1]);
});
} }
} else { } else {
pandora.api.get({id: id, keys: ['parts']}, function(result) { pandora.api.get({id: id, keys: ['parts']}, function(result) {