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

Create window.shakaMediaCapabilities to allow override MediaCapabilities in Apple browsers #3668

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

avelad
Copy link
Member

@avelad avelad commented Sep 28, 2021

Close: #3530

@avelad avelad changed the title Create window.shakaMediaCapabilities to allow override MediaCapabilit… Create window.shakaMediaCapabilities to allow override MediaCapabilities in Apple browsers Sep 28, 2021
shaka.polyfill.MediaCapabilities.decodingInfo_;
// Workaround because in Apple browsers there is no way to overwrite
// MediaCapabilities.
window.shakaMediaCapabilities = navigator.mediaCapabilities;
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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.)

Copy link
Member

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)

@joeyparrish
Copy link
Member

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.

@shaka-bot
Copy link
Collaborator

All tests passed!

@joeyparrish joeyparrish merged commit 31c0cd4 into shaka-project:master Oct 12, 2021
@joeyparrish
Copy link
Member

This will ship in v3.2.1 this week.

joeyparrish pushed a commit that referenced this pull request Oct 12, 2021
joeyparrish pushed a commit that referenced this pull request Oct 12, 2021
…sers (#3668)

See also #3696

Closes #3530

Change-Id: Ied2e644f8a5d170ef70386dc2a39b51fc95a691f
@avelad avelad deleted the shaka-media-capabilities branch October 13, 2021 06:00
shaka-bot pushed a commit that referenced this pull request Jan 11, 2022
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)

Change-Id: Ib5aff1b38759e1a39200332f3f07d3d6bd3bd2e1
joeyparrish added a commit that referenced this pull request Jan 11, 2022
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)

Change-Id: Ib5aff1b38759e1a39200332f3f07d3d6bd3bd2e1
joeyparrish added a commit that referenced this pull request Jan 11, 2022
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)

Change-Id: Ib5aff1b38759e1a39200332f3f07d3d6bd3bd2e1
joeyparrish added a commit that referenced this pull request Jan 28, 2022
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
tecteun pushed a commit to tecteun/shaka-player that referenced this pull request Feb 10, 2022
tecteun pushed a commit to tecteun/shaka-player that referenced this pull request Feb 10, 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
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.

FairPlay playback broken in 3.2
4 participants