Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Brazol committed Jan 16, 2025
1 parent e99c99a commit 16f5bca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/stream_video/lib/src/webrtc/rtc_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,10 @@ extension PublisherRtcManager on RtcManager {
RtcLocalTrack track,
SfuPublishOptions publishOptions,
) async {
if (publisher == null) {
return Result.error('Publisher is not created, cannot add transceiver');
}

Result<rtc.RTCRtpTransceiver>? transceiverResult;

// create a clone of the track as otherwise the same trackId will
Expand All @@ -775,7 +779,7 @@ extension PublisherRtcManager on RtcManager {
);

if (track is RtcLocalAudioTrack) {
transceiverResult = await publisher.addAudioTransceiver(
transceiverResult = await publisher!.addAudioTransceiver(
track: mediaTrack,
encodings: [
rtc.RTCRtpEncoding(rid: 'a', maxBitrate: AudioBitrate.music),
Expand All @@ -795,7 +799,7 @@ extension PublisherRtcManager on RtcManager {
_logger.v(() => '[addTransceiver] encoding: ${encoding.toMap()}');
}

transceiverResult = await publisher.addVideoTransceiver(
transceiverResult = await publisher!.addVideoTransceiver(
track: mediaTrack,
encodings: sendEncodings,
);
Expand Down

0 comments on commit 16f5bca

Please sign in to comment.