-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bugfix/ios audio managment on app start #1120
base: main
Are you sure you want to change the base?
Bugfix/ios audio managment on app start #1120
Conversation
41af8b8
to
7c41d80
Compare
@@ -542,6 +542,11 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult) result | |||
} | |||
[dataChannels removeAllObjects]; | |||
} | |||
|
|||
#if TARGET_OS_IPHONE | |||
[[NSNotificationCenter defaultCenter] removeObserver: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.
Here is for sure some formatting issue. Please use the same formatting as in edited file.
#if TARGET_OS_IPHONE | ||
_preferredInput = AVAudioSessionPortHeadphones; | ||
_speakerOn = NO; | ||
[AudioUtils setSpeakerphoneOn:_speakerOn]; | ||
AVAudioSession *session = [AVAudioSession sharedInstance]; | ||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didSessionRouteChange:) name:AVAudioSessionRouteChangeNotification object:session]; | ||
#endif |
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.
But what if several peer connection will be created simultaneously?
_speakerOn = NO; | ||
[AudioUtils setSpeakerphoneOn:_speakerOn]; | ||
AVAudioSession *session = [AVAudioSession sharedInstance]; | ||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didSessionRouteChange:) name:AVAudioSessionRouteChangeNotification object:session]; |
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 think that at last this part must be left here, because technically we could want to get this notification event without active peer connection.
7c41d80
to
a2a21b6
Compare
@PawelBijok hey, I added some changes to #1122, it will only operate when RTCAudioSession.isActive, so the problem you described should be fixed, I opened the flutter-webrtc/example app when the zoom meeting was open, and the test results have been Will not affect the voip/music app anymore. |
Fixes #1119