diff --git a/ios-common/Classes/AudioWebRTCClient.swift b/ios-common/Classes/AudioWebRTCClient.swift index 41e9349..6206a94 100644 --- a/ios-common/Classes/AudioWebRTCClient.swift +++ b/ios-common/Classes/AudioWebRTCClient.swift @@ -110,7 +110,9 @@ open class AudioWebRTCClient: NSObject { do { try self.rtcAudioSession.setCategory(AVAudioSession.Category.playAndRecord.rawValue) + try self.rtcAudioSession.session.setCategory(AVAudioSession.Category.playAndRecord, options: [AVAudioSession.CategoryOptions.mixWithOthers]) try self.rtcAudioSession.setMode(AVAudioSession.Mode.voiceChat.rawValue) + } catch let error { debugPrint("Error changing AVAudioSession category: \(error)") } diff --git a/ios/NativeOnly/BigBlueButtonSDK.swift b/ios/NativeOnly/BigBlueButtonSDK.swift index b9743fa..d58f5e2 100644 --- a/ios/NativeOnly/BigBlueButtonSDK.swift +++ b/ios/NativeOnly/BigBlueButtonSDK.swift @@ -8,6 +8,7 @@ import Foundation import os import bigbluebutton_mobile_sdk_common +import AVFAudio open class BigBlueButtonSDK: NSObject { // Logger (these messages are displayed in the console application) @@ -91,6 +92,13 @@ open class BigBlueButtonSDK: NSObject { logger.info("Detected a change in userDefaults for key broadcastFinished") ReactNativeEventEmitter.emitter.sendEvent(withName: ReactNativeEventEmitter.EVENT.onBroadcastFinished.rawValue, body: nil) } + + do { + try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, options: [AVAudioSession.CategoryOptions.mixWithOthers]) + try AVAudioSession.sharedInstance().setPrefersNoInterruptionsFromSystemAlerts(true) + } catch let error { + logger.error("Error configuring audio session \(error.localizedDescription)") + } } public static func getBroadcastExtensionBundleId() -> String { @@ -107,6 +115,7 @@ open class BigBlueButtonSDK: NSObject { } public static func onAppTerminated(){ + logger.info("onAppTerminated called") BBBSharedData .getUserDefaults(appGroupName: self.appGroupName) .set(BBBSharedData.generatePayload(), forKey: BBBSharedData.SharedData.onApplicationTerminated) diff --git a/ios/ReactExported/ScreenShareServiceManager.swift b/ios/ReactExported/ScreenShareServiceManager.swift index 0a691cc..299ad88 100644 --- a/ios/ReactExported/ScreenShareServiceManager.swift +++ b/ios/ReactExported/ScreenShareServiceManager.swift @@ -22,10 +22,7 @@ class ScreenShareServiceManager: NSObject { Task.init { do{ - try audioSession.setCategory(AVAudioSession.Category.playback, options: [AVAudioSession.CategoryOptions.mixWithOthers]) - try audioSession.setPrefersNoInterruptionsFromSystemAlerts(true) try audioSession.setActive(true) - }catch{ print(error) }