-
Notifications
You must be signed in to change notification settings - Fork 22.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new screen capture constraints and options #22733
Changes from 1 commit
7c129ee
79fb868
41f5a55
cb5fef8
1d9639c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,13 +27,19 @@ this is unnecessary since browsers will ignore any constraints they're unfamilia | |||||
|
||||||
## Value | ||||||
|
||||||
`true`/`false`, or a [`ConstrainBoolean`](/en-US/docs/Web/API/MediaTrackConstraints#constrainboolean) object. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This confused me because "
Suggested change
? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, that is a bit less confusing. Updated. |
||||||
|
||||||
If this value is a simple `true` or `false`, the user agent will | ||||||
attempt to obtain media with local audio playback enabled or disabled as specified, if | ||||||
possible, but will not fail if this can't be done. If, instead, the value is given as an | ||||||
object with an `exact` field, that field's Boolean value indicates a required | ||||||
setting for the noise suppression feature; if it can't be met, then the request will | ||||||
possible, but will not fail if this can't be done. | ||||||
|
||||||
If, instead, the value is given as a [`ConstrainBoolean`](/en-US/docs/Web/API/MediaTrackConstraints#constrainboolean) object | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. It is always "given as a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated wording to suit. |
||||||
object with an `ideal` field, that field's Boolean value indicates an ideal | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||||||
setting for the local audio playback suppression feature; if it can't be met, then the request will | ||||||
result in an error. | ||||||
|
||||||
`exact` values are not permitted in constraints used in {{domxref("MediaDevices.getDisplayMedia()")}} calls, but they are in constraints used in {{domxref("MediaStreamTrack.applyConstraints()")}} calls. | ||||||
|
||||||
## Examples | ||||||
|
||||||
See {{SectionOnPage("/en-US/docs/Web/API/Media_Capture_and_Streams_API/Constraints", "Example: Constraint exerciser")}} for an example. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are deprecating There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But also this didn't seem to include an example of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. macro removed. I've also updated the example section to include a one-line example, |
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,15 +109,18 @@ This allows the user total freedom to select whatever they want, within the limi | |
```js | ||
const gdmOptions = { | ||
video: { | ||
cursor: "always" | ||
cursor: "always", | ||
displaySurface: "window" | ||
}, | ||
audio: { | ||
echoCancellation: true, | ||
noiseSuppression: true, | ||
sampleRate: 44100 | ||
suppressLocalAudioPlayback: true | ||
}, | ||
surfaceSwitching: true, | ||
selfBrowserSurface: false | ||
surfaceSwitching: "include", | ||
selfBrowserSurface: "exclude", | ||
systemAudio: "exclude" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to update the explanation text as well then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point; explanation updated. |
||
} | ||
``` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure which non-content backdrop appears in a single window?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point; I've changed it so that it only applies to a fullscreen/monitor capture.