Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from JSON to binary encoding #1

Open
link2xt opened this issue Jun 21, 2024 · 1 comment
Open

Switch from JSON to binary encoding #1

link2xt opened this issue Jun 21, 2024 · 1 comment

Comments

@link2xt
Copy link

link2xt commented Jun 21, 2024

Something adhoc or bencode would be better than using readAsDataURL to base64-encode the payload. Realtime channels are capable of sending real binary data, no need to have base64 overhead.

@WofWca
Copy link
Owner

WofWca commented Jun 21, 2024

You're right, I wrote a TODO about this

// TODO perf: it is more efficient to send video data directly as
// video arrayBuffer instead of converting back and forth to strings
// and back.
const payload = JSON.parse(new TextDecoder().decode(data));

It was just the quickest way to fork off of the original code.

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

No branches or pull requests

2 participants