Created
July 9, 2013 21:37
-
-
Save jdeeburke/5961508 to your computer and use it in GitHub Desktop.
Pause YouTube embed in iFrame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* iFrame Must have '&/?enablejsapi=1' | |
* | |
* @param slideIndex | |
*/ | |
function pauseVideoOnSlide(slide) | |
{ | |
var iframe = $(slide).find("iframe")[0]; | |
if (iframe) { | |
var target = iframe.contentWindow; | |
target.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment