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

Spontaneous Ad completion using IMA SDK extension #7016

Closed
janhofman opened this issue Feb 26, 2020 · 4 comments
Closed

Spontaneous Ad completion using IMA SDK extension #7016

janhofman opened this issue Feb 26, 2020 · 4 comments

Comments

@janhofman
Copy link

Hello,

I'm trying to make an app with ExoPlayer and its Ima Extension and I've encountered an issue:

Introduction
ExoPlayer version: 2.11.1
I have MainActivity with fragment that has com.google.android.exoplayer2.ui.PlayerView , this activity is locked to portrait mode.
I have another activity called VideoFullscreenActivity which contains only PlayerView
If user requests fullscreen version of video I take the existing SimpleExoPlayer and assign it to the new view along with same AdsMediaSource , ImaAdsLoader, no new objects apart from the PlayerView itself are being created.

Issue
Let's say there are multiple pre-rolls and first Ad is playing. When I go to fullscreen, everything works as intended. Ad continues to play as you would expect. However when I go to fullscreen and last pre-roll is playing that ad gets "skipped" and I get callback that it was AdEvent.AdEventType.COMPLETED

Is that intended behavior?

@jakub-tausk
Copy link

Hello Andrew,

please give advice.

Thank you

@andrewlewis
Copy link
Collaborator

andrewlewis commented Mar 4, 2020

It sounds like you are switching between PlayerViews when transitioning between window/full-screen. The IMA SDK mostly runs its code in a WebView that gets inserted on top of the player output view (assuming you are using PlayerView as the AdViewProvider when creating the AdsMediaSource). I wonder whether the change of player view is causing the WebView running the IMA SDK to get destroyed, or the IMA SDK is becoming unhappy in some other way due to a visibility change.

Could you try keeping the ImaAdsLoader but instantiating a new player and AdsMediaSource during the transition to see if that fixes it?

To make this as seamless as possible you could alternatively try making your own FrameLayout and passing that as the ad view group in a custom AdsLoader.AdViewProvider. The idea is to make sure IMA's web view doesn't get destroyed across the transition. This might require reorganizing the app to avoid the activity transition (so you can keep the same frame layout), so might not be feasible.

The behavior with an ad getting skipped across what is effectively backgrounding/resuming sounds like #4140, which will be fixed when the new ads managers have been released and are used by the extension, tracked by #6429.

@google-oss-bot
Copy link
Collaborator

Hey @janhofman. 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!

@google-oss-bot
Copy link
Collaborator

Since there haven't been any recent updates here, I am going to close this issue.

@janhofman if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@google google locked and limited conversation to collaborators Jun 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants