mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Setting start and end to definite values on undefined
This commit is contained in:
@@ -76,16 +76,14 @@ function receiveMessage(event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.addEventListener("message", receiveMessage, false);
|
||||||
|
window.addEventListener("DOMContentLoaded", function() {
|
||||||
if(hash.length >= 3 && hash[2] == "autoplay"){
|
if(hash.length >= 3 && hash[2] == "autoplay"){
|
||||||
autoplay = true;
|
autoplay = true;
|
||||||
Helper.css("#player", "visibility", "hidden");
|
Helper.css("#player", "visibility", "hidden");
|
||||||
} else {
|
} else {
|
||||||
paused = true;
|
//paused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("message", receiveMessage, false);
|
|
||||||
window.addEventListener("DOMContentLoaded", function() {
|
|
||||||
|
|
||||||
if(hash.indexOf("videoonly") > -1) {
|
if(hash.indexOf("videoonly") > -1) {
|
||||||
Helper.addClass("#wrapper", "hide");
|
Helper.addClass("#wrapper", "hide");
|
||||||
Helper.addClass("#controls", "hide");
|
Helper.addClass("#controls", "hide");
|
||||||
@@ -122,13 +120,13 @@ window.addEventListener("DOMContentLoaded", function() {
|
|||||||
Player.getTitle(song_title, viewers);
|
Player.getTitle(song_title, viewers);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Player.loadPlayer();
|
||||||
setup_host_initialization();
|
setup_host_initialization();
|
||||||
setup_now_playing_listener();
|
setup_now_playing_listener();
|
||||||
setup_list_listener();
|
setup_list_listener();
|
||||||
|
|
||||||
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
|
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
|
||||||
socket.on("toast", toast);
|
socket.on("toast", toast);
|
||||||
Player.loadPlayer();
|
|
||||||
|
|
||||||
Playercontrols.initSlider();
|
Playercontrols.initSlider();
|
||||||
document.getElementById("playpause").addEventListener("click", Playercontrols.play_pause);
|
document.getElementById("playpause").addEventListener("click", Playercontrols.play_pause);
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ var Player = {
|
|||||||
Player.np.start = obj.np[0].start;
|
Player.np.start = obj.np[0].start;
|
||||||
Player.np.end = obj.np[0].end;
|
Player.np.end = obj.np[0].end;
|
||||||
Player.np.duration = obj.np[0].duration;
|
Player.np.duration = obj.np[0].duration;
|
||||||
|
if(Player.np.start == undefined) Player.np.start = 0;
|
||||||
|
if(Player.np.end == undefined) Player.np.end = Player.np.duration;
|
||||||
|
|
||||||
if(!obj.np[0].hasOwnProperty("start")) {
|
if(!obj.np[0].hasOwnProperty("start")) {
|
||||||
Player.np.start = 0;
|
Player.np.start = 0;
|
||||||
@@ -45,6 +47,8 @@ var Player = {
|
|||||||
Player.np.start = obj.np[0].start;
|
Player.np.start = obj.np[0].start;
|
||||||
Player.np.end = obj.np[0].end;
|
Player.np.end = obj.np[0].end;
|
||||||
Player.np.duration = obj.np[0].duration;
|
Player.np.duration = obj.np[0].duration;
|
||||||
|
if(Player.np.start == undefined) Player.np.start = 0;
|
||||||
|
if(Player.np.end == undefined) Player.np.end = Player.np.duration;
|
||||||
|
|
||||||
if(!obj.np[0].hasOwnProperty("start")) {
|
if(!obj.np[0].hasOwnProperty("start")) {
|
||||||
Player.np.start = 0;
|
Player.np.start = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user