From 3408f0d21ddf60121653b0d08250efb3a7ec1912 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 26 Mar 2015 21:02:58 +0530 Subject: [PATCH] start next video in timeout --- static/js/fs.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/fs.js b/static/js/fs.js index 92ef3ad8..b8858a2b 100644 --- a/static/js/fs.js +++ b/static/js/fs.js @@ -48,7 +48,10 @@ pandora.fs = (function() { delete that.downloads[id]; active = false; if (queue.length) { - cacheVideo.apply(null, queue.shift()); + var next = queue.shift(); + setTimeout(function() { + cacheVideo(next[0], next[1]); + }); } } else { downloadPart(part + 1); @@ -94,7 +97,10 @@ pandora.fs = (function() { delete that.downloads[id]; active = false; if (queue.length) { - cacheVideo.apply(null, queue.shift()); + var next = queue.shift(); + setTimeout(function() { + cacheVideo(next[0], next[1]); + }); } } else { pandora.api.get({id: id, keys: ['parts']}, function(result) {