Open eweseongyeoh opened 1 month ago
Thank you for your bug report. We will review it and get back to you if we need more information.
Thank you for your bug report. We will review it and get back to you if we need more information.
https://developer.android.com/reference/kotlin/androidx/media3/common/Player#setVolume(float) currently we don't check if volume control is available ... I think you have a correct workaround. media3 volume apis are handling volume on player side and it can be disturbing for end user to have 2 parrallel volume management. I can advise to use something like : https://www.npmjs.com/package/react-native-volume-manager to handle volume of the device, not one the player
I don't reproduce the issue with emulator. It would be interesting to test following patch to see if the log is displayed !
Tested on emulator Pixel 8 API 31 (Android 12)
diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java
index 0714115e..62055c9d 100644
--- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java
+++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java
@@ -2133,7 +2133,12 @@ public class ReactExoplayerView extends FrameLayout implements
public void setMutedModifier(boolean muted) {
this.muted = muted;
if (player != null) {
- player.setVolume(muted ? 0.f : audioVolume);
+ Player.Commands cmd = player.getAvailableCommands();
+ if (cmd.contains(Player.COMMAND_SET_VOLUME)) {
+ player.setVolume(muted ? 0.f : audioVolume);
+ } else {
+ DebugLog.e(TAG, "player doesn't support volume management");
+ }
}
}
Version
6.5.0
What platforms are you having the problem on?
Android
System Version
Android 13
On what device are you experiencing the issue?
Real device
Architecture
Old architecture
What happened?
muted
video still play audio when loaded on Samsung/Pixel devices with Android 12 or 13; please note that we have attempted to load the same video on other devices like Huawei/Xiaomi/oppo with similar Android version and they work fine in them.we have applied a workaround with
selectedAudioTrack={{type: SelectedTrackType.DISABLED}}
configuration, it isn't ideal, but it works for us.Reproduction Link
No response
Reproduction
Step to reproduce this bug are:
muted
video on Samsung/Pixel devices with Android 12 or 13