adapter: TypeError navigator.mediaDevices is undefined, at shimGetUserMedia
Please read first!
Please use discuss-webrtc for general technical discussions and questions.
- I have provided steps to reproduce (e.g. a link to a jsfiddle)
- I have provided browser name, version and adapter.js version
- This issue only happens when adapter.js is used
Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed.
Versions affected
Browser name: Chrome Version:75.0.3770 and others, probably spoofed
adapter.js 7.5.0
Description
TypeError navigator.mediaDevices is undefined
I using sentry for handling errors:
Steps to reproduce
Is happened on real traffic
Expected results
No errors
Actual results
TypeError navigator.mediaDevices is undefined
Script stopped working because import error
import adapter from "webrtc-adapter"
import "detectrtc" // <== other lib
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 15 (8 by maintainers)
Commits related to this issue
- firefox: dont attempt to shim getUserMedia if mediaDevices is not defined since this can't work. Tentative fix for #1022 — committed to webrtcHacks/adapter by fippo 2 years ago
navigator.mediaDevices
is undefined in http. Could that be it?that sounds like chrome on ios which, being wkwebview-based didn’t have getUserMedia. Check support before using it.
that would break feature detection - if it was a good idea then the browser vendors would have done it.
I was having this error due to my app being exposed on HTTP (instead of HTTPS). Does someone agree that we should polyfill this with Promise rejections? Or is it too much out of scope? 🤔 Just having it undefined is weird!