mdn / content

The content behind MDN Web Docs
https://developer.mozilla.org
Other
9.19k stars 22.48k forks source link

Consider remove `MediaTrackSupportedConstraints` `MediaTrackSettings` `MediaTrackConstraints` directionary #30961

Open skyclouds2001 opened 11 months ago

skyclouds2001 commented 11 months ago

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Media_Capture_and_Streams_API

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

the MediaTrackSupportedConstraints dictionary is only used by MediaDevices.getSupportedConstraints()

the MediaTrackConstraints dictionary is used in MediaDevices.getUserMedia() MediaStreamTrack.getConstraints() MediaStreamTrack.applyConstraints() (and MediaDevices.getDisplayMedia()), and it is different from the spec defines, which should contain a advanced property and should inherit from MediaTrackConstraintSet dictionary

the MediaTrackSettings dictionary is only used in MediaStreamTrack.getSettings()

note that its compat data also need to remove

also the API GroupData need to be updated


the MediaTrackCapabilities dictionary is already removed, which is used in InputDeviceInfo.getCapabilities() and MediaStreamTrack.getCapabilities()


note these dictionaries is extended by Screen Capture API and MediaStream Image Capture API


BCD update https://github.com/mdn/browser-compat-data/pull/21761

BCD unlink https://github.com/mdn/content/pull/32579

What did you expect to see?

as above

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

skyclouds2001 commented 11 months ago

MediaTrackConstraints dictionary is used in MediaDevices.getUserMedia() MediaStreamTrack.getConstraints() MediaStreamTrack.applyConstraints(), and is different from the spec defines, which should contain a advanced member and should inherit from MediaTrackConstraintSet dictionary

MediaTrackSettings dictionary is only used in MediaStreamTrack.getSettings()

skyclouds2001 commented 11 months ago

MediaTrackCapabilities already removed, is used in InputDeviceInfo.getCapabilities() MediaStreamTrack.getCapabilities()

bsmth commented 7 months ago

@hamishwillee do you have any opinions on this one? I would love to know what you think.

hamishwillee commented 7 months ago

Yes, at high level this makes sense, and BCD is already heading this way.

The devil is in the detail - but I think most of that problematic detail is in BCD

So yes, I would start merging the dictionaries wherever possible into the objects that use them. Then cross add notes back to the BCD issue indicating which ones are done so that it can all merge at a similar time.

@skyclouds2001 Are you interested in/planning on doing this docs work?