Skip to content

Commit 8446e95

Browse files
authored
Merge pull request #32 from flutter-webrtc/fix/dc-data-parse
Fix DC data parse.
2 parents a3edbd5 + ce00dde commit 8446e95

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

33
--------------------------------------------
4+
[1.3.3] - 2024-04-09
5+
6+
* Fix DC data parse.
7+
48
[1.3.2] - 2024-04-09
59

610
* Fix error when constructing RTCDataChannelInit.

lib/src/rtc_data_channel_impl.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@ class RTCDataChannelWeb extends RTCDataChannel {
7070
return RTCDataChannelMessage(data);
7171
}
7272
dynamic arrayBuffer;
73-
if (data is web.Blob) {
74-
// This should never happen actually
75-
arrayBuffer = await jsutil
76-
.promiseToFuture(jsutil.callMethod(data, 'arrayBuffer', []));
73+
if (data is JSArrayBuffer) {
74+
arrayBuffer = data.toDart;
7775
} else {
78-
arrayBuffer = data;
76+
arrayBuffer = data.toString();
7977
}
8078
return RTCDataChannelMessage.fromBinary(arrayBuffer.asUint8List());
8179
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dart_webrtc
22
description: Use the dart/js library to re-wrap the webrtc js interface of the browser, to adapted common browsers.
3-
version: 1.3.2
3+
version: 1.3.3
44
homepage: https://github.com/flutter-webrtc/dart-webrtc
55

66
environment:

0 commit comments

Comments
 (0)