We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AudioSessionGetProperty 已被废弃,ios14以上每次打电话结束都会崩溃
崩溃的原因就是取不到 interruptionType的值
(void)_handleAudioSessionInterruptionWithState:(UInt32)state { if (state == kAudioSessionBeginInterruption) { [_renderer setInterrupted:YES]; [_renderer stop]; [self _sendEvent:event_interruption_begin]; } else if (state == kAudioSessionEndInterruption) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated" AudioSessionInterruptionType interruptionType = kAudioSessionInterruptionType_ShouldNotResume; UInt32 interruptionTypeSize = sizeof(interruptionType); OSStatus status; status = AudioSessionGetProperty(kAudioSessionProperty_InterruptionType, &interruptionTypeSize, &interruptionType); NSAssert(status == noErr, @"failed to get interruption type"); #pragma clang diagnostic pop
[self _sendEvent:event_interruption_end userData:(void *)(uintptr_t)interruptionType]; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
AudioSessionGetProperty 已被废弃,ios14以上每次打电话结束都会崩溃
崩溃的原因就是取不到 interruptionType的值
(void)_handleAudioSessionInterruptionWithState:(UInt32)state
{
if (state == kAudioSessionBeginInterruption) {
[_renderer setInterrupted:YES];
[_renderer stop];
[self _sendEvent:event_interruption_begin];
}
else if (state == kAudioSessionEndInterruption) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
AudioSessionInterruptionType interruptionType = kAudioSessionInterruptionType_ShouldNotResume;
UInt32 interruptionTypeSize = sizeof(interruptionType);
OSStatus status;
status = AudioSessionGetProperty(kAudioSessionProperty_InterruptionType,
&interruptionTypeSize,
&interruptionType);
NSAssert(status == noErr, @"failed to get interruption type");
#pragma clang diagnostic pop
[self _sendEvent:event_interruption_end
userData:(void *)(uintptr_t)interruptionType];
}
}
The text was updated successfully, but these errors were encountered: