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

Micro draft of getSupportedTypes() #64

Closed
wants to merge 10 commits into from

Conversation

yellowdoge
Copy link
Member

@foolip can you take a look at the proposed method and let me know what you think, if it's pro forma etc?

Also, can a function be static and return a Promise<> ? :)

Relates to #59.

@foolip
Copy link
Member

foolip commented Jul 21, 2016

Static methods can return promises, here are two examples I found by grepping Blink:
https://notifications.spec.whatwg.org/#dom-notification-requestpermission
https://w3c.github.io/webrtc-pc/#sec.cert-mgmt

However, in this case it seems odd that you can synchronously ask if a type is supported, but asking for the supported types is async. What kind of implementation would actually have this restriction? In other words, can't getSupportedTypes also be sync?

@yellowdoge
Copy link
Member Author

getSupportedTypes() might need to check which codecs are/can be e.g. hardware accelerated, whereas isTypeSupported() can answer questions more easily (checking on a list, essentially).

An example: H264 is supported in Chrome/Blink in all cases in Sw and, for certain platforms and hardware configurations, by a encode accelerator. isTypeSupported() knows is supported, whereas getSupportedTypes() might need to dig into lower levels of the implementation for to bump up this format in the list.

so that MIME types closer to the beginning have a larger probability
of being supported by encode accelerators.
<div>
<em>Return type:</em> <code>sequence&lt;DOMString&gt;</code>
Copy link
Member

Choose a reason for hiding this comment

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

It returns a promise, not a sequence directly. Wording more in the style of https://notifications.spec.whatwg.org/#dom-notification-requestpermission would be nice :)

@foolip
Copy link
Member

foolip commented Jul 21, 2016

Ah, the order tells you additional information, I didn't read very carefully. It makes sense, concept LGTM.

@foolip
Copy link
Member

foolip commented Jul 21, 2016

BTW, do you have someone to more carefully review spec changes, or am I it here?

@yellowdoge
Copy link
Member Author

Too many rebases :)
Will close this PR and open another fresh one.

@yellowdoge yellowdoge closed this Jul 28, 2016
@yellowdoge yellowdoge mentioned this pull request Jul 28, 2016
@yellowdoge yellowdoge deleted the getSupportedTypes branch July 28, 2016 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants