Skip to content

Commit

Permalink
getUserMedia() | remove from GroupData & update exception section (#3…
Browse files Browse the repository at this point in the history
…1372)

* remove extra method

* style fix

* update exception section

* revert

* Update files/en-us/web/api/mediadevices/getusermedia/index.md

---------

Co-authored-by: Jean-Yves Perrier <[email protected]>
  • Loading branch information
skyclouds2001 and teoli2003 authored Dec 28, 2023
1 parent a3a5840 commit b2ddaae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
26 changes: 13 additions & 13 deletions files/en-us/web/api/mediadevices/getusermedia/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ browser-compat: api.MediaDevices.getUserMedia

{{securecontext_header}}{{APIRef("Media Capture and Streams")}}

The {{domxref("MediaDevices")}}**`.getUserMedia()`** method prompts the user for permission to use a media input which produces a {{domxref("MediaStream")}} with tracks containing the requested types of media.
The **`getUserMedia()`** method of the {{domxref("MediaDevices")}} interface prompts the user for permission to use a media input which produces a {{domxref("MediaStream")}} with tracks containing the requested types of media.

That stream can include, for example, a video track (produced by either a hardware or virtual video source such as a camera, video recording device, screen sharing service, and so forth), an audio track (similarly, produced by a physical or virtual audio source like a microphone, A/D converter, or the like), and possibly other track types.

Expand Down Expand Up @@ -55,6 +55,10 @@ object when the requested media has successfully been obtained.
and no hardware issues occurred that would cause a `NotReadableError` {{domxref("DOMException")}}, throw if some
problem occurred which prevented the device from being used.

- `InvalidStateError` {{domxref("DOMException")}}

- : Thrown if current document is not fully active.

- `NotAllowedError` {{domxref("DOMException")}}

- : Thrown if one or more of the requested source devices cannot be used at this time. This will
Expand Down Expand Up @@ -145,8 +149,7 @@ is over.

### Security

There are a number of ways security management and controls in a {{Glossary("user
agent")}} can cause `getUserMedia()` to return a security-related error.
There are a number of ways security management and controls in a {{Glossary("user agent")}} can cause `getUserMedia()` to return a security-related error.

#### Permissions Policy

Expand Down Expand Up @@ -432,13 +435,10 @@ const constraints = {

## See also

- The older {{domxref("navigator.getUserMedia()")}} legacy API
- {{domxref("mediaDevices.enumerateDevices()")}}: Listing available media devices
- [WebRTC API](/en-US/docs/Web/API/WebRTC_API)
- [Media Capture and Streams API (Media Streams)](/en-US/docs/Web/API/Media_Capture_and_Streams_API)
- [Screen Capture API](/en-US/docs/Web/API/Screen_Capture_API): Capturing
screen contents as a {{domxref("MediaStream")}}
- {{domxref("mediaDevices.getDisplayMedia()")}}: Getting a stream containing screen
contents
- [Taking webcam photos](/en-US/docs/Web/API/Media_Capture_and_Streams_API/Taking_still_photos): A tutorial on using `getUserMedia()` to take still photos
rather than video
- The older {{domxref("Navigator.getUserMedia()")}} legacy API
- {{domxref("MediaDevices.enumerateDevices()")}}: Listing available media devices
- {{domxref("WebRTC API", "", "", "nocode")}}
- {{domxref("Media Capture and Streams API", "", "", "nocode")}}
- {{domxref("Screen Capture API", "", "", "nocode")}}: Capturing screen contents as a {{domxref("MediaStream")}}
- {{domxref("MediaDevices.getDisplayMedia()")}}: Getting a stream containing screen contents
- {{domxref("Media Capture and Streams API/Taking Still Photos", "Taking webcam photos", "", "nocode")}}: A tutorial on using `getUserMedia()` to take still photos rather than video
5 changes: 1 addition & 4 deletions files/jsondata/GroupData.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,10 +905,7 @@
"MediaTrackSettings",
"MediaTrackSupportedConstraints"
],
"methods": [
"HTMLCanvasElement.captureStream()",
"MediaDevices.getUserMedia()"
],
"methods": ["HTMLCanvasElement.captureStream()"],
"properties": ["Navigator.mediaDevices"],
"events": ["HTMLMediaElement: ended", "HTMLMediaElement: ratechange"]
},
Expand Down

0 comments on commit b2ddaae

Please sign in to comment.