メインコンテンツまでスキップ

Define Behavior for the Back Button

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'
}
*/
})