8000 [Windows] Fix using the wrong id to listen datachannel events. · strogo/flutter-webrtc@2281cae · GitHub
[go: up one dir, main page]

Skip to content

Commit 2281cae

Browse files
authored
[Windows] Fix using the wrong id to listen datachannel events.
1 parent 8a32c97 commit 2281cae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/native/rtc_peerconnection_impl.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,14 @@ class RTCPeerConnectionNative extends RTCPeerConnection {
411411
Future<RTCDataChannel> createDataChannel(
412412
String label, RTCDataChannelInit dataChannelDict) async {
413413
try {
414-
await WebRTC.invokeMethod('createDataChannel', <String, dynamic>{
414+
final response = await WebRTC.invokeMethod('createDataChannel', <String, dynamic>{
415415
'peerConnectionId': _peerConnectionId,
416416
'label': label,
417417
'dataChannelDict': dataChannelDict.toMap()
418418
});
419+
419420
_dataChannel =
420-
RTCDataChannelNative(_peerConnectionId, label, dataChannelDict.id);
421+
RTCDataChannelNative(_peerConnectionId, label, response['id']);
421422
return _dataChannel!;
422423
} on PlatformException catch (e) {
423424
throw 'Unable to RTCPeerConnection::createDataChannel: ${e.message}';

0 commit comments

Comments
 (0)
0