dailymotion / dailymotion-sdk-js

Dailymotion JavaScript client API
https://developers.dailymotion.com/api/platform-api/
MIT License
34 stars 33 forks source link

expose adData during ad_start event #94

Closed Cycymomo closed 3 years ago

Cycymomo commented 3 years ago

During ad_start event, the adData Object is available in the player instance

const player = DM.player('player', { video: 'x730nnd' })


- attach the listener to it

player.addEventListener('ad_start', () => { console.log(player.adData) })


=> as soon as the ad is displayed, you'll have the `adData` informations in the `player` instance