This guide will walk you through the steps to track the playback of a BlendVision One iframe player.
Before We Start
Before proceeding, ensure that you have prepared your BlendVision One streaming iframe. The following guides will assist you in preparing your iframe:
- Quickstart: Playback a Public BlendVision One Stream
- Quickstart: Playback a Private BlendVision One Stream
Step 1: Add Event Listener
Attach the following script to your HTML:
<script>
window.addEventListener('message', messageEvent => {
const parseData = JSON.parse(messageEvent.data)
if (parseData.event !== 'infoDelivery') {
return
}
console.log(parseData)
})
</script>
Step 2: Retrieve Playback Logs
Listen for the ‘infoDelivery’ event, which is sent every 0.5 seconds, to retrieve the following playback logs:
Playback Progress
The following example shows the playback progress of a user who has watched up to the position of 171 seconds 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,
}
}
Playback Event
This allows you to retrieve the playback event logs of your users. Refer to the Playback Event documentation for available events.
{
event: 'infoDelivery',
info: {
currentTimeLastUpdated:,// Unix time when the event sent
playlogData: {
playback_module_version: "",
system_time:,// Unix time when the event sent
},
playlogEventName: "",
}
}
What’s More
To control the playback, refer to the documentation provided here.