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

How to easily support messaging between RTCScriptTransform and RTCScriptTransformer #94

Closed
youennf opened this issue Mar 25, 2021 · 0 comments · Fixed by #96
Closed

Comments

@youennf
Copy link
Collaborator

youennf commented Mar 25, 2021

Safari prototype supports a MessagePort natively so that RTCScriptTransform and RTCScriptTransformer can exchange messages conveniently. This mimics AudioWorkletProcessor.port.

Another approach would be to add a parameter to RTCScriptTransform to transfer some objects when serialising the options constructor parameter. Something like:

const channel = new MessageChannel()
const transform = new RTCRtpScriptTransform(worker, { name: 'myPortTransform', port: { channel.port2 }, [channel.port2])
transform.port = channel.port1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant