Skip to content

Commit

Permalink
Fix safari screen sharing failure. (#415)
Browse files Browse the repository at this point in the history
* Fix safari screen sharing failure.

* update.
  • Loading branch information
cloudwebrtc authored Nov 29, 2023
1 parent 86e43b3 commit a0f2b9d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/participant/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
try {
// try to use getSettings for more accurate resolution
final settings = track.mediaStreamTrack.getSettings();
if (settings['width'] is int) {
if ((settings['width'] is int && settings['width'] as int > 0) &&
(settings['height'] is int && settings['height'] as int > 0)) {
dimensions = dimensions.copyWith(width: settings['width'] as int);
}
if (settings['height'] is int) {
dimensions = dimensions.copyWith(height: settings['height'] as int);
}
} catch (_) {
Expand Down

0 comments on commit a0f2b9d

Please sign in to comment.