diff --git a/public/scripts/adaptive-streaming-player.js b/public/scripts/adaptive-streaming-player.js index 3d05662..28f49ee 100644 --- a/public/scripts/adaptive-streaming-player.js +++ b/public/scripts/adaptive-streaming-player.js @@ -67,11 +67,11 @@ $(function () { callback(); }; xhr.ontimeout = function () { - var retryAmount = !retryCount ? 0 : retryCount; - if (retryCount == 2) { + var retryAmount = retryCount || 0; + if (retryAmount > 1) { console.error("Given up downloading") } else { - cluster._getClusterData(callback, retryCount++); + cluster._getClusterData(callback, retryAmount + 1); } } }; @@ -368,4 +368,4 @@ $(function () { updatePlayer(); }); -}); \ No newline at end of file +}); diff --git a/public/scripts/buffering-player.js b/public/scripts/buffering-player.js index 7bd3079..621abcd 100644 --- a/public/scripts/buffering-player.js +++ b/public/scripts/buffering-player.js @@ -59,11 +59,11 @@ $(function () { callback(); }; xhr.ontimeout = function () { - var retryAmount = !retryCount ? 0 : retryCount; - if (retryCount == 2) { - console.err("Given up downloading") + var retryAmount = retryCount || 0; + if (retryAmount > 1) { + console.error("Given up downloading") } else { - cluster._getClusterData(callback, retryCount++); + cluster._getClusterData(callback, retryAmount + 1); } } }; @@ -220,4 +220,4 @@ $(function () { basicPlayer.initiate(sourceFile, clusterData); } updatePlayer(); -}); \ No newline at end of file +});