Skip to content

Commit

Permalink
simplified screen share constraints comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Brazol authored and esarbanis committed Feb 2, 2024
1 parent fe3bc8b commit 214a522
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
- [x] Live streaming component(s) [Deven]
- [x] Deeplinking
- [ ] Tap to focus (flutter_webrtc) [Kanat]
- [ ] Push notifications [Maciej]
- [x] Push notifications [Maciej]
- - [x] Customization of the incoming/outgoing call screens
- - [x] Customizing CallKit ringing calls
- - [ ] Bug app crashes when notification button is tapped
- - [x] Bug app crashes when notification button is tapped
- [x] Native packages refactor [Maciej]
- - [X] Create the native projects in stream_video_flutter
- - [x] Merge stream_video_flutter_background
Expand All @@ -43,7 +43,7 @@
- - [x] iOS
- - [x] Android
- [x] Regular reconnection [Maciej,Kanat]
- [ ] Support ICE restart reconnection [Maciej,Kanat]
- [x] Support ICE restart reconnection [Maciej,Kanat]
- [x] Update WebRTC version to m114 (livekit version) [Kanat]
- [x] Fix analysis issues [Maciej]

Expand Down
7 changes: 2 additions & 5 deletions packages/stream_video/lib/src/webrtc/rtc_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,8 @@ 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) {
track is RtcLocalScreenShareTrack &&
!track.compareScreenShareMode(constraints)) {
// If existing screen share track has different broadcast extension constraints, unpublish it and create a new one.
await unpublishTrack(trackId: track.trackId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,14 @@ extension RtcLocalAudioTrackHardwareExt on RtcLocalAudioTrack {
}
}
}

extension RtcLocalScreenShareTrackExt on RtcLocalScreenShareTrack {
bool compareScreenShareMode(MediaConstraints? constraints) {
if (constraints !is ScreenShareConstraints) {
return false;
}

return mediaConstraints.useiOSBroadcastExtension ==
(constraints as ScreenShareConstraints).useiOSBroadcastExtension;
}
}

0 comments on commit 214a522

Please sign in to comment.