readded error-window and fixed player hiding on small when loading

This commit is contained in:
Kasper Rynning-Tønnesen
2018-07-01 21:25:01 +02:00
parent 8703adad14
commit ac8693e650
2 changed files with 61 additions and 61 deletions

View File

@@ -16,7 +16,6 @@ var list_html = document.querySelectorAll("#list-song-html").length > 0 ? docume
var unseen = false;
var searching = false;
var time_regex = /P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)W)?(([0-9]*\.?[0-9]*)D)?)?(T(([0-9]*\.?[0-9]*)H)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)S)?)?/;
var private_channel = false;
var end_programmatically = false;
var _kWay = "38384040373937396665";
var _kT = "";
@@ -152,10 +151,10 @@ window.zoff = {
enable_debug: enable_debug,
disable_debug: disable_debug
}
/*
if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.location.host != "client.localhost")) {
window.onerror = function(e, source, lineno, colno, error) {
if(e == "Script error.") return true;
if(e == "Script error." || e.toString().indexOf(" ReferenceError: pagespeed is not defined") > -1) return true;
Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date(), lineno: lineno, colno: colno, source:source});
Helper.logs.unshift({log: chan != "" && chan != undefined ? chan.toLowerCase() : "frontpage", date: new Date()});
document.querySelector(".contact-form-content").remove();
@@ -176,7 +175,7 @@ if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.locat
return true;
};
}
*/
window.addEventListener("DOMContentLoaded", function() {
if(!localStorage.getItem("VERSION") || parseInt(localStorage.getItem("VERSION")) != VERSION) {
localStorage.setItem("VERSION", VERSION);
@@ -566,13 +565,13 @@ addListener("click", "#closePlayer", function(event){
Player.player.destroy();
Helper.toggleClass("#player_bottom_overlay", "hide");
Helper.removeElement("#player");
Player.soundcloud_player.unbind("finish", Player.soundcloudFinish);
Player.soundcloud_player.unbind("pause", Player.soundcloudPause);
Player.soundcloud_player.unbind("play", Player.soundcloudPlay);
} catch(error){}
socket.removeEventListener("np");
socket.removeEventListener("id");
socket.removeEventListener(id);
Player.soundcloud_player.unbind("finish", Player.soundcloudFinish);
Player.soundcloud_player.unbind("pause", Player.soundcloudPause);
Player.soundcloud_player.unbind("play", Player.soundcloudPlay);
Player.soundcloud_player.kill();
previousSoundcloud = null;
Helper.removeElement("#soundcloud_container");

View File

@@ -140,7 +140,7 @@ var Player = {
Helper.css("#player", "visibility", "visible");
}
if(!embed && !client && window.location.pathname != "/") {
resizePlaylistPlaying(newState.data == YT.PlayerState.PLAYING);
resizePlaylistPlaying(newState.data == YT.PlayerState.PLAYING || newState.data == YT.PlayerState.BUFFERING);
}
if(embed && !autoplay) autoplay = true;
if(!window.MSStream) {
@@ -203,7 +203,7 @@ var Player = {
if(window.location.pathname != "/") Playercontrols.play_pause_show();
mobile_beginning = true;
if(!embed && !client && window.location.pathname != "/") {
resizePlaylistPlaying(newState.data == YT.PlayerState.PLAYING);
resizePlaylistPlaying(newState.data == YT.PlayerState.PLAYING || newState.data == YT.PlayerState.BUFFERING);
}
}
}
@@ -218,6 +218,7 @@ var Player = {
case YT.PlayerState.BUFFERING:
//was_stopped = false;
buffering = true;
resizePlaylistPlaying(newState.data == YT.PlayerState.PLAYING || newState.data == YT.PlayerState.BUFFERING);
break;
}
},