Commit 253ea786 by andrewlewis Committed by Andrew Lewis

Register the overlay view as non-obstructing

Currently IMA determines that the overlay is obstructing, even
if it's empty. Register it as friendly, which means we're
assuming that anything the apps puts in it is necessary for
playback.

PiperOrigin-RevId: 234963065
parent 1450b371
...@@ -70,6 +70,7 @@ import com.google.android.exoplayer2.video.VideoListener; ...@@ -70,6 +70,7 @@ import com.google.android.exoplayer2.video.VideoListener;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -1116,7 +1117,14 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider ...@@ -1116,7 +1117,14 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
@Override @Override
public View[] getAdOverlayViews() { public View[] getAdOverlayViews() {
return controller != null ? new View[] {controller} : new View[0]; ArrayList<View> overlayViews = new ArrayList<>();
if (overlayFrameLayout != null) {
overlayViews.add(overlayFrameLayout);
}
if (controller != null) {
overlayViews.add(controller);
}
return overlayViews.toArray(new View[0]);
} }
// Internal methods. // Internal methods.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment