Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Duck option for audio from other apps on Android #4144

Open
kehuang805 opened this issue Sep 3, 2024 · 4 comments
Open

[Feature]: Duck option for audio from other apps on Android #4144

kehuang805 opened this issue Sep 3, 2024 · 4 comments

Comments

@kehuang805
Copy link

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

Copy link

github-actions bot commented Sep 3, 2024

Thank you for your feature request. We will review it and get back to you if we need more information.

@paulrinaldi
Copy link
Contributor

paulrinaldi commented Sep 5, 2024

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

@freeboub
Copy link
Collaborator

freeboub commented Sep 15, 2024

@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)

@kehuang805
Copy link
Author

kehuang805 commented Sep 16, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants