Skip to content
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

requestMediaKeySystemAccess()'s supportedConfigurations parameter should not be optional #1

Closed
ddorwin opened this issue Dec 12, 2014 · 4 comments
Assignees

Comments

@ddorwin
Copy link
Contributor

ddorwin commented Dec 12, 2014

Currently, requestMediaKeySystemAccess() can be called with just a Key System name. However, I cannot think of a valid use case where an application should not also be providing at least a content type. There is no point in getting a MediaKeySystemAccess or MediaKeys object that cannot be used with the content. Supporting the single parameter version just adds complexity to the specification (a branch and extra algorithm) and implementations. We should make supportedConfigurations required.

@ddorwin ddorwin self-assigned this Dec 12, 2014
@heff
Copy link
Contributor

heff commented Dec 12, 2014

+1

@ddorwin
Copy link
Contributor Author

ddorwin commented Dec 13, 2014

The next questions are:

  1. Can the sequence can be empty?
  2. Can the individual dictionaries in the sequence be empty?

I think #1 should be "No." We don't allow empty sequences, arrays, or strings elsewhere in the spec.

For #2, I don't think the dictionaries can technically be empty because a few of the members have default values.

We could consider requiring values for other members, though there are legitimate reasons for them to be empty. For example, no audio or video track. Even initDataTypes could reasonably be empty if an application only wanted to load existing sessions.

Should we just require a sequence with >= 1 elements, regardless of what they contain? I think this still achieves the simplification we're looking for, but it is a bit weird that the following is valid (and the workaround to removing optional from the parameter.

navigator.requestMediaKeySystemAccess("org.w3.clearkey", [ { } ]);

@ddorwin
Copy link
Contributor Author

ddorwin commented Jan 9, 2015

The complexity of the single-parameter version also trickles down to MediaKeySystemAccess, which may return null from getConfiguration() because of this case.

@ddorwin
Copy link
Contributor Author

ddorwin commented Jan 13, 2015

As discussed in the telecon this morning, I will implement this. For now, we will allow empty dictionary(ies) (e.g. [ { } ]) because it is simpler from a spec and implementation perspective. Requiring the parameter at least means that the author has to think about this parameter (in addition to simplifying the spec and implementations as previously discussed).

ddorwin added a commit that referenced this issue Feb 9, 2015
The |supportedConfigurations| parameter is required by the fix for issue #1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants