Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use WebRTC with WebWorker

I am interested in to use webrtc with webworker. Is it possible?

I tried it but it did not work because it did not find the "window"

like image 995
jack Avatar asked Jan 16 '19 00:01

jack


1 Answers

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.

For [1], navigator.mediaDevices attribute is defined on Navigator interface for window, but not on WorkerNavigator interface for web worker.

For [2], RTCPeerConnection interface is exposed to window ([Exposed=Window]), but not to web worker ([Exposed=Worker]).

like image 115
nhiroki Avatar answered Sep 19 '22 19:09

nhiroki