Skip to content

Conversation

@js-seo
Copy link

@js-seo js-seo commented Jan 5, 2022

  • Fix sending binary data a6eb5e3
    • 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 5afeb61
    • 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 }

@hthetiot
Copy link
Contributor

hthetiot commented Jan 6, 2022

Interesting PR, I may back port this feature on https://github.com/cordova-rtc/cordova-plugin-iosrtc

@noahmehl
Copy link
Contributor

@js-seo WOW! Thanks so much for contributing this! We will review asap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants