

They must also show an indicator that permission hasīeen granted to use a device for input, even if the device is not actively recording atįor example in Firefox, the URL bar displays a pulsing red icon to indicate that Browsers are required to displayĪn indicator that shows that a camera or microphone is in use, above and beyond any Of equal importance are the rules around notification. Permission before opening any media gathering input such as a webcam or microphone.īrowsers may offer a once-per-domain permission feature, but they must ask at least theįirst time, and the user must specifically grant ongoing permission if they choose to do First, getUserMedia() must always get user Held by the specification to very specific requirements for user notification and Will never even be asked for permission to use the input devices.įor additional details on these requirements and rules, how they are reflected in theĬontext in which your code is running, and about how browsers manage user privacy andĪs an API that may involve significant privacy concerns, getUserMedia() is Grants permission for a given to do so using Permissions Policy. Permission to use getUserMedia(), unless the top-level context expressly Only a window's top-level document context for a valid origin can even request In addition, user permission is always required to access the user's audio and video Using HTTPS or the file:/// URL scheme, or a page loaded from

A secure context is, in short, a page loaded GetUserMedia() is a powerful feature that can only be used in secure contexts in insecureĬontexts, diaDevices is undefined, preventingĪccess to getUserMedia(). Specification lays out a wide array of privacy and security requirements that browsers If an object is specified for a media type, the object is read as a MediaTrackConstraints dictionary.Īs an API that may involve significant privacy concerns, getUserMedia()'s.Because both video and audio default to false, if the constraints object contains neither property or if it's not present at all, the returned promise will always reject. If false is specified for a media type, the resulting stream must not have that type of track, or the returned promise will reject.If one cannot be included for any reason, the returned promise will reject. If true is specified for a media type, the resulting stream is required to have that type of track in it.Meet the constraints given, then the returned promise is rejected withįor both video and audio, its value is either a boolean or an object. If the browser cannot find all media tracks with the specified types that The constraints parameter is an object with two members: video andĪudio, describing the media types requested. Request, along with any requirements for each type. An object specifying the types of media to
