Created
September 19, 2014 20:55
-
-
Save dmlap/f8305a42549b379d8df7 to your computer and use it in GitHub Desktop.
Initializing a plugin by hand. If some of the information required for a plugin's configuration isn't available until the player has loaded in a page, you can delay initializing it until you're ready.
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
<!doctype html> | |
<video | |
data-account="1234" | |
data-player="5678" | |
data-embed="default" | |
class="video-js" controls></video> | |
<script src="//players.brightcove.net/1234/5678_default/index.min.js"></script> | |
<script> | |
var player = videojs(document.querySelector('video')); | |
// initialize the plugin by-hand | |
player.complicatedPlugin({ | |
userAgent: window.navigator.userAgent // pass along data that is only available at runtime | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment