I have the following code to show a Brightcove player when the user clicks on an image with a play button:
$(document).ready(function() {
$('#performanceVideo').hide();
$('#banner_text_wrap').click(function(e) {
e.preventDefault();
$('banner-image').hide().fadeOut(slow);
$('#performanceVideo').show().fadeIn(slow).css({'float':'left','margin-top':'-251px'});
});
});
I want to fade the image back in when the video ends. How do I hook into the video end event using jQuery? Reading the documentation I think I would need to include addEventListener in the code but I'm a JavaScript novice so any help is appreciated.
Add these two parameters to your player snippet:
Then add a javascript function that matches the value you gave for the templateLoadHandler in the snippet params to setup an event listener for the videoPlayers end event.
Then hide the player when the complete event fires: