ALL_ADS_COMPLETED may or may not be notified depending on the seek
Hello.
We confirmed that there is a difference in the behavior of the ALL_ADS_COMPLETED event.
・Seek directly to the end of content(※1) ⇒the ALL_ADS_COMPLETED event will be notified.
・Seek before the end of the content and play until the end of the content(※2) ⇒the ALL_ADS_COMPLETED event will not be notified.
We don't know why there is a difference in these 2 situations. However, when we asked IMA SDK team, they told us that this is the default behavior of the ExoPlayer-IMA extension. And they recommended that we contact the AndroidX Media issues queue why the behavior changes whether the seek is performed or not.
Could you tell us why the behavior is diffrerent?
Steps: ①Play the pre-roll ②Seek to the playback position(11:00) of Mid3 (skipping the playback of Mid1 and Mid2) ③Play the last ad, Mid3
In the case where all_ads_completed is notified:(※1) ④Seek to the end of playback ⑤all_ads_completed is notified
In the case where all_ads_completed is not notified:(※2) ④Wait until the end of playback ⑤all_ads_completed is not notified
Contents : Movie : https://storage.googleapis.com/wvmedia/clear/h264/tears/tears_h264_high_1080p_20000.mp4 Ads :
<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">
<vmap:AdBreak timeOffset="start" breakType="linear" breakId="preroll">
<vmap:AdSource id="preroll-ad-1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[ https://pubads.g.doubleclick.net/gampad/ads?slotname=/21775744923/external/vmap_ad_samples&sz=640x480&ciu_szs=300x250&cust_params=sample_ar%3Dpremidpost&url=&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&useragent=Mozilla/5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/111.0.0.0+Safari/537.36,gzip(gfe)&vad_type=linear&vpos=preroll&pod=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=1264775&cmsid=496&video_doc_id=short_onecue&kfa=0&tfcd=0 ]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
<vmap:AdBreak timeOffset="00:03:20.000" breakType="linear" breakId="midroll-1">
<vmap:AdSource id="midroll-1-ad-1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[ https://pubads.g.doubleclick.net/gampad/ads?slotname=/21775744923/external/vmap_ad_samples&sz=640x480&ciu_szs=300x250&cust_params=sample_ar%3Dpremidpost&url=&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&cue=15000&useragent=Mozilla/5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/111.0.0.0+Safari/537.36,gzip(gfe)&vad_type=linear&vpos=midroll&pod=2&mridx=1&rmridx=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=1264775&cmsid=496&video_doc_id=short_onecue&kfa=0&tfcd=0 ]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
<vmap:AdBreak timeOffset="00:6:40.000" breakType="linear" breakId="midroll-2">
<vmap:AdSource id="midroll-2-ad-1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[ https://pubads.g.doubleclick.net/gampad/ads?slotname=/21775744923/external/vmap_ad_samples&sz=640x480&ciu_szs=300x250&cust_params=sample_ar%3Dpremidpost&url=&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&cue=15000&useragent=Mozilla/5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/111.0.0.0+Safari/537.36,gzip(gfe)&vad_type=linear&vpos=midroll&pod=2&mridx=1&rmridx=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=1264775&cmsid=496&video_doc_id=short_onecue&kfa=0&tfcd=0 ]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
<vmap:AdBreak timeOffset="00:10:00.000" breakType="linear" breakId="midroll-3">
<vmap:AdSource id="midroll-3-ad-1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[ https://pubads.g.doubleclick.net/gampad/ads?slotname=/21775744923/external/vmap_ad_samples&sz=640x480&ciu_szs=300x250&cust_params=sample_ar%3Dpremidpost&url=&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&cue=15000&useragent=Mozilla/5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/111.0.0.0+Safari/537.36,gzip(gfe)&vad_type=linear&vpos=midroll&pod=2&mridx=1&rmridx=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=1264775&cmsid=496&video_doc_id=short_onecue&kfa=0&tfcd=0 ]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
</vmap:VMAP>
Specs: ExoPlayer version used:2.18.1 Device:Pixel5 Android version:13, 14 App:https://github.com/googleads/googleads-ima-android/releases/tag/3.34.0-0
Thanks for your question!
In general it is the IMA SDK that emits these events. The SDK does this as a result of player events that it either polls from the player or that the player sends to the SDK. So we'd need to figure out why the SDK wrongly thinks it needs to emit this event (or why not).
I'm not sure whether I understand your report correctly.
①Play the pre-roll ②Seek to the playback position(11:00) of Mid3 (skipping the playback of Mid1 and Mid2) ③Play the last ad, Mid3
These are the repro steps where it is stated skipping the playback of Mid1 and Mid2.
Do I understand correctly, that with this scenario when you seek to the end, the SDK emits an ALL_ADS_COMPLETED event that isn't expected because actually not all ads have been played?
Or do you report the contrary, that in one case an ALL_ADS_COMPLETED event was expected but not emited?
In any case I need an ad tag to test this, because all the test stream in the demo app have a post-roll. The behaviour may be different with a post-roll. If you have an ad tag that you can give me, you could make me look into this quicker. Else I need to see whether I get such a sample ad tag with only mid rolls from the IMA team.
@marcbaechinger Thanks for your reply.
Do I understand correctly, that with this scenario when you seek to the end, the SDK emits an ALL_ADS_COMPLETED event that isn't expected because actually not all ads have been played?
⇒We don't think this is a problem. We have accepted this is the specification.
Or do you report the contrary, that in one case an ALL_ADS_COMPLETED event was expected but not emited?
⇒Yes, we think this is a problem. We couldn't understand why the behavior changes whether the seek is performed or not. This is the biggest problem.
In any case I need an ad tag to test this, because all the test stream in the demo app have a post-roll.
⇒We provide an ad tag(file name:vmap_sample.xml). This is the same as the "Ads:" we mentioned in the recent issue. Could you store the file on your server and confirm it?
Best regards.
Thanks for your feedback and the vamp sample. We do not have an ad server environment I'm afraid. I can't play this vmap you sent easily. I'd need a IMA ad tag that is resolved by the SDK and gives us the events just like this works with the IMA extension in ExoPlayer. I try to get such an ad tag with only mid rolls from the ads team, so I can repro the behaviour with that.
We don't think this is a problem. We have accepted this is the specification.
Hmmm, I think this is a problem actually. From the JavaDoc of the Ads SDK it says:
ALL_ADS_COMPLETED
Fires when the ads manager is done playing all the valid ads in the ads response,
or when the response doesn't return any valid ads.
I think it's not correct to fire this event when not all ads are played. According to the JavaDoc, it should be fired when no ads are remaining either by having played all or not receiving any ads (empty). The JavaDoc seems pretty clear about this and it's unclear why the SDK fires this event in the examples I have looked at in the demo app. We need to investigate whether the the ImaAdsLoader sends events to the IMA SDK that are not correct and if we find this is not the case we need to figure out why the SDK thinks it should fire this event.
I then agree with you that, based on this knowledge, we should make sure that the behavior is consistent in the 'seek-into-the-ad' and 'play-into-the-ad' cases so that apps can consume these events without confusion. As alluded, I think that consistency should be on not firing this event when not all ads are played.
I try to get such a stream asap. Thanks for your clarification!
Hi @marcbaechinger
I try to get such an ad tag with only mid rolls from the ads team, so I can repro the behaviour with that.
How's the progress? Could you get the ad tag from the ads team? If it is difficult for you to get it, we are considering building the public server and providing an ad tag URL. We are looking forward to you being able to reproduce the behavior.
Best regards.
Hi @marcbaechinger
It's been a while since we asked, how's the progress?
Best regards.
Hi @marcbaechinger
It's been a while since your last reply. Has your investigation progressed? If you find out anything, I'd love to hear from you.
Best regards.
Thanks for your patience. We can't really help with this I'm afraid. Ad events are emitted by the SDK and delegated to the user.
I have filed an internal bug against the IMA SDK. I will update this bug when I hear back internally or when the behavior has been corrected.
Internal bug-ref: b/409740674
Hi @marcbaechinger
Thank you for your reply. I understand. I look forward to hearing from you.
Best regards.
Hi @marcbaechinger
It's been a while since your last reply, how's the progress? We would appreciate it if you could let us know if you have any new information.
Best regards.
Hi @marcbaechinger
Is there any new information on this matter? We would appreciate it if you could let us know if you have that.
Best regards.
Hi @marcbaechinger
What is the status of the investigation? If you find out anything, we would be very grateful if you could let us know.
Best regards.
Could you try to replicate using VMAP tag
https://vastsynthesizer.appspot.com/gdambrauskas-vmap-exo
It has preroll and 3 midrolls, at 20s, 40s, 60s . If I seek past mid 1 and mid 2, mid 2 plays (skipping over a midroll should play skipped ad, in this case mid 2). Then mid 3 plays and I let the content complete on its own. I used a 2 minute content https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv
I saw all ads completed in all my tests.
Hi @gvdexile9
We think the difference between the following two movements is the problem.
1.Seek directly to the end of content ⇒the ALL_ADS_COMPLETED event will be notified. 2.Seek before the end of the content and play until the end of the content ⇒the ALL_ADS_COMPLETED event will not be notified. ※When seek to a time after Mid3. For example, in the ad you provided, seek to 110 seconds.
When using the ad you suggested, ALL_ADS_COMPLETED notification sent in either case?
Best regards.
Seeked to 110s as you suggested, 3rd midroll plays (as it should, seeked over ad break should play). I let it complete and let the content finish without any action on my part. I got all ads completed. Did you try with my canned ad response?
Ty!