Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LNFWebsite committed Apr 27, 2016
1 parent c323a13 commit fbf17c2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function getPlaylist() {
}

function getVideoData() {
$.ajax({
var xhr = $.ajax({
url: videoUrl,
type: 'GET',
success: function(res) {
Expand All @@ -285,7 +285,7 @@ function getVideoData() {
} catch(err) {
setTimeout(function() {
getVideoData();
return false;
xhr.abort();
}, 3000);
}
videoName = encodeURIComponent(videoName).replace(/%20/g, " ");
Expand All @@ -303,7 +303,7 @@ function getVideoData() {
} catch(err) {
setTimeout(function() {
getVideoData();
return false;
xhr.abort();
}, 3000);
}
},
Expand All @@ -315,15 +315,15 @@ function getVideoData() {
error: function(jqXHR, textStatus, errorThrown) {
setTimeout(function() {
getVideoData();
return false;
xhr.abort();
}, 3000);
}
});
}

function getAutoplayUrl() {
highlight(videoIteration, "radio");
$.ajax({
var xhr = $.ajax({
url: "https://www.youtube.com/watch?v=" + videos[videoIteration][2],
type: 'GET',
success: function(res) {
Expand All @@ -335,7 +335,7 @@ function getAutoplayUrl() {
} catch(err) {
setTimeout(function() {
getAutoplayUrl();
return false;
xhr.abort();
}, 3000);
}
},
Expand All @@ -346,14 +346,14 @@ function getAutoplayUrl() {
error: function(jqXHR, textStatus, errorThrown) {
setTimeout(function() {
getAutoplayUrl();
return false;
xhr.abort();
}, 3000);
}
});
}

function saveAutoplay() {
$.ajax({
var xhr = $.ajax({
url: "https://www.youtube.com/watch?v=" + autoplayMixUrl,
type: 'GET',
success: function(res) {
Expand All @@ -379,7 +379,7 @@ function saveAutoplay() {
} catch(err) {
setTimeout(function() {
saveAutoplay();
return false;
xhr.abort();
}, 3000);
}
},
Expand All @@ -392,7 +392,7 @@ function saveAutoplay() {
error: function(jqXHR, textStatus, errorThrown) {
setTimeout(function() {
saveAutoplay();
return false;
xhr.abort();
}, 3000);
}
});
Expand Down

0 comments on commit fbf17c2

Please sign in to comment.