Skip to main content

Callback Integration

Playback Logs

To retrieve logs of the player's video playback behavior, listen for the infoDelivery event, which is sent every 0.5 seconds:

<script>
  window.addEventListener('message', messageEvent => {
    const parseData = JSON.parse(messageEvent.data)
    if (parseData.event !== 'infoDelivery') {
      return
    }
    console.log(parseData)
  })
</script>

Playback Event

You will retrieve playback events after triggered:

{
event: 'infoDelivery',
info: { currentTimeLastUpdated:,// Unix time when the event sent
playlogData: {
playback_module_version: "",
system_time:,// Unix time when the event sent
},
playlogEventName: "",
}
}

Playback Progress

You will retrieve the progress of the VOD playback by your users. The following example shows playback progress for a user who has watched up to the 171-second position of a VOD at a playback speed of 1.25x:

{
event: 'infoDelivery',
info: { currentTime: 171,
currentTimeLastUpdated:, // Unix time when the event sent
playbackRate: 1.25,
}
}

Back Button Clicking Logs

When customizing the layout of the iframe player as a Standalone design, a Back button will be provided in the player's UI. This Back button empowers you to manage the behavior that is triggered upon clicking it. For instance, you can navigate back, redirect to a specific page of your choice, or implement any subsequent behaviors on your end when the user clicks the button.

To manage the behavior associated with the Back button, listen for the actionDelivery message to retrieve the log, which will inform you of the user's clicking event on it:

window.addEventListener('message', messageEvent => {
const messageData = JSON.parse(messageEvent.data)
if (messageData.event === 'actionDelivery' && messageData.name === 'back') {
// actions for back button
}

console.log(messageData)
/*
{
event: 'actionDelivery',
name: 'back'
}
*/
})