From 5a053a74694c5e0a0f1dde5119a88379ebfcfe93 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Thu, 13 Dec 2018 10:05:09 -0800 Subject: [PATCH] Fix bug where useTextureView wasn't defaulting to true --- .../main/java/com/brentvatne/exoplayer/ExoPlayerView.java | 8 +++++--- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java index 35d56512..fc966005 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java @@ -38,7 +38,7 @@ public final class ExoPlayerView extends FrameLayout { private Context context; private ViewGroup.LayoutParams layoutParams; - private boolean useTextureView = false; + private boolean useTextureView = true; private boolean hideShutterView = false; public ExoPlayerView(Context context) { @@ -162,8 +162,10 @@ public final class ExoPlayerView extends FrameLayout { } public void setUseTextureView(boolean useTextureView) { - this.useTextureView = useTextureView; - updateSurfaceView(); + if (useTextureView != this.useTextureView) { + this.useTextureView = useTextureView; + updateSurfaceView(); + } } public void setHideShutterView(boolean hideShutterView) { diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index a18f7cff..1197a8d8 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -131,8 +131,6 @@ class ReactExoplayerView extends FrameLayout implements private boolean disableFocus; private float mProgressUpdateInterval = 250.0f; private boolean playInBackground = false; - private boolean useTextureView = false; - private boolean hideShutterView = false; private Map requestHeaders; // \ End props