Skip to content

Commit

Permalink
ETPAND-9977: RNV-21004 Errors Blocking Some AVOD Users from Watching …
Browse files Browse the repository at this point in the history
…Videos (#69)

Prevent unnecessary surface view creation/switching.
  • Loading branch information
armands-malejevs committed May 31, 2023
1 parent b816051 commit 5846a5e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions android/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,20 @@ private void setVideoView() {
private void updateSurfaceView() {
View view;
if (!useTextureView || useSecureView) {
view = new SurfaceView(context);
if (surfaceView != null && surfaceView instanceof SurfaceView) {
view = surfaceView;
} else {
view = new SurfaceView(context);
}
if (useSecureView) {
((SurfaceView)view).setSecure(true);
}
} else {
view = new TextureView(context);
if (surfaceView != null && surfaceView instanceof TextureView) {
view = surfaceView;
} else {
view = new TextureView(context);
}
}
view.setLayoutParams(layoutParams);

Expand Down

0 comments on commit 5846a5e

Please sign in to comment.