Calls order in Android IMA SDK

78 views
Skip to first unread message

Gabriel

unread,
May 14, 2020, 2:18:13 PM5/14/20
to Interactive Media Ads SDK
Hello, 

In the Android documentation, it's written that the CuePoints for the current VOD stream are available after CUEPOINTS_CHANGED is broadcast.
https://developers.google.com/interactive-media-ads/docs/sdks/android/v3/api/reference/com/google/ads/interactivemedia/v3/api/StreamManager.html#public-abstract-listcuepoint-getcuepoints

In our app, we have some content with or without ads.
When it's a content with ads all good we receive the event CUEPOINTS_CHANGED.
When it's a content without ads, we don't receive the event CUEPOINTS_CHANGED. Which make sense as there are no ads.

My question is when can we know if there is ads or no ads?

We cannot wait for the event CUEPOINTS_CHANGED as this one won't be triggered when there are no ads.
It looks like the callback VideoStreamPlayer#loadUrl is called always after the event CUEPOINTS_CHANGED when it's triggered (if there are some ads) so my guess is that I could check if there is some ads at this point by calling StreamManager#getCuePoints and checking if the list is empty or not. Though, it's not written anywhere that is guaranteed to have the CuePoints at this moment.
https://developers.google.com/interactive-media-ads/docs/sdks/android/v3/api/reference/com/google/ads/interactivemedia/v3/api/player/VideoStreamPlayer.html?hl=pl#public-abstract-void-loadurl-string-url,-listhashmapstring,-string-subtitles
For now, I plan to check the CuePoints when ExoPlayer rendered the first frame. At this point, I guess it should be safe to check the CuePoints?

What is your recommendation/advice for this case?

IMA SDK

unread,
May 14, 2020, 7:08:29 PM5/14/20
to gabriel...@gmail.com, ima...@googlegroups.com
Hi Gabriel,

Thank you for reaching out to us. As per the getCuePoints() documentation, the CuePoints for VOD stream is available after the CUEPOINTS_CHANGED event is fired. The CUEPOINTS_CHANGED is fired when the stream info becomes available and fully loaded by the SDK. There's no guarantee that the CuePoints will be available before the CUEPOINTS_CHANGED event, we would recommend you to check the stream's cue points after the event is fired.

Regards,
Arnaud Casame
IMA SDK Team


ref:_00D1U1174p._5004Q1zpPX2:ref

Gabriel

unread,
May 14, 2020, 7:21:42 PM5/14/20
to Interactive Media Ads SDK
Hi Arnaud,

Thanks for the reply.
I can have some streams without any ads, in this case CUEPOINTS_CHANGED won't be fired. How can I know if there is no ads? I was thinking to check getCuePoints() as in this case the list will be empty, though I don't know when I could/should check as the event CUEPOINTS_CHANGED won't be fired.
Is there any other way to know if we have some ads or not?

Gabriel

IMA SDK

unread,
May 14, 2020, 11:28:02 PM5/14/20
to gabriel...@gmail.com, ima...@googlegroups.com

Hi Gabriel,

Thank you for your response. You can check for the AD_BREAK_FETCH_ERROR ad event as this indicates an event that ad break will not play any ads.

Let me know if this works for you.

Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5004Q1zpPX2:ref

Gabriel

unread,
May 15, 2020, 4:13:02 AM5/15/20
to Interactive Media Ads SDK
Hi Sherwin,

When the stream doesn't contain any ads, I don't receive any event from AdEventListener#onAdEvent. Though, I will be called back in VideoStreamPlayer#loadUrl.
Any other suggestion?

Gabriel

IMA SDK

unread,
May 15, 2020, 5:42:32 AM5/15/20
to gabriel...@gmail.com, ima...@googlegroups.com

Hi Gabriel,

 

Thank you for your response. Could you please share with us the Asset Key or CMS ID/Video ID that you're using so we could check on our end as well? You can share this via "Reply privately to author" option.

Reply all
Reply to author
Forward
0 new messages