From 4a558f4b3252cc4d50935d1e7d61cb1ccfac79d5 Mon Sep 17 00:00:00 2001 From: evkwan Date: Tue, 3 May 2022 14:24:56 +0800 Subject: [PATCH 1/4] #2665 - fix maxbitrate property being ignored on Android due to selected track overwrite --- .../com/brentvatne/exoplayer/ReactExoplayerView.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 3dccad93..34243658 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -1017,9 +1017,15 @@ class ReactExoplayerView extends FrameLayout implements private void videoLoaded() { if (loadVideoStarted) { loadVideoStarted = false; - setSelectedAudioTrack(audioTrackType, audioTrackValue); - setSelectedVideoTrack(videoTrackType, videoTrackValue); - setSelectedTextTrack(textTrackType, textTrackValue); + if (audioTrackType != null) { + setSelectedAudioTrack(audioTrackType, audioTrackValue); + } + if (videoTrackType != null) { + setSelectedVideoTrack(videoTrackType, videoTrackValue); + } + if (textTrackType != null) { + setSelectedTextTrack(textTrackType, textTrackValue); + } Format videoFormat = player.getVideoFormat(); int width = videoFormat != null ? videoFormat.width : 0; int height = videoFormat != null ? videoFormat.height : 0; From 384166b285b8c52b24591dd81b87ffab198e7230 Mon Sep 17 00:00:00 2001 From: evkwan Date: Mon, 4 Jul 2022 01:03:31 +0800 Subject: [PATCH 2/4] - update changelog with pr number --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f705bdc3..85d378bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ - Fixed Android seeking bug [#2712](https://github.com/react-native-video/react-native-video/pull/2712) - Fixed `onReadyForDisplay` not being called [#2721](https://github.com/react-native-video/react-native-video/pull/2721) - Fix type of `_eventDispatcher` on iOS target to match `bridge.eventDispatcher()` [#2720](https://github.com/react-native-video/react-native-video/pull/2720) +- Fix maxBitRate property being ignored on Android [#2670](https://github.com/react-native-video/react-native-video/pull/2670) ### Version 5.2.0 From 95a55a255125e70c852915ee5e0112224573e056 Mon Sep 17 00:00:00 2001 From: evkwan Date: Tue, 3 May 2022 14:46:11 +0800 Subject: [PATCH 3/4] - fix spacing --- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 34243658..9da4fe0c 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -1020,10 +1020,10 @@ class ReactExoplayerView extends FrameLayout implements if (audioTrackType != null) { setSelectedAudioTrack(audioTrackType, audioTrackValue); } - if (videoTrackType != null) { + if (videoTrackType != null) { setSelectedVideoTrack(videoTrackType, videoTrackValue); } - if (textTrackType != null) { + if (textTrackType != null) { setSelectedTextTrack(textTrackType, textTrackValue); } Format videoFormat = player.getVideoFormat(); From 12189a94eb1968d278902948c0db7a8db6e8350d Mon Sep 17 00:00:00 2001 From: evkwan Date: Tue, 3 May 2022 14:47:43 +0800 Subject: [PATCH 4/4] - fix spacing issue --- .../brentvatne/exoplayer/ReactExoplayerView.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 9da4fe0c..fdbbff44 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -1018,14 +1018,14 @@ class ReactExoplayerView extends FrameLayout implements if (loadVideoStarted) { loadVideoStarted = false; if (audioTrackType != null) { - setSelectedAudioTrack(audioTrackType, audioTrackValue); - } - if (videoTrackType != null) { - setSelectedVideoTrack(videoTrackType, videoTrackValue); - } - if (textTrackType != null) { - setSelectedTextTrack(textTrackType, textTrackValue); - } + setSelectedAudioTrack(audioTrackType, audioTrackValue); + } + if (videoTrackType != null) { + setSelectedVideoTrack(videoTrackType, videoTrackValue); + } + if (textTrackType != null) { + setSelectedTextTrack(textTrackType, textTrackValue); + } Format videoFormat = player.getVideoFormat(); int width = videoFormat != null ? videoFormat.width : 0; int height = videoFormat != null ? videoFormat.height : 0;