-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Create window.shakaMediaCapabilities to allow override MediaCapabilities in Apple browsers #3668
Create window.shakaMediaCapabilities to allow override MediaCapabilities in Apple browsers #3668
Conversation
…ies in Apple browsers
shaka.polyfill.MediaCapabilities.decodingInfo_; | ||
// Workaround because in Apple browsers there is no way to overwrite | ||
// MediaCapabilities. | ||
window.shakaMediaCapabilities = navigator.mediaCapabilities; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works, doesn't that imply that setting the value above on line 44 was successful? That would seem to contradict the need for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I recall, when I last looked into this issue it looked like what was happening was that navigator.mediaCapabilities
was being set successfully, but then being reset to the default value in some later stage of loading... I wasn't able to quite figure out what was resetting it, though.
Storing it into a custom variable would let us work around it being reset, basically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all polyfills are now exported, it seems appropriate to keep this. Also this works if called at a later stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to experiment a little to see if I can understand the root cause before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not able to reproduce this yet with DASH content. Does the MCap polyfill only get replaced if I play FairPlay content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the content you sent us via email, I am still unable to reproduce the issue. (Safari 14.1.1) I see MediaCapabilities negotiating successfully and instantiating a FairPlay CDM. (The license request fails with an HTTP 500 error, but at least MCap is successful.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move conversation to #3530 (comment)
I still can't reproduce this, and I am concerned that this is just a workaround and that we haven't identified the root cause. That said, I think we let this sit too long, and we should apply the workaround and come back later to try to identify and address the root cause. I'm going to run tests and merge it now, and file a new issue to investigate the root cause of our polyfill being overwritten on Safari. |
All tests passed! |
This will ship in v3.2.1 this week. |
Revert "fix: Work around override of MediaCapabilities polyfill in Apple browsers (#3668)" This reverts commit 31c0cd4. Fixes #3843 (usage of Shaka without polyfills) Re-opens #3530 (MediaCapabilities polyfill not working on Safari) Backported to v3.1.x Change-Id: Ib5aff1b38759e1a39200332f3f07d3d6bd3bd2e1
…sers (shaka-project#3668) See also shaka-project#3696 Closes shaka-project#3530 Change-Id: Ied2e644f8a5d170ef70386dc2a39b51fc95a691f
…sers (shaka-project#3668) See also shaka-project#3696 Closes shaka-project#3530 Change-Id: Ied2e644f8a5d170ef70386dc2a39b51fc95a691f
Close: #3530