From aec7db63901c42dd7a591b030bfc69daa8860341 Mon Sep 17 00:00:00 2001 From: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> Date: Mon, 29 Jan 2024 07:36:13 +0100 Subject: [PATCH] Revert "fix: remove pausePlayback when audio focus loss event (#3496)" (#3504) This reverts commit b1ab0f24a3efbcc3be49005060f50b34a117664e. Co-authored-by: olivier --- .../main/java/com/brentvatne/exoplayer/ReactExoplayerView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index aa8f469628..55d7dd1acb 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -931,6 +931,8 @@ public void onAudioFocusChange(int focusChange) { case AudioManager.AUDIOFOCUS_LOSS: view.hasAudioFocus = false; view.eventEmitter.audioFocusChanged(false); + // FIXME this pause can cause issue if content doesn't have pause capability (can happen on live channel) + view.pausePlayback(); view.audioManager.abandonAudioFocus(this); break; case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT: