I'm implementing LiveKit in a Flutter app, the video is successfully streamed but when added audio I receive error in console. I don't know if this error is the main problem of not receiving/listening audio. Here is the code that I use to connect to the room. I'm testing on physical device, an iPhone with iOS 17
Future connectLiveKit(String roomId) async {
theRoom = Room();
var options = const ConnectOptions(autoSubscribe: true, protocolVersion: ProtocolVersion.v5);
var roomOptions = const RoomOptions(
defaultVideoPublishOptions: VideoPublishOptions(
simulcast: true,
),
);
await theRoom!.connect('wss://....', roomId, connectOptions: options, roomOptions: roomOptions);
theRoom?.addListener(_onRoomDidUpdate);
roomListener = theRoom?.createListener();
try {
await theRoom?.localParticipant?.setCameraEnabled(true);
} catch (e) {
print('could not publish video: $e');
}
await theRoom?.localParticipant?.setMicrophoneEnabled(true);
print('Joined room: ${theRoom?.name ?? ""}');
}
Here some logs:
[LiveKit] Configuring category: AVAudioSessionCategoryPlayback
[LiveKit] Configuring categoryOptions: ["mixWithOthers"]
[LiveKit] Configuring mode: AVAudioSessionModeSpokenAudio
[LiveKit] RTCAudioSession Configure success
[as] ATAudioSessionPropertyManager.mm:359 FAILED to set property 1684431725 on AVAudioSession with error Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
[LiveKit] Configuring category: AVAudioSessionCategoryPlayAndRecord
[LiveKit] Configuring categoryOptions: ["allowBluetooth", "allowBluetoothA2DP", "allowAirPlay"]
[LiveKit] Configuring mode: AVAudioSessionModeVideoChat
flutter: participants: 1
[LiveKit] RTCAudioSession Configure success
flutter: participants: 1
flutter: Joined room: video-oggi2
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
flutter: participants: 1
[LiveKit] Configuring category: AVAudioSessionCategoryPlayAndRecord
[LiveKit] Configuring categoryOptions: ["allowBluetooth", "allowBluetoothA2DP", "allowAirPlay"]
[LiveKit] Configuring mode: AVAudioSessionModeVideoChat
[LiveKit] RTCAudioSession Configure success
RTC AudioSession deactive is successful
[LiveKit] Configuring category: AVAudioSessionCategorySoloAmbient
[LiveKit] Configuring categoryOptions: []
[LiveKit] Configuring mode: AVAudioSessionModeDefault
[LiveKit] RTCAudioSession Configure success
Maybe the problem is in some other part of the code, but I only see these logs and the error: [as] ATAudioSessionPropertyManager.mm:359 FAILED to set property 1684431725 on AVAudioSession with error Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"