diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-08-17 07:06:07 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-08-17 07:06:07 +0300 |
commit | c4fa62d07dac1c3855dae4ed5108ab0f3eb43ceb (patch) | |
tree | 9d54ab1bd73a0ec33ace5b88be0589f2b692f0f9 /src/ios.m | |
parent | 2e572484f7b91125551f7d9a7ffa67aee9589035 (diff) |
iOS: Setting the audio session category
Diffstat (limited to 'src/ios.m')
-rw-r--r-- | src/ios.m | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -264,7 +264,6 @@ void setupApplication_iOS(void) { | |||
264 | selector:@selector(keyboardOffScreen:) | 264 | selector:@selector(keyboardOffScreen:) |
265 | name:UIKeyboardWillHideNotification | 265 | name:UIKeyboardWillHideNotification |
266 | object:nil]; | 266 | object:nil]; |
267 | [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; | ||
268 | /* Media player remote controls. */ | 267 | /* Media player remote controls. */ |
269 | MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter]; | 268 | MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter]; |
270 | [[commandCenter pauseCommand] addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) { | 269 | [[commandCenter pauseCommand] addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) { |
@@ -487,6 +486,8 @@ void init_AVFAudioPlayer(iAVFAudioPlayer *d) { | |||
487 | d->player = NULL; | 486 | d->player = NULL; |
488 | d->volume = 1.0f; | 487 | d->volume = 1.0f; |
489 | d->state = initialized_AVFAudioPlayerState; | 488 | d->state = initialized_AVFAudioPlayerState; |
489 | /* Playback is imminent. */ | ||
490 | [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; | ||
490 | } | 491 | } |
491 | 492 | ||
492 | void deinit_AVFAudioPlayer(iAVFAudioPlayer *d) { | 493 | void deinit_AVFAudioPlayer(iAVFAudioPlayer *d) { |