-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
refactor(ios): audio session manager #3850
base: master
Are you sure you want to change the base?
refactor(ios): audio session manager #3850
Conversation
@@ -241,6 +242,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH | |||
|
|||
required init?(coder aDecoder: NSCoder) { | |||
super.init(coder: aDecoder) | |||
AudioSessionManager.shared.registerView(view: self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no unregisterView call, is it really expected ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I will add unregisterView to deinit 👍
(but this I guess would be fine as it is because there is week object list so it would deinit anyway)
Change make sense for me (this is really cleaner I think). |
First of all, thank you for your great work.
|
@KrzysztofMoch is it fixing: #3838 ? |
It can (or at last will show warning), background audio and |
Hey @YangJonghun - Thanks for your feedback!
|
I wrote that because it is my understanding that setting up an AudioSession overwrites all previous settings. If I'm wrong, please let me know.
This is the same as |
@KrzysztofMoch you can merge when you want ! |
Okay, I will describe in docs how this will works to don't confuse peoples - I will do it this week |
additionnal comment, you need to replace all usage of: |
Hi guys any updates on this ? trying to Play background music when video is muted. Stop background music when video is unmuted #4156 |
let shouldEnableDucking = videoViews.allObjects.contains { view in | ||
view._mixWithOthers == "duck" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know in the original code theres no case for switching back to inherit, would it be possible to add it in ?
Because once you set it to 'mix' or 'duck' theres no way to set it back to 'inherit'
Hey guys any updates on this? I'm having the same issue 😢 |
Summary
Create Audio Session Manager for better and more reliable audio session management
Motivation
In old implementation each component is changing audio session properties without carrying about other components - with audio session manager, components will respect other components "needs"
Note
This is very risky change (at last for me) and need tests to see if everything is working as it should