diff --git a/lib/src/rtc_data_channel_impl.dart b/lib/src/rtc_data_channel_impl.dart index 779911c..f503784 100644 --- a/lib/src/rtc_data_channel_impl.dart +++ b/lib/src/rtc_data_channel_impl.dart @@ -22,6 +22,9 @@ class RTCDataChannelWeb extends RTCDataChannel { _messageController.add(msg); onMessage?.call(msg); }); + _jsDc.addEventListener('bufferedamountlow', (_) { + onBufferedAmountLow?.call(bufferedAmount ?? 0); + }); } final html.RtcDataChannel _jsDc; @@ -39,6 +42,11 @@ class RTCDataChannelWeb extends RTCDataChannel { @override int? get bufferedAmount => _jsDc.bufferedAmount; + @override + set bufferedAmountLowThreshold(int? bufferedAmountLowThreshold) { + _jsDc.bufferedAmountLowThreshold = bufferedAmountLowThreshold; + } + final _stateChangeController = StreamController.broadcast(sync: true); final _messageController =