Fix sending binary data a6eb5e3ed705f2d91e5c9ca5a36086c0054e4d23
data.buffer which was at 157 line in RTCDataChannel.js before this change was becoming {} when it gets to the WKWebViewRTC.swift through the bridge. So data was not being sent as expected.
I encoded it to string before passing, and then decoded afterwards.
Fix receiving binary data 5afeb61f19a0519efd6dc564f83d44ea89a539d8
Encode and decode received data just like the sent data.
data field of the first argument(event) of RTCDataChannel.prototype.onmessage is now ArrayBuffer following the native browser API, other than { Type: 'ArrayBuffer', Data: string }
data.buffer
which was at 157 line inRTCDataChannel.js
before this change was becoming{}
when it gets to theWKWebViewRTC.swift
through the bridge. So data was not being sent as expected.data
field of the first argument(event
) ofRTCDataChannel.prototype.onmessage
is nowArrayBuffer
following the native browser API, other than{ Type: 'ArrayBuffer', Data: string }