Last active
August 29, 2015 14:03
-
-
Save mister-ben/4144477272250bea6f92 to your computer and use it in GitHub Desktop.
Plugin for Brightcove HTML player. Exits fullscreen on stop events.
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
/* | |
Exits from iOS fullscreen on stop / pause | |
*/ | |
(function() { | |
function onPlayerReady() { | |
videoPlayer.addEventListener(brightcove.api.events.MediaEvent.STOP, function(event){ | |
$("video")[0].webkitExitFullScreen(); | |
}) | |
} | |
var | |
_player = brightcove.api.getExperience(), | |
videoPlayer = _player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER), | |
experience = _player.getModule(brightcove.api.modules.APIModules.EXPERIENCE); | |
if (experience.getReady()) { | |
onPlayerReady(); | |
} else { | |
experience.addEventListener(brightcove.player.events.ExperienceEvent.TEMPLATE_READY, onPlayerReady); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment