diff --git a/CHANGELOG.md b/CHANGELOG.md index e02c3c7..f0e8e6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog -------------------------------------------- +[1.5.3+hotfix.1] - 2025-04-25 + +* add getter override for dc.bufferedAmountLowThreshold. [1.5.3] - 2025-03-24 diff --git a/lib/src/media_stream_track_impl.dart b/lib/src/media_stream_track_impl.dart index d52066a..fb16d46 100644 --- a/lib/src/media_stream_track_impl.dart +++ b/lib/src/media_stream_track_impl.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; import 'dart:typed_data'; import 'package:web/web.dart' as web; @@ -77,25 +78,49 @@ class MediaStreamTrackWeb extends MediaStreamTrack { var settings = jsTrack.getSettings(); var _converted = {}; if (kind == 'audio') { - _converted['sampleRate'] = settings.sampleRate; - _converted['sampleSize'] = settings.sampleSize; - _converted['echoCancellation'] = settings.echoCancellation; - _converted['autoGainControl'] = settings.autoGainControl; - _converted['noiseSuppression'] = settings.noiseSuppression; - _converted['latency'] = settings.latency; - _converted['channelCount'] = settings.channelCount; + if (settings.has('sampleRate')) { + _converted['sampleRate'] = settings.sampleRate; + } + if (settings.has('sampleSize')) { + _converted['sampleSize'] = settings.sampleSize; + } + if (settings.has('echoCancellation')) { + _converted['echoCancellation'] = settings.echoCancellation; + } + if (settings.has('autoGainControl')) { + _converted['autoGainControl'] = settings.autoGainControl; + } + if (settings.has('noiseSuppression')) { + _converted['noiseSuppression'] = settings.noiseSuppression; + } + if (settings.has('latency')) _converted['latency'] = settings.latency; + if (settings.has('channelCount')) { + _converted['channelCount'] = settings.channelCount; + } } else { - _converted['width'] = settings.width; - _converted['height'] = settings.height; - _converted['aspectRatio'] = settings.aspectRatio; - _converted['frameRate'] = settings.frameRate; - if (isMobile) { + if (settings.has('width')) { + _converted['width'] = settings.width; + } + if (settings.has('height')) { + _converted['height'] = settings.height; + } + if (settings.has('aspectRatio')) { + _converted['aspectRatio'] = settings.aspectRatio; + } + if (settings.has('frameRate')) { + _converted['frameRate'] = settings.frameRate; + } + if (isMobile && settings.has('facingMode')) { _converted['facingMode'] = settings.facingMode; } - _converted['resizeMode'] = settings.resizeMode; + if (settings.has('resizeMode')) { + _converted['resizeMode'] = settings.resizeMode; + } + } + if (settings.has('deviceId')) _converted['deviceId'] = settings.deviceId; + if (settings.has('groupId')) { + _converted['groupId'] = settings.groupId; } - _converted['deviceId'] = settings.deviceId; - _converted['groupId'] = settings.groupId; return _converted; } diff --git a/lib/src/rtc_data_channel_impl.dart b/lib/src/rtc_data_channel_impl.dart index f41be4e..864c7b3 100644 --- a/lib/src/rtc_data_channel_impl.dart +++ b/lib/src/rtc_data_channel_impl.dart @@ -53,6 +53,9 @@ class RTCDataChannelWeb extends RTCDataChannel { return _jsDc.bufferedAmount; } + @override + int? get bufferedAmountLowThreshold => _jsDc.bufferedAmountLowThreshold; + @override set bufferedAmountLowThreshold(int? bufferedAmountLowThreshold) { _jsDc.bufferedAmountLowThreshold = bufferedAmountLowThreshold ?? 0; diff --git a/pubspec.yaml b/pubspec.yaml index 910244b..9074d90 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_webrtc description: Use the dart/js library to re-wrap the webrtc js interface of the browser, to adapted common browsers. -version: 1.5.3 +version: 1.5.3+hotfix.1 homepage: https://github.com/flutter-webrtc/dart-webrtc environment: