[IOS platform]AudioEngine:Fixed audio can not resume if it is interrupted cause by an incoming phone

    xiaoxiao2022-06-29  38

    1.cocos是个坑

    2.修改 cocos/audio/apple/AudioEngine-inl.mm

    { if ([[[UIDevice currentDevice] systemVersion] intValue] > 5) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleInterruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleInterruption:) name:UIApplicationDidBecomeActiveNotification object:[AVAudioSession sharedInstance]]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleInterruption:) name:UIApplicationDidBecomeActiveNotification object:nil]; } else { AudioSessionInitialize(NULL, NULL, AudioEngineInterruptionListenerCallback, self);

    转载请注明原文地址: https://ju.6miu.com/read-1125338.html

    最新回复(0)