diff --git a/lib/src/participant/local.dart b/lib/src/participant/local.dart index 88648f9a8..d3cacbd84 100644 --- a/lib/src/participant/local.dart +++ b/lib/src/participant/local.dart @@ -90,8 +90,6 @@ class LocalParticipant extends Participant { track.lastPublishOptions = publishOptions; - await track.start(); - final transceiverInit = rtc.RTCRtpTransceiverInit( direction: rtc.TransceiverDirection.SendOnly, sendEncodings: [ @@ -130,6 +128,8 @@ class LocalParticipant extends Participant { publication: pub, )); + await track.start(); + return pub; } diff --git a/lib/src/participant/remote.dart b/lib/src/participant/remote.dart index f04ad4b80..9d5c9c407 100644 --- a/lib/src/participant/remote.dart +++ b/lib/src/participant/remote.dart @@ -170,8 +170,6 @@ class RemoteParticipant extends Participant { throw UnexpectedStateException('Unknown track type'); } - await track.start(); - /// Apply audio output selection for the web. if (pub.kind == TrackType.AUDIO && lkPlatformIs(PlatformType.web)) { if (audioOutputOptions.deviceId != null) { @@ -189,6 +187,8 @@ class RemoteParticipant extends Participant { track: track, publication: pub, )); + + await track.start(); } @override diff --git a/pubspec.yaml b/pubspec.yaml index 25902f39e..b8b2fe21d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,7 @@ dependencies: device_info_plus: '>=8.0.0' js: ^0.6.4 platform_detect: ^2.0.7 - dart_webrtc: ^1.4.0 + dart_webrtc: ^1.4.2 sdp_transform: ^0.3.2 web: ^0.5.1