Reputation: 534
What events are issued when a pre-roll ad plays in stream before a video embedded with the YouTube iframe API?
I want to make sure to show the player when the ad plays, but it appears that the ad plays outside of the normal queued, buffering, or playing events.
Upvotes: 1
Views: 1225
Reputation: 7771
Based on this SO question, when the video with pre roll ad play, the onStateChange
of the video is PAUSED or (2).
The onStateChange
event fires whenever the player's state changes. The data property of the event object that the API passes to your event listener function will specify an integer that corresponds to the new player state. Possible values are:
For more information, just check the this documentation and the SO link above.
Upvotes: 0