w3c / media-capabilities

Media Capabilities API
https://w3c.github.io/media-capabilities/
Other
77 stars 33 forks source link

clarify which dictionary members are valid in context of encoding/decoding and type #187

Closed chcunningham closed 2 years ago

chcunningham commented 2 years ago

MC was initially designed for MSE and file decoding (and mostly that's what folks have shipped). The spec has since grown to include webrtc, but many dictionary members only apply in the original MSE / file decoding contexts (for now). We should clarify that in the spec and maybe throw TypeError (or at least log a warning) if folks provide a member that isn't valid in the given context.

Here's my quick analysis of existing dictionary members:

Video

Audio

KeySystemConfig (was #166)

Aside: some of these things may be at-risk for dropping entirely.

chcunningham commented 2 years ago

@aboba @drkron @jan-ivar to opine on validity for rtc and behavior (ignore, error, ...) when invalid combinations are provided.

chcunningham commented 2 years ago

re: invalid behavior, I propose we throw a TypeError. The alternative of ignoring invalid inputs seems less learnable for authors.

@drkron, FYI - I think this is something we should spec and implement w/ shipping of encodingInfo(). Please feel free to take the lead.

drkron commented 2 years ago

I'm now back from holiday and catching up on ongoing issues.

I think that TypeError sounds good. I can create a PR for this once the fix for spatialScalabilty lands.

What do you think of just specifying when it's applicable for each member?

chcunningham commented 2 years ago

What do you think of just specifying when it's applicable for each member?

SGTM. If not applicable -> TypeError