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

fix: Avoid duplicate calls to decodingInfo() #43

Merged
merged 4 commits into from
Jun 7, 2022

Conversation

joeyparrish
Copy link
Member

@joeyparrish joeyparrish commented Jun 2, 2022

In probeDecodingInfo_(), if navigator.mediaCapabilities returns the decodingInfo results but has no keySystemAccess information for encrypted content, we can call navigator.requestMediaKeySystemAccess to patch the keySystemAccess information.

This avoids a few unnecessary calls of decodingInfo.

Built on abandoned PR #19 by @michellezhuogg

if (!mediaKeySystemAccess) {
capabilities.keySystemAccess =
await McEncryptionSchemePolyfill.getMediaKeySystemAccess_(
requestedConfiguration);
Copy link

Choose a reason for hiding this comment

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

This case could use a comment. Something to explain that this is avoiding unnecessary calls to the original decodingInfo calls, by doing the only remaining thing the polyfill would need to do in this situation, perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added comments here, and reworded others to try to clarify things. PTAL!

@joeyparrish joeyparrish merged commit fafd1dd into shaka-project:main Jun 7, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
@joeyparrish joeyparrish deleted the dedup-decoding-info branch May 14, 2024 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants