Closed MikeSperone closed 4 years ago
hi Mike,
we can check it also from player.ima.controller.sdkImpl.adsActive === true
please cmiiw
Hello @MikeSperone ,
I would recommend using the IMA ad events to track whether or not an ad is playing.
You could use either CONTENT_PAUSE_REQUESTED or STARTED to set a boolean to true
, then use CONTENT_RESUME_REQUESTED or COMPLETED to set that boolean back to false
.
The difference between the two types of events being focused on an entire ad break or individual ads.
Let me know if you have any more questions, to set up ad events with the VideoJS-IMA plugin you can look to the advanced example.
I'm handling an edge case in our videojs player where I need to see if we're currently playing an ad.
I got this working by doing check this successfully with this:
My co-worker brought up the question of whether we should be interacting with these methods and events from
videojs-contrib-ads
(player.ads
) directly, or shouldn't there be a way to do this viavideojs-ima
?It's not really documented either way, and I didn't see anything in the src... so I was wondering if there is a
player.ima.<something>
to check for this case, or if it is recommended to directly use the methods fromvideojs-contrib-ads
Thanks!