Skip to content

Align getCapabilities() documentation with JavaScript runtime behavior #39259

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

low-perry
Copy link
Contributor

Description

As pointed out by #38249 the objects presented as the properties of the return value of the getCapabilities(), method were wrong. I removed that abstraction all together and mapped the properties to the actual runtime behavior developers see in JavaScript. There’s no need to introduce abstract or specialized types like "UDoubleRange" that might make developers think they’re dealing with a built-in, complex data type. This reduces unnecessary cognitive overhead.

Motivation

Additional details

Related issues and pull requests

Fixes #38249

@low-perry low-perry requested a review from a team as a code owner April 24, 2025 01:49
@low-perry low-perry requested review from sideshowbarker and removed request for a team April 24, 2025 01:49
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Apr 24, 2025
low-perry and others added 3 commits April 24, 2025 03:50
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Apr 24, 2025

Preview URLs

(comment last updated: 2025-04-24 13:30:29)

@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/m [PR only] 51-500 LoC changed labels Apr 24, 2025
- `autoGainControl`
- : A [`ConstrainBoolean`](/en-US/docs/Web/API/MediaTrackConstraints#constrainboolean) object reporting if the source can automatically control the input signal's gain.
If the feature can be controlled by a script the source will report both true and false as possible values.
- : A boolean or an array of booleans. If the device supports script-controlled toggling, you may see both `true` and `false`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see an indication in the spec that this can be a single boolean value. Neither are the other values like latency. Where is the source for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description here made me think that it can have a single boolean as a value.
The latency description here states:

The latency or latency range in seconds The latency is the time between start of processing (for instance, when sound occurs in the real world) to the data...

@github-actions github-actions bot added size/m [PR only] 51-500 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Apr 24, 2025
low-perry and others added 2 commits April 24, 2025 15:26
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@low-perry
Copy link
Contributor Author

@Josh-Cena, I added another file here to document the getCapabilities() method. I upgraded the code example because the previous one was throwing errors. Also, the properties of the MediaTrackCapabilities need to be changed here as well, but I'll wait for your review on the previous file

@low-perry low-perry requested a review from Josh-Cena April 25, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
2 participants