Skip to content

Commit 6e7d87b

Browse files
chrisdavidmillsbeaufortfrancoisElchi3
authored
Editorial review: add getDisplayMedia() windowAudio option (#41440)
* add getDisplayMedia() windowAudio option * Update files/en-us/web/api/mediadevices/getdisplaymedia/index.md Co-authored-by: François Beaufort <[email protected]> * Update files/en-us/web/api/mediadevices/getdisplaymedia/index.md Co-authored-by: Florian Scholz <[email protected]> --------- Co-authored-by: François Beaufort <[email protected]> Co-authored-by: Florian Scholz <[email protected]>
1 parent 0eff6ca commit 6e7d87b

File tree

1 file changed

+23
-12
lines changed
  • files/en-us/web/api/mediadevices/getdisplaymedia

1 file changed

+23
-12
lines changed

files/en-us/web/api/mediadevices/getdisplaymedia/index.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ getDisplayMedia(options)
2424
### Parameters
2525

2626
- `options` {{optional_inline}}
27-
- : An optional object specifying requirements for the returned {{domxref("MediaStream")}}.
27+
- : An object specifying requirements for the returned {{domxref("MediaStream")}}.
2828
The options for `getDisplayMedia()` work in the same as the [constraints](/en-US/docs/Web/API/MediaDevices/getUserMedia#parameters) for the {{domxref("MediaDevices.getUserMedia()")}} method, although in that case only `audio` and `video` can be specified.
2929
The list of possible option properties for `getDisplayMedia()` is as follows:
3030
- `video` {{optional_inline}}
@@ -39,32 +39,43 @@ getDisplayMedia(options)
3939
- `monitorTypeSurfaces` {{Experimental_Inline}} {{optional_inline}}
4040
- : An enumerated value specifying whether the browser should offer entire screens in the screen capture options presented to the user alongside tab and window options.
4141
This option is intended to protect companies from leakage of private information through employee error when using video conferencing apps.
42-
Possible values are `include`, which hints that the browser should include screen options, and `exclude`, which hints that they should be excluded.
43-
A default value is not mandated by the spec; see the [Browser compatibility](#browser_compatibility) section for browser-specific defaults.
42+
Possible values are:
43+
- `include`: Hints that the browser should include screen options.
44+
- `exclude`: Hints that screen options should be excluded.
4445

4546
> [!NOTE]
4647
> You cannot set `monitorTypeSurfaces: "exclude"` at the same time as [`displaySurface: "monitor"`](/en-US/docs/Web/API/MediaTrackConstraints/displaySurface) as the two settings are contradictory.
4748
> Trying to do so will result in the `getDisplayMedia()` call failing with a `TypeError`.
4849
4950
- `preferCurrentTab` {{non-standard_inline}} {{Experimental_Inline}} {{optional_inline}}
50-
- : A boolean; a value of `true` instructs the browser to offer the current tab as the most prominent capture source, i.e., as a separate "This Tab" option in the "Choose what to share" options presented to the user.
51+
- : A boolean; a value of `true` instructs the browser to offer the current tab as the most prominent capture source, that is, as a separate "This Tab" option in the "Choose what to share" options presented to the user.
5152
This is useful as many app types generally just want to share the current tab.
5253
For example, a slide deck app might want to let the user stream the current tab containing the presentation to a virtual conference.
53-
A default value is not mandated by the spec; see the [Browser compatibility](#browser_compatibility) section for browser-specific defaults.
5454
- `selfBrowserSurface` {{Experimental_Inline}} {{optional_inline}}
5555
- : An enumerated value specifying whether the browser should allow the user to select the current tab for capture.
5656
This helps to avoid the "infinite hall of mirrors" effect experienced when a video conferencing app inadvertently shares its own display.
57-
Possible values are `include`, which hints that the browser should include the current tab in the choices offered for capture, and `exclude`, which hints that it should be excluded.
58-
A default value is not mandated by the spec; see the [Browser compatibility](#browser_compatibility) section for browser-specific defaults.
57+
Possible values are:
58+
- `include`: Hints that the browser should include the current tab in the choices offered for capture.
59+
- `exclude`: Hints that the current tab should be excluded from the choices.
5960
- `surfaceSwitching` {{Experimental_Inline}} {{optional_inline}}
6061
- : An enumerated value specifying whether the browser should display a control to allow the user to dynamically switch the shared tab during screen-sharing.
61-
This is much more convenient than having to go through the whole sharing process again each time a user wants to switch the shared tab.
62-
Possible values are `include`, which hints that the browser should include the control, and `exclude`, which hints that it should not be shown.
63-
A default value is not mandated by the spec; see the [Browser compatibility](#browser_compatibility) section for browser-specific defaults.
62+
This is more convenient than having to go through the whole sharing process again each time a user wants to switch the shared tab.
63+
Possible values are:
64+
- `include`: Hints that the browser should include the control.
65+
- `exclude`: Hints that the control should not be shown.
6466
- `systemAudio` {{Experimental_Inline}} {{optional_inline}}
6567
- : An enumerated value specifying whether the browser should include the system audio among the possible audio sources offered to the user.
66-
Possible values are `include`, which hints that the browser should include the system audio in the list of choices, and `exclude`, which hints that it should be excluded.
67-
A default value is not mandated by the spec; see the [Browser compatibility](#browser_compatibility) section for browser-specific defaults.
68+
Possible values are:
69+
- `include`: Hints that the browser should include the system audio in the list of choices.
70+
- `exclude`: Hints that system audio should be excluded from the choices shown.
71+
- `windowAudio` {{Experimental_Inline}} {{optional_inline}}
72+
- : An enumerated value that hints to the browser what audio sharing option the user should be presented with alongside window sharing options. Possible values are:
73+
- `exclude`: Hints that audio should not be shareable when a window sharing option is chosen.
74+
- `window`: Hints that when a window sharing option is chosen, only audio originating from that window should be shared.
75+
- `system`: Hints that when a window sharing option is chosen, all system audio should be shared.
76+
77+
> [!NOTE]
78+
> For most of these options, a default value is not mandated by the spec. For standalone options, where a default is not mentioned, see the [Browser compatibility](#browser_compatibility) section for browser-specific defaults.
6879
6980
> [!NOTE]
7081
> See the article [Capabilities, constraints, and settings](/en-US/docs/Web/API/Media_Capture_and_Streams_API/Constraints) for a lot more detail on how these options work.

0 commit comments

Comments
 (0)