ios: Enabled camera and microphone after connect to room
This commit is contained in:
parent
00248c9870
commit
55d303d7b5
Binary file not shown.
@ -117,9 +117,21 @@ struct ConnectView: View {
|
|||||||
print("Connecting to room...")
|
print("Connecting to room...")
|
||||||
try await roomCtx.connect()
|
try await roomCtx.connect()
|
||||||
print("Room connected")
|
print("Room connected")
|
||||||
|
await enableCameraAndMicrophone()
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to get token: \(error.localizedDescription)")
|
print("Error trying to connect to room: \(error.localizedDescription)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func enableCameraAndMicrophone() async {
|
||||||
|
do {
|
||||||
|
try await room.localParticipant.setCamera(enabled: true)
|
||||||
|
try await room.localParticipant.setMicrophone(enabled: true)
|
||||||
|
} catch {
|
||||||
|
print("Error enabling camera and microphone: \(error.localizedDescription)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user