Skip to content
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

ImaAdsLoader.getAdsLoader() is returning a null value in media3 #152

Open
ThirupathiiBalaji opened this issue Sep 27, 2024 · 11 comments
Open
Assignees
Labels

Comments

@ThirupathiiBalaji
Copy link

Problem statement:
The pre-roll or mid-roll advertisement plays when the app minimizes and then the onresume function calls again. To fix this, we must skip the specific ad to prevent repeat playback of the advertisement. The only way to resolve this situation is to use admangaer. However, ImaAdsLoader getAdsLoader() is returning a null value in media3. Kindly help us to fix this null value issue or provide us alternative solution to skip video ad

Note: This issue occurs when we migrating to media3 1.4.1 from exoplayer 2.11

@ThirupathiiBalaji ThirupathiiBalaji changed the title onAdsManagerLoaded callback is not invoked ImaAdsLoader getAdsLoader() is returning a null value in media3 Sep 27, 2024
@ThirupathiiBalaji ThirupathiiBalaji changed the title ImaAdsLoader getAdsLoader() is returning a null value in media3 ImaAdsLoader.getAdsLoader() is returning a null value in media3 Sep 27, 2024
@Kiro705
Copy link
Member

Kiro705 commented Sep 27, 2024

Hello @ThirupathiiBalaji ,

Can you confirm which IMA Android integration you are using? Standard implementation or ExoPlayer-IMA extension?

The AdsLoader should be obtained like this for a standard implementation:

adsLoader = sdkFactory.createAdsLoader(this, settings, adDisplayContainer);

Please let me know if you have additional questions.

Thank you,
Jackson
IMA SDK team

@Kiro705 Kiro705 self-assigned this Sep 27, 2024
@ThirupathiiBalaji
Copy link
Author

Hi @Kiro705 , I work on a project that uses the ExoPlayer-IMA extension. As per our management requriement, in order to provide a good user experience, we have to skip the current advertisement without any user interaction in the scenario above. however, ImaAdsLoader.getAdsLoader() always returns null value.
Actually the following function should not return ImaAdsLoader.getAdsLoader() null value. currently we are using exoplayer 2.11 in our project where the mentioned function didn't return null value.

@Kiro705
Copy link
Member

Kiro705 commented Oct 1, 2024

Hello @ThirupathiiBalaji ,

Thank you for clarifying that you are using the Exoplayer-IMA extension. You should obtain a reference to the AdsLoader when it is constructed. See this section from the ExoPlayer example for details.

That said, the IMA SDK only allows the use of AdsManager.skip() to be used if the ad is skippable, and IMA does not render its own skip button.

Please let me know if you have any questions.

Thank you,
Jackson
IMA SDK team

@ThirupathiiBalaji
Copy link
Author

Hi @Kiro705 ,
Problem statement:

 That ImaAdsLoader itself has a AdsLoader instace which can be retrived using ImaAdsLoader.getAdsLoader()
 
**((ImaAdsLoader)adsLoader).getAdsLoader()**.addAdsLoadedListener(adsManagerLoadedEvent -> {
    });
 getting null for the above hightlighted one(**).
 
 Actual problem : a pop-up will appear when the user hits the share button while they are watching a movie. Ads begin to play automatically (even we are not sending any ad request) after users close the pop-up window. Please give us a solution to this type of unwanted ad-triggering problem. 

@Kiro705
Copy link
Member

Kiro705 commented Oct 3, 2024

Hello @ThirupathiiBalaji ,

I cannot say if the behavior of getAdsLoader() returning null is a bug. Would you be able to share code changes to the IMA ExoPlayer extension sample app to reproduce the issue?

As for the actual problem, are you saying closing the pop-up always triggers an ad break? Or that the movie is playing while the share pop-up is present, and sometimes an ad break triggers during this time? I am not aware of any IMA functionality that would trigger an ad break based on pop-up behavior. If it is the other case, a solution could be to pause the movie while showing the pop-up.

@ThirupathiiBalaji
Copy link
Author

Hi @Kiro705
I'm not trying to say alert triggers the ad request, to be more clear about the issue, In our project while content is playing whenever the onResume is called we clear the previous player instance.

Then we will reconstruct the player with an updated new URL, why we are doing this because in-between onPause and onResume is called the previous URL might be expired so we are reconstructing the player with a new URL since we are reconstructing the player, the ad will be automatically triggered but it will affect our app's user experience so we used to skip that particular ad without any user interaction even though if the ad is non-skippable Since then we updated to Media3 we can't able to skip the ad as we did in exoplayer 2.11, this will affect our app user experience.

So kindly offer us a solution to fix this issue.

@Kiro705
Copy link
Member

Kiro705 commented Oct 7, 2024

Hello @ThirupathiiBalaji ,

A recent change introduced in IMA Android v3.32.0 only allows skipping the ad when it is defined as skippable, and IMA does not render a skip button. However, right now there is not a publicly available option to prevent IMA from rendering the skip button. To summarize, I think the use-case you are describing is not currently supported by the IMA SDK.

There are some updates planned that will offer more customizability for the ad UI, and control of when ads are skipped. However, I do not have any timelines for when that might be available.

I would recommend reaching out on the IMA technical forum to make a feature request to support your use-case.

Thank you,
Jackson
IMA SDK team

@ThirupathiiBalaji
Copy link
Author

Hi @Kiro705
Regarding the ad skip, we'll look into other options. I have one more query regarding the ad cue points. We are using vmap in our project. We used to retrieve the cue points list using adManager in exoplayer 2.11. Since we just upgraded to media3, could you please explain how we obtain the cue points list in media3?

@Kiro705
Copy link
Member

Kiro705 commented Oct 8, 2024

Hello @ThirupathiiBalaji ,

The ExoPlayer IMA extension does not surface a way to access the IMA CuePoints. Typically this can be done with AdsManager.getAdsCuePoints(). However, the extension does access this information, and renders UI elements for the ad breaks on the timeline. See screenshot.
Screenshot 2024-10-08 at 1 46 07 PM

If you need to access the ad cue-points, I would recommend not using the extension for your IMA integration.

Thank you,
Jackson
IMA SDK team

@ThirupathiiBalaji
Copy link
Author

Hi @Kiro705
Our project uses a customized progress bar. Is it possible to update cue points in a customized progress bar?
Please provide us solution.

@Kiro705
Copy link
Member

Kiro705 commented Oct 10, 2024

Hello @ThirupathiiBalaji ,

The ExoPlayer-IMA extension is built to provide an easy to set up integration with ExoPlayer and IMA SDK. Such that it does things like cuepoints on the progress bar itself.

For a more custom integration, like the one you are describing, I would recommend not using the extension. An integration similar to the AdvancedExample would highlight this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants