Why is getUserMedia throwing a [object NavigatorUserMediaError] when I click “Allow” in Chrome?

前端 未结 4 1880
时光取名叫无心
时光取名叫无心 2021-01-11 21:06

Recently, I started getting errors when trying to access the client\'s mic through my website. When Chrome asks whether to allow the site to access the user\'s microphone, <

4条回答
  •  猫巷女王i
    2021-01-11 22:10

    getUserMedia only works on https; no exception for localhost (i.e http://localhost). Safari also does not ever seem to allow getUserMedia from within an iFrame. I always get a “Trying to call getUserMedia from a document with a different security origin than its top-level frame” error. This makes using sites like codepen and jsfiddle impossible.

    More detials https://webrtchacks.com/safari-webrtc/

提交回复
热议问题