Skip to content

Commit 98e0ca1

Browse files
committed
[video_player] Removed AudioSession configuration on iOS
We have a custom AudioSession configuration, so it shouldn't be set on video_player.
1 parent d4db207 commit 98e0ca1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,10 @@ - (FLTTextureMessage *)onPlayerSetup:(FLTVideoPlayer *)player
553553
}
554554

555555
- (void)initialize:(FlutterError *__autoreleasing *)error {
556+
// WE HAVE A CUSTOM AUDIO SESSION CONFIGURATION, SO IT SHOULDN'T BE CONFIGURED HERE.
557+
//
556558
// Allow audio playback when the Ring/Silent switch is set to silent
557-
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
559+
// [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
558560

559561
[self.playersByTextureId
560562
enumerateKeysAndObjectsUsingBlock:^(NSNumber *textureId, FLTVideoPlayer *player, BOOL *stop) {
@@ -649,13 +651,15 @@ - (void)pause:(FLTTextureMessage *)input error:(FlutterError **)error {
649651

650652
- (void)setMixWithOthers:(FLTMixWithOthersMessage *)input
651653
error:(FlutterError *_Nullable __autoreleasing *)error {
652-
if (input.mixWithOthers.boolValue) {
653-
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback
654-
withOptions:AVAudioSessionCategoryOptionMixWithOthers
655-
error:nil];
656-
} else {
657-
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
658-
}
654+
// WE HAVE A CUSTOM AUDIO SESSION CONFIGURATION, SO IT SHOULDN'T BE CONFIGURED HERE.
655+
//
656+
// if (input.mixWithOthers.boolValue) {
657+
// [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback
658+
// withOptions:AVAudioSessionCategoryOptionMixWithOthers
659+
// error:nil];
660+
// } else {
661+
// [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
662+
// }
659663
}
660664

661665
@end

0 commit comments

Comments
 (0)