fix: default options for fast connect. (#289)

This commit is contained in:
CloudWebRTC
2023-05-22 12:17:34 +08:00
committed by GitHub
parent 3a049d0959
commit 03a7672cf1
3 changed files with 31 additions and 12 deletions
+14 -9
View File
@@ -201,30 +201,35 @@ 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);
_localParticipant!.publishAudioTrack(audio.track as LocalAudioTrack,
publishOptions: roomOptions.defaultAudioPublishOptions);
} else {
_localParticipant!.setMicrophoneEnabled(true);
_localParticipant!.setMicrophoneEnabled(true,
audioCaptureOptions: roomOptions.defaultAudioCaptureOptions);
}
}
var video = options.camera;
if (video.enabled != null && video.enabled == true) {
if (video.track != null) {
_localParticipant!
.publishVideoTrack(video.track as LocalVideoTrack);
_localParticipant!.publishVideoTrack(video.track as LocalVideoTrack,
publishOptions: roomOptions.defaultVideoPublishOptions);
} else {
_localParticipant!.setCameraEnabled(true);
_localParticipant!.setCameraEnabled(true,
cameraCaptureOptions: roomOptions.defaultCameraCaptureOptions);
}
}
var screen = options.screen;
if (screen.enabled != null && screen.enabled == true) {
if (screen.track != null) {
_localParticipant!
.publishVideoTrack(screen.track as LocalVideoTrack);
_localParticipant!.publishVideoTrack(
screen.track as LocalVideoTrack,
publishOptions: roomOptions.defaultVideoPublishOptions);
} else {
_localParticipant!.setScreenShareEnabled(true);
_localParticipant!.setScreenShareEnabled(true,
screenShareCaptureOptions:
roomOptions.defaultScreenShareCaptureOptions);
}
}
}