Showing results for 
Search instead for 
Do you mean 
If you don't find an answer, please click here to post your question.
Occasional Visitor
Posts: 1
Registered: ‎08-07-2017

Video Ending Event

I am trying to redirect a page once the video has ended, meaning the user has viewed the video to it’s completion but i cannot find a Javascript event that handles that. Do you guys know if there is one or how I would achieve that?

Posts: 19
Registered: ‎05-10-2016

Re: Video Ending Event

Hi EBM25,


You can achieve this by using our Message Bus API. Using this, you can listen to either "VideoPlayed" or perhaps "endScreenShown" event.


Here is an example using "endScreenShown" event:



<!DOCTYPE html>
<link rel="stylesheet" href=""/>
<script language="javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>

<div id='container' style='width:640px;height:480px'></div>
<script> /* * Always add event listeners and error handling * within the onCreate() function. * Include this function in the embedded parameters * in the Player.create() call. */ function onCreate(player) {
//*** Subscribe to endScreenShow event player.mb.subscribe('endScreenShown', 'myPage', function(eventName) { alert("Finished playing");""); }); } OO.ready(function() { window.pp = OO.Player.create('container', '<EMBED_CODE>', { "playerBrandingId":"<PLAYER_ID>", "pcode": "<PCODE>", skin: { config: "", }, // Include the onCreate() function you defined above in these embedded parameters. onCreate : window.onCreate }); }); </script>


For details on the message bus, you can refer to  our documentation - Do also refer to "" for an example on how to get the list of events.


I hope this helps.