Skip to content

Commit

Permalink
fix bug for fast connect. (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc authored Dec 12, 2023
1 parent 7f5c0ba commit 3ef53d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/src/core/room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
var options = engine.fastConnectOptions!;

var audio = options.microphone;
if (audio.enabled != null && audio.enabled == true) {
bool audioEnabled = audio.enabled == true || audio.track != null;
if (audioEnabled) {
if (audio.track != null) {
_localParticipant!.publishAudioTrack(audio.track as LocalAudioTrack,
publishOptions: roomOptions.defaultAudioPublishOptions);
Expand All @@ -213,7 +214,8 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
}

var video = options.camera;
if (video.enabled != null && video.enabled == true) {
bool videoEnabled = video.enabled == true || video.track != null;
if (videoEnabled) {
if (video.track != null) {
_localParticipant!.publishVideoTrack(video.track as LocalVideoTrack,
publishOptions: roomOptions.defaultVideoPublishOptions);
Expand All @@ -224,7 +226,8 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
}

var screen = options.screen;
if (screen.enabled != null && screen.enabled == true) {
bool screenEnabled = screen.enabled == true || screen.track != null;
if (screenEnabled) {
if (screen.track != null) {
_localParticipant!.publishVideoTrack(
screen.track as LocalVideoTrack,
Expand Down

0 comments on commit 3ef53d4

Please sign in to comment.