Trying a delayed playing for embedded videos

This commit is contained in:
Kasper Rynning-Tønnesen
2016-01-27 15:08:02 +01:00
parent b5cb5a2186
commit cec876afc5
4 changed files with 13 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -29,7 +29,8 @@ $(document).ready(function(){
console.log(document);
console.log(window.location.hash)
add = "https://zoff.no";
//add = "https://zoff.no";
add = "localhost";
socket = io.connect(''+add+':8880', connection_options);
socket.on("get_list", function(){

View File

@@ -172,11 +172,16 @@ var Youtube = {
$("#player").css("opacity", "1");
$("#controls").css("opacity", "1");
$(".playlist").css("opacity", "1");
window.ytplayer = Youtube.ytplayer;
Youtube.ytplayer.loadVideoById(video_id);
Youtube.ytplayer.playVideo();
Youtube.ytplayer.playVideo();
Youtube.durationSetter();
Youtube.ytplayer.seekTo(seekTo);
if(embed){
setTimeout(function(){
Youtube.ytplayer.playVideo();
Youtube.ytplayer.seekTo(seekTo);
console.log("delayed search");
}, 1000);
}else Youtube.ytplayer.seekTo(seekTo);
}
Youtube.readyLooks();
Playercontrols.initYoutubeControls(Youtube.ytplayer);