fix: Fixed track not being correctly passed to localParticipant in FastConnectOptions, causing the camera to apply twice and not be released. (#188)

This commit is contained in:
CloudWebRTC
2022-10-16 22:02:37 +08:00
committed by GitHub
parent a771744d19
commit 306ee473e9
+15 -6
View File
@@ -151,23 +151,32 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
var audio = options.microphone;
if (audio.enabled != null && audio.enabled == true) {
if (audio.track != null) {
_localParticipant!
.publishAudioTrack(audio.track as LocalAudioTrack);
} else {
_localParticipant!.setMicrophoneEnabled(true);
} else if (audio.track != null) {
_localParticipant!.publishAudioTrack(audio.track as LocalAudioTrack);
}
}
var video = options.camera;
if (video.enabled != null && video.enabled == true) {
if (video.track != null) {
_localParticipant!
.publishVideoTrack(video.track as LocalVideoTrack);
} else {
_localParticipant!.setCameraEnabled(true);
} else if (video.track != null) {
_localParticipant!.publishVideoTrack(video.track as LocalVideoTrack);
}
}
var screen = options.screen;
if (screen.enabled != null && screen.enabled == true) {
if (screen.track != null) {
_localParticipant!
.publishVideoTrack(screen.track as LocalVideoTrack);
} else {
_localParticipant!.setScreenShareEnabled(true);
} else if (screen.track != null) {
_localParticipant!.publishVideoTrack(screen.track as LocalVideoTrack);
}
}
}