Created
May 10, 2012 13:50
-
-
Save brandonaaskov/2653118 to your computer and use it in GitHub Desktop.
Brightcove JS Plugin Stub
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
/* | |
Just a basic sample of a JS plugin that will display the video's name in the console once it initializes. | |
*/ | |
(function(){ | |
var _experience | |
, _videoPlayer | |
, currentVideo; | |
player = brightcove.api.getExperience(); | |
_experience = player.getModule(brightcove.api.modules.APIModules.EXPERIENCE); | |
_videoPlayer = player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER); | |
if(_experience.getReady()) | |
{ | |
initialize(); | |
} | |
else | |
{ | |
_experience.addEventListener(brightcove.api.events.ExperienceEvent.TEMPLATE_READY, initialize); | |
} | |
_experience.getExperienceID(function(pExperienceID){ | |
console.log(pExperienceID); | |
}); | |
function initialize() | |
{ | |
_videoPlayer.getCurrentVideo(function(pVideoDTO){ | |
console.log(pVideoDTO.displayName); | |
}); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment