-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ima Ads not playing with exception ADS_LOADER.REQUEST_ADS #700
Comments
Thanks for your report. The obfuscated stack trace is difficult to interpret, but at first sight I don't think this is something related to a change in Media3 except that your migration caused a change in the version of the IMA SDK version that's used by the library.
How do you setup the media source for your stream when you are doing this? Are you using the IMA extension of ExoPlayer? You need to give us a bit more context on how you are doing that. I don't know how to achieve this with the IMA extension, so I'm unclear whether this is MEdia3 issue, an SDK issue or an issue with the custom integration you are doing.
Where did you migrate from, or more importantly what IMA SDK library version were you using before? If you know the IMA version you were using before you can verify whether this is an issue with the different SDK by setting the SDK version what you were using before. This would rule out problems with Media3 and confirm the problem is in the interaction with the SDK and your VAST file: |
Hey @chinmaym14. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Hi, we are also facing same issue when using vast xml in base64 encoeded format Adding Sample Code : Dependencies :
|
I think this is only happening with media/libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaUtil.java Lines 257 to 267 in c16accb
When the URL is From the IMA docs, this looks like a legit calling pattern, because
However,
This issue would be a lot more obvious if the IMA SDK failed-fast if media/libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/AdTagLoader.java Line 578 in c16accb
It seems we should be always setting the tag URL, even if the response is already available. I will update our code. |
We resolved this issue by downgrading the IMA sdk version to 3.29.0. They have some unexpected NPE in latest version(same exception we were facing) and recommended to downgrade the version. |
Despite the documentation, the IMA SDK seems to deliberately allow either ad tag URL or body to be set on the |
@icbaker thanks for the detailed info. I tried to pass both vmap xml response and adTag url. if we pass both adResponse and adTagurl and above exception
media/libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaUtil.java Lines 257 to 267 in c16accb
Is there any way ima uses the response passed and not url. |
@danish241194 Ah I think we're talking at different API levels. I was suggesting in #700 (comment) that ExoPlayer should populate the ad tag URI in the IMA Your code snippet just sets media3's However - given that, despite the documentation, IMA's validation explicitly allows only @chinmaym14 Can you try bumping to 3.31.0? That's the IMA version used in media3 1.2.0 alpha02 onwards (since b4d03a9). It's possible this is already fixed. |
Hey @icbaker, This is happening on media3 1.2.0 too, Is this under your radar to fix? |
|
@LloydBlv Based on my understanding above, there is no fix to be made for this issue in the media3 library - the NPE happens when interacting with the IMA library in a supported way (i.e. this is a bug inside the IMA SDK). That said, I'm not able to reproduce. I tried setting a new MediaItem.Builder()
.setUri(
"https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv")
.setAdsConfiguration(
new MediaItem.AdsConfiguration.Builder(
Util.getDataUriForString(
"text/xml",
"<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=/124319096/external/ad_rule_samples&sz=640x480&ciu_szs=300x250&cust_params=sar%3Da0f2&url=https://developers.google.com/interactive-media-ads/docs/sdks/html5/tags&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&vad_type=linear&vpos=preroll&pod=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&sarid=4576&sf=2&sfu=vid&vrid=4576&npa=false&kfa=0&tfcd=0]]></vmap:AdTagURI>"
+ " </vmap:AdSource> </vmap:AdBreak> </vmap:VMAP>"))
.build())
.build()); The pre-roll ad plays fine, then the content plays. How are you reproducing the issue? Please provide a complete code snippet I can adapt for the demo app. |
I too have obfuscated exception in ADS_LOADER.REQUEST_ADS when i try pass Data Uri intead of android.net.Uri.parse(https://link). With link it work how i expected, but now i need to pass raw xml VAST 3.0 data.
Little bit modified snippet of my code with player setup. But in general it equal to upper comment i think.
versions of dependencies
|
@icbaker you are correct, this is a bug in the IMA SDK itself not ExoPlayer's supplied IMA Extension. We are using data URL as well, ExoPlayer handles these just fine. ExoPlayer uses the I see different behavior with latest version of SDK (3.33.0), it still reports the error:
But then goes on to process the VAST document. The version in the head of main (3.31.0), freezes after throwing the Exception.
My guess is the IMA SDK code is trying to reference the AdTagUri, before it even bothers to look if there is a response. I can provide a pull request, I also posted this comment link to the IMA SDK Google group as well. Two "fixes" (workaround basically) possible:
For number 2: /** Returns an {@link AdsRequest} based on the specified ad tag {@link DataSpec}. */
public static AdsRequest getAdsRequestForAdTagDataSpec(
ImaFactory imaFactory, DataSpec adTagDataSpec) throws IOException {
AdsRequest request = imaFactory.createAdsRequest();
if (DataSchemeDataSource.SCHEME_DATA.equals(adTagDataSpec.uri.getScheme())) {
DataSchemeDataSource dataSchemeDataSource = new DataSchemeDataSource();
try {
dataSchemeDataSource.open(adTagDataSpec);
request.setAdTagUrl(adTagDataSpec.uri.toString());
request.setAdsResponse(Util.fromUtf8Bytes(DataSourceUtil.readToEnd(dataSchemeDataSource))); @icbaker the one line add, |
Issue: #700 PiperOrigin-RevId: 632135478
I've bumped the IMA dependency to 3.33.0 - which it sounds like resolves this issue. |
@icbaker it "sort of" fixes it, you still see the IMASDK report the error:
I did get a response from the group, so I'll follow up with them. setting the URL and the request both is the only solution that eliminates the error message. You can see the IMA SDK code, so you know best if the error is still ok |
Heh, fair point! I think I've found the only place that |
Version
Media3 1.1.1
More version details
We have recently migrated to media3 version 1.1.1 and found that IMA ads are not getting played. After looking at the logcat we got below exception in IMA sdk. Can you help us in finding out what can cause this exception.
We are creating ad tag xml ourselves and giving it to the sdk. Before migrating to media3 it was working fine. Below is the sample xml/tag that we are using.
Devices that reproduce the issue
LG G6(But should be reproducible in all devices)
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Try to play IMA ads at preroll
Expected result
Preroll ad should play
Actual result
Ad not playing eventually blocking content playback.
Media
Attaching ad tag that we are using
<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=/124319096/external/ad_rule_samples&sz=640x480&ciu_szs=300x250&cust_params=sar%3Da0f2&url=https://developers.google.com/interactive-media-ads/docs/sdks/html5/tags&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&vad_type=linear&vpos=preroll&pod=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&sarid=4576&sf=2&sfu=vid&vrid=4576&npa=false&kfa=0&tfcd=0]]></vmap:AdTagURI> </vmap:AdSource> </vmap:AdBreak> </vmap:VMAP>
Bug Report
adb bugreport
to [email protected] after filing this issue.The text was updated successfully, but these errors were encountered: