Open kehuang805 opened 2 months ago
Thank you for your feature request. We will review it and get back to you if we need more information.
Apparently android has ducking built in somehow, we'd need to look at the code to see what we might need to do. https://developer.android.com/media/optimize/audio-focus#automatic_ducking
@kehuang805 I am currently working around audio focus. Can you please describe exactly the behavior you want to have ?
There are 3 props to handle audio: ignoreSilentSwitch is purely an ios feature mixWithOthers and disableFocus nearly have the same behavior (in fact they should be merged)
"inherit" (default) --> pause playback when when other app use audio (same as disableFocus=false) "mix" - Audio from this video mixes with audio from other apps. (same as disableFocus=true) "duck" - Reduces the volume of other apps while audio from this video plays. (Not available, but can be implemented)
@freeboub We would like disableFocus
to have the "duck" option which is currently not available like you mentioned. I guess it does not necessarily have to be coupled to the disableFocus
prop, but that is where the control for this behavior currently lives for android.
Description
Android currently only offers two options with
disableFocus
for either overriding or mixing outside audio and I did not see a way to duck with react-native-video.Why it is needed ?
iOS has the option to duck with the
mixWithOthers
property but it is not present for Android so it is not possible to have consistent behavior between operating systems currently.Possible implementation
Technical POV how to do it
Code sample
Code sample