From 1a48f190f020ed025a44f5b09ea9e044600be723 Mon Sep 17 00:00:00 2001 From: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> Date: Sat, 11 May 2024 19:03:44 +0200 Subject: [PATCH] chore(android): clean up logs (#3758) * perf: ensure we do not provide callback to native if no callback provided from app * chore: rework bufferConfig to make it more generic and reduce ReactExoplayerView code size * chore(android): cleanup logs TAG --- .../brentvatne/exoplayer/ReactExoplayerView.java | 14 +++++++------- .../exoplayer/ReactExoplayerViewManager.java | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 39108e96..6dccaee0 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -588,13 +588,13 @@ public class ReactExoplayerView extends FrameLayout implements DrmSessionManager drmSessionManager = initializePlayerDrm(self); if (drmSessionManager == null && self.drmUUID != null) { // Failed to intialize DRM session manager - cannot continue - DebugLog.e("ExoPlayer Exception", "Failed to initialize DRM Session Manager Framework!"); + DebugLog.e(TAG, "Failed to initialize DRM Session Manager Framework!"); eventEmitter.error("Failed to initialize DRM Session Manager Framework!", new Exception("DRM Session Manager Framework failure!"), "3003"); return; } if (activity == null) { - DebugLog.e("ExoPlayer Exception", "Failed to initialize Player!"); + DebugLog.e(TAG, "Failed to initialize Player!"); eventEmitter.error("Failed to initialize Player!", new Exception("Current Activity is null!"), "1001"); return; } @@ -606,8 +606,8 @@ public class ReactExoplayerView extends FrameLayout implements initializePlayerSource(self, drmSessionManager); } catch (Exception ex) { self.playerNeedsSource = true; - DebugLog.e("ExoPlayer Exception", "Failed to initialize Player!"); - DebugLog.e("ExoPlayer Exception", ex.toString()); + DebugLog.e(TAG, "Failed to initialize Player!"); + DebugLog.e(TAG, ex.toString()); self.eventEmitter.error(ex.toString(), ex, "1001"); } }); @@ -617,8 +617,8 @@ public class ReactExoplayerView extends FrameLayout implements } } catch (Exception ex) { self.playerNeedsSource = true; - DebugLog.e("ExoPlayer Exception", "Failed to initialize Player!"); - DebugLog.e("ExoPlayer Exception", ex.toString()); + DebugLog.e(TAG, "Failed to initialize Player!"); + DebugLog.e(TAG, ex.toString()); eventEmitter.error(ex.toString(), ex, "1001"); } }; @@ -734,7 +734,7 @@ public class ReactExoplayerView extends FrameLayout implements wait(); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); - DebugLog.e("ExoPlayer Exception", ex.toString()); + DebugLog.e(TAG, ex.toString()); } } diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java index c39b3797..24e9a004 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java @@ -35,6 +35,7 @@ import javax.annotation.Nullable; public class ReactExoplayerViewManager extends ViewGroupManager { + private static final String TAG = "ExoViewManager"; private static final String REACT_CLASS = "RCTVideo"; private static final String PROP_SRC = "src"; private static final String PROP_SRC_URI = "uri"; @@ -184,7 +185,7 @@ public class ReactExoplayerViewManager extends ViewGroupManager