Media Capture and Streams - capabilities, constraints, and settings data not correctly represented
Nobody has claimed this yet.
- Dominant language
- JSON
- Stars
- 5.8k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 186
Description
What type of issue is this?
Other
What information was incorrect, unhelpful, or incomplete?
Chrome 136+ supports the MediaTrackSettings.screenPixelRatio property, on desktop only. See https://chromestatus.com/feature/6738236535472128 for details.
The thing with Media Capture and Streams is that you have these properties that can act as capabilities, constraints, and settings.
The way these have been represented historically in BCD is as sub-data items under the MediaStreamTrack.applyConstraints() method. These same data points have been used for the browser compat tables on the MediaStreamTrack.applyConstraints() page, AND on the pages under MediaTrackConstraints and MediaTrackSettings.
Possibly other places too.
This has mostly worked so far, as the properties are generally usable as constraints, capabilities, and settings. However, it doesn't work for screenPixelRatio, because it is a setting only; the spec specifically states that it is not usable as a constraint or capability. So, to represent it as api.MediaStreamTrack.applyConstraints.screenPixelRatio_constraint would make no sense whatsoever.
Ideally, IMO, we should have separate BCD objects for MediaTrackSettings and MediaTrackConstraints, especially given that we have separate MDN pages for them. The latter could also be used for the associated MediaStreamTrack.applyConstraints() method, rather than the other way round. Even without this problem I've uncovered, it is still confusing as-is.
However, the guidelines state that we shouldn't add interface-like entries for dictionaries and should instead add the features separately to all affected methods, properties, etc. (see https://github.com/mdn/browser-compat-data/blob/main/docs/data-guidelines/api.md#dictionaries-and-enumerations-enums).
This is going to be a huge pain to sort out, especially for something I was expecting to be a single data point addition, and I don't have time to figure this all out right now. I am therefore recording this issue for now, so it doesn't get forgotten about.
What browsers does this problem apply to, if applicable?
No response
What did you expect to see?
data that works
Did you test this? If so, how?
No
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
No
Do you have anything more you want to share?
No response
MDN URL
No response
MDN metadata
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review api/MediaStreamTrack.json, the MediaTrackSettings and MediaTrackConstraints pages, and docs/data-guidelines/api.md. Compare how capabilities, constraints, and settings are currently represented, using the screenPixelRatio specification as the case that exposes the problem. Done means the affected data can represent settings-only properties without presenting them as constraints or capabilities, with affected compatibility tables remaining correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- data, documentation
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100