Created
March 27, 2014 14:33
-
-
Save dmlap/9808865 to your computer and use it in GitHub Desktop.
Trigger `play()` based on a message from a parent page.
This file contains 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
videojs.plugin('iframePlay', function(options) { | |
var player = this; | |
options = options || {}; | |
window.addEventListener('message', function(event) { | |
if (!options.origin || options.origin === event.origin && event.data === 'play') { | |
player.play(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment