Trying with more timeout

This commit is contained in:
Kasper Rynning-Tønnesen
2018-05-07 14:49:20 +02:00
parent f45dbe3b98
commit 38def13577

View File

@@ -130,15 +130,8 @@ window.addEventListener("load", function() {
setup_now_playing_listener();
setup_list_listener();
if(autoplay) {
setTimeout(function() {
if(videoSource == "youtube") {
Player.player.playVideo();
} else {
Player.soundcloud_player.play();
}
}, 1000);
startWaitTimerPlay();
}
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
@@ -157,6 +150,16 @@ window.addEventListener("load", function() {
}
});
function startWaitTimerPlay() {
setTimeout(function() {
if(videoSource == "youtube") {
Player.player.playVideo();
} else if(videoSource == "soundcloud"){
Player.soundcloud_player.play();
}
}, 2000);
}
function setup_host_listener(id) {
socket.on(id, Hostcontroller.host_on_action);
}