This commit is contained in:
Kasper Rynning-Tønnesen
2018-07-10 16:21:16 +02:00
parent 609f07449e
commit d7522cad73
4 changed files with 406 additions and 396 deletions

View File

@@ -30,7 +30,7 @@ function getColor(id) {
id: id
}),
success: function(c) {
c = JSON.parse(c);
//c = JSON.parse(c);
if(typeof(c) == "object") {
Player.setBGimage({color:c, only:true});
}
@@ -201,7 +201,7 @@ function get_list_ajax() {
if(response.results.length > 0) {
if(response.status == 403) {
start_auth();
}
} else if(response.status == 404) return;
if(client) {
Helper.removeElement("#channel-load");
}
@@ -209,14 +209,14 @@ function get_list_ajax() {
}
},
error: function(response) {
response = JSON.parse(response);
//response = JSON.parse(response);
if(response.status == 403) {
start_auth();
} else if(response.status == 429) {
setTimeout(function() {
get_list_ajax();
}, xmlhttp.getResponseHeader("Retry-After") * 1000)
}
} else if(response.status == 404) return;
if(client) {
Helper.removeElement("#channel-load");
}
@@ -289,7 +289,7 @@ function get_np_ajax() {
Player.getTitle(response.results[0].title, 1);
},
error: function(response, xmlhttp) {
response = JSON.parse(response);
//response = JSON.parse(response);
if(response.status == 403) {
start_auth();
} else if(response.status == 429) {
@@ -320,7 +320,7 @@ function del_ajax(id) {
get_list_ajax();
},
error: function(response, xmlhttp) {
response = JSON.parse(response);
//response = JSON.parse(response);
if(response.status == 403) {
toast("listhaspass");
} else if(response.status == 429) {
@@ -357,7 +357,7 @@ function add_ajax(id, title, duration, playlist, num, full_num, start, end, sour
get_list_ajax();
},
error: function(response, xmlhttp) {
response = JSON.parse(response);
//response = JSON.parse(response);
if(response.status == 403) {
toast("listhaspass");
} else if(response.status == 409) {
@@ -390,7 +390,7 @@ function vote_ajax(id) {
get_list_ajax();
},
error: function(response, xmlhttp) {
response = JSON.parse(response);
//response = JSON.parse(response);
if(response.status == 403) {
toast("listhaspass");
} else if(response.status == 429) {
@@ -1070,7 +1070,7 @@ function before_toast(){
} catch(e) {
}
//}*/
//M.Toast.dismissAll();
M.Toast.dismissAll();
//Materialize.Toast.removeAll();
}

View File

@@ -1308,10 +1308,14 @@ window.addEventListener("resize", function(){
} else if(window.innerWidth < 601) {
if(!client && !embed) {
var scPlaying = false;
var ytPlaying = false;
try {
ytPlaying = Player.player.getPlayerState() == YT.PlayerState.PLAYING || Player.player.getPlayerState() == YT.PlayerState.BUFFERING;
} catch(e) {}
try {
scPlaying = Player.soundcloud_player.isPlaying();
} catch(e){}
resizePlaylistPlaying(Player.player.getPlayerState() == YT.PlayerState.PLAYING || scPlaying || Player.player.getPlayerState() == YT.PlayerState.BUFFERING);
resizePlaylistPlaying(ytPlaying || scPlaying);
return;
}
}

View File

@@ -481,7 +481,8 @@ var Player = {
},
playNext: function(){
var next_song = full_playlist[0];
if(full_playlist.length == 0) return;
var next_song = full_playlist[0];
video_id = next_song.id;
time = (new Date()).getTime();
@@ -517,7 +518,7 @@ var Player = {
var length = full_playlist.length - 2;
if(length < 0) {
length = 0;
}
} else if(length == 0) return;
var next_song = full_playlist[length];
video_id = next_song.id;
time = (new Date()).getTime();