From 1e0ab3331f6df362c8ebef957ce72d61f756062f Mon Sep 17 00:00:00 2001 From: Olga Brani Date: Mon, 23 Sep 2013 14:20:44 +0300 Subject: [PATCH] Youtube api fix Fixed synchronazation problem when loading iframe_api and trying to run onYouTubeIframeAPIReady function. Solution is to load iframe_api after YT.Player object is created. --- cloudcms/templates/cms/base.html | 1 - cloudcms/templates/content/intro_video.html | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cloudcms/templates/cms/base.html b/cloudcms/templates/cms/base.html index a947c70..669610d 100644 --- a/cloudcms/templates/cms/base.html +++ b/cloudcms/templates/cms/base.html @@ -28,7 +28,6 @@ {% endblock css %} {% block headjs %} - diff --git a/cloudcms/templates/content/intro_video.html b/cloudcms/templates/content/intro_video.html index a9ad810..2ab743e 100644 --- a/cloudcms/templates/content/intro_video.html +++ b/cloudcms/templates/content/intro_video.html @@ -6,7 +6,6 @@ \ No newline at end of file + + // This code loads the IFrame Player API code asynchronously. + var tag = document.createElement('script'); + tag.src = "https://www.youtube.com/iframe_api"; + var firstScriptTag = document.getElementsByTagName('script')[0]; + firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); + -- 1.7.10.4