Skip to content

Commit

Permalink
fixed rtc tracks when switching between screen share types on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Brazol authored and esarbanis committed Feb 2, 2024
1 parent d12b764 commit fe3bc8b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/stream_video/lib/src/webrtc/rtc_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,21 @@ extension RtcManagerTrackHelper on RtcManager {

// Track found, mute/unmute it.
if (track != null) {
if (enabled &&
track.trackType == SfuTrackType.screenShare &&
constraints is ScreenShareConstraints &&
(track.mediaConstraints as ScreenShareConstraints)
.useiOSBroadcastExtension !=
constraints.useiOSBroadcastExtension) {
// If existing screen share track has different broadcast extension constraints, unpublish it and create a new one.
await unpublishTrack(trackId: track.trackId);

return _createAndPublishTrack(
trackType: trackType,
constraints: constraints,
);
}

final toggledTrack = await _toggleTrackMuteState(
track: track,
muted: !enabled,
Expand Down

0 comments on commit fe3bc8b

Please sign in to comment.