This commit is contained in:
Kasper Rynning-Tønnesen
2016-01-23 14:16:35 +01:00
parent dceb4a023f
commit be2ed476b5
3 changed files with 31 additions and 6 deletions

View File

@@ -237,12 +237,14 @@ var Youtube = {
},
loadPlayer: function() {
console.log(ytplayer);
console.log("load the player");
if($(document.getElementsByTagName('script')[0]).attr("src") == "https://www.youtube.com/iframe_api"){
Youtube.onYouTubeIframeAPIReady();
}else{
tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
}
}
}