From a0f2b9d3fac7836853044d1de200cbaa6f8cdad7 Mon Sep 17 00:00:00 2001 From: CloudWebRTC Date: Wed, 29 Nov 2023 10:04:23 +0800 Subject: [PATCH] Fix safari screen sharing failure. (#415) * Fix safari screen sharing failure. * update. --- lib/src/participant/local.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/src/participant/local.dart b/lib/src/participant/local.dart index ea409058..9fcdc9cc 100644 --- a/lib/src/participant/local.dart +++ b/lib/src/participant/local.dart @@ -178,10 +178,9 @@ class LocalParticipant extends Participant { 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 (_) {