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

MediaKeys.getStatusForPolicy() docs #34236

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hamishwillee
Copy link
Collaborator

This documents MediaKeys.getStatusForPolicy() which is newly supported in FF128.

Related docs work can be tracked in #33980

@hamishwillee hamishwillee requested a review from a team as a code owner June 18, 2024 02:52
@hamishwillee hamishwillee requested review from wbamberg and removed request for a team June 18, 2024 02:52
@github-actions github-actions bot added Content:WebAPI Web API docs size/m 51-500 LoC changed labels Jun 18, 2024
Copy link
Contributor

github-actions bot commented Jun 18, 2024

Preview URLs

External URLs (1)

URL: /en-US/docs/Web/API/MediaKeys/getStatusForPolicy
Title: MediaKeys: getStatusForPolicy() method

(comment last updated: 2024-06-18 04:48:36)

}
```

```js
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This config results in output-restricted. I would have liked to find one that was usable as well but don't know how.

- {{domxref("MediaKeys.setServerCertificate()")}}
- : Returns a {{jsxref("Promise")}} to a server certificate to be used to encrypt messages to the license server.

## Examples

### Check if keys are usable with HDCP restriction
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just copied example to the top level from the new MediaKeys.getStatusForPolicy() doc. We should have other examples here, but out of scope for me.

@@ -25,7 +25,31 @@ get(key)

### Return value

The value associated with the given key, or `undefined`.
A string specifying the status value associated with the given key, or `undefined`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note, added the values as per MediaKeys.getStatusForPolicy() (the set of allow status for keys are defined in an enum, which is used in both places).


The policy restrictions currently only include a restriction on the minimum supported HDCP version.

Note that the method checks a "hypothetical key" against the restrictions.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI, this, and the example, are a modified form of stuff from https://developer.chrome.com/blog/media-updates-in-chrome-69/
It's much the same API repackaged in a new standard.
The point here is that this is an easy way of checking whether the key can be used, without having to get a key.

string identifying the key system being used.
The **`keySystem`** read-only property of the {{domxref("MediaKeySystemAccess")}} interface returns a string identifying the key system being used.

This is the value that was passed to {{domxref("Navigator.requestMediaKeySystemAccess()")}} when system access is requested.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just did this update in passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant