This function seems to expect document and window globals to exist, giving a runtime error when called in a web worker. As far as I know, webrtc support does not exist within a worker, so a simple fix is to check if document and window exist, and if not then return false for all relevant booleans.
This function seems to expect document and window globals to exist, giving a runtime error when called in a web worker. As far as I know, webrtc support does not exist within a worker, so a simple fix is to check if document and window exist, and if not then return false for all relevant booleans.