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(preload): Set manifest before initializing DRM #7359

Merged
merged 5 commits into from
Sep 25, 2024

Conversation

theodab
Copy link
Contributor

@theodab theodab commented Sep 24, 2024

Previously, there were situations where, when handling trackschanged events, the manifest would not yet have been
copied from the preload manager to the player. This would prevent developers from properly handling those events.

This PR changes the order of operations slightly, such that the manifest is copied over earlier.

@theodab theodab added the type: bug Something isn't working correctly label Sep 24, 2024
@theodab theodab requested a review from tykus160 September 24, 2024 08:47
@theodab theodab marked this pull request as draft September 24, 2024 08:48
@avelad
Copy link
Member

avelad commented Sep 24, 2024

@shaka-bot test

@shaka-bot
Copy link
Collaborator

@avelad: Lab tests started with arguments:

  • pr=7359

@shaka-bot
Copy link
Collaborator

shaka-bot commented Sep 24, 2024

Incremental code coverage: 100.00%

@theodab

This comment was marked as resolved.

@theodab theodab marked this pull request as ready for review September 24, 2024 09:51
lib/media/preload_manager.js Show resolved Hide resolved
lib/player.js Outdated
Comment on lines 1704 to 1708
const promises = [
preloadManager.waitForFinish(),
preloadManager.waitForManifest(),
];
await Promise.race(promises);
Copy link
Member

Choose a reason for hiding this comment

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

I wonder couldn't we reject manifest promise when an error occurs or is it not enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was doing that at first, but that was what was causing the test failures, I believe.

Copy link
Member

@tykus160 tykus160 Sep 24, 2024

Choose a reason for hiding this comment

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

Maybe this race should be moved to waitForManifest() method then?

Copy link
Member

Choose a reason for hiding this comment

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

I tend to agree. Let's move it, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, trying that out.

@avelad avelad added the priority: P2 Smaller impact or easy workaround label Sep 24, 2024
@avelad avelad added this to the v4.12 milestone Sep 24, 2024
Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

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

This looks fine to me, but:

  1. I'd like @tykus160 to approve
  2. I'd like a PR description explaining why this is important to do in this order (e.g. what goes wrong if we don't, what benefit we get from this, etc)

@theodab
Copy link
Contributor Author

theodab commented Sep 24, 2024

This looks fine to me, but:

  1. I'd like @tykus160 to approve
  2. I'd like a PR description explaining why this is important to do in this order (e.g. what goes wrong if we don't, what benefit we get from this, etc)

Okay, I've added a description.

Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

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

Great, thanks! If there's an issue number associated, please add it. Otherwise, feel free to merge.

@theodab theodab merged commit b9ba66f into shaka-project:main Sep 25, 2024
15 of 16 checks passed
@theodab theodab deleted the preloadManifestBranch branch September 25, 2024 06:27
avelad pushed a commit that referenced this pull request Sep 25, 2024
Previously, there were situations where, when handling `trackschanged` events, the manifest would not yet have been
copied from the preload manager to the player. This would prevent developers from properly handling those events.

This PR changes the order of operations slightly, such that the manifest is copied over earlier.
avelad pushed a commit that referenced this pull request Sep 25, 2024
Previously, there were situations where, when handling `trackschanged` events, the manifest would not yet have been
copied from the preload manager to the player. This would prevent developers from properly handling those events.

This PR changes the order of operations slightly, such that the manifest is copied over earlier.
joeyparrish pushed a commit that referenced this pull request Sep 26, 2024
Previously, there were situations where, when handling `trackschanged` events, the manifest would not yet have been
copied from the preload manager to the player. This would prevent developers from properly handling those events.

This PR changes the order of operations slightly, such that the manifest is copied over earlier.

Backported to v4.9.x
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Nov 24, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Nov 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants