Skip to content

Commit

Permalink
Fix surface view switching
Browse files Browse the repository at this point in the history
  • Loading branch information
armands-malejevs committed May 25, 2023
1 parent a09b185 commit 768eef6
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
Expand Up @@ -149,12 +149,20 @@ private void setVideoView() {
private void updateSurfaceView() {
View view;
if (!useTextureView || useSecureView) {
view = new SurfaceView(context);
if (surfaceView instanceof TextureView) {
view = surfaceView;
} else {
view = new SurfaceView(context);
}
if (useSecureView) {
((SurfaceView)view).setSecure(true);
}
} else {
view = new TextureView(context);
if (surfaceView instanceof TextureView) {
view = surfaceView;
} else {
view = new TextureView(context);
}
}
view.setLayoutParams(layoutParams);

Expand Down

0 comments on commit 768eef6

Please sign in to comment.