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

Instantiating a geckos client within a web worker throws a ReferenceError #280

Open
johnnyrainbow opened this issue Jan 11, 2024 · 2 comments

Comments

@johnnyrainbow
Copy link

johnnyrainbow commented Jan 11, 2024

I am trying to init geckos client connection in a web worker, but it throws ReferenceError: RTCPeerConnection is not defined. Does not happen when running on the main thread. Is this a limitation of WebRTC or a Geckos bug?

I want to run my socket connections in a web worker, as my main thread is doing a lot of heavy lifting and I don't want it to impact data stream performance

@johnnyrainbow johnnyrainbow changed the title Trying to connect geckos client in Web Worker throws ReferenceError: RTCPeerConnection is not defined Instantiating a geckos client within a web worker throws a ReferenceError Jan 25, 2024
@reececomo
Copy link

Had a similar idea but unfortunately: https://stackoverflow.com/a/54209625

According to the specifications [1, 2], navigator.mediaDevices and RTCPeerConnection are not defined for web workers, so WebRTC shouldn't be available on web workers for now.

@reececomo
Copy link

Maybe Transferable Streams could work?

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