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: prevent bad calls to MediaSource.endOfStream #5071

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

martinstark
Copy link
Contributor

closes #5070

maybe it would make more sense to only call it when the readyState is 'open'?

@avelad avelad added type: bug Something isn't working correctly priority: P2 Smaller impact or easy workaround labels Mar 8, 2023
@avelad avelad added this to the v4.4 milestone Mar 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2023

Incremental code coverage: 100.00%

// don't call it again. Also do not call if readyState is
// 'closed' (not attached to video element) since it is not a
// valid operation.
if (this.ended() || this.mediaSource_.readyState === 'closed') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Incidentally, the ended method also checks the readyState of MS.
I considered asking you to change that instead of making the change here, but the ended method is used outside of this class so it's probably simpler to keep it as-is.

@theodab theodab merged commit 64389a2 into shaka-project:main Mar 9, 2023
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
This prevents the streaming engine from calling MediaSource.endOfStream when
media source's readyState is "closed". It's not valid to close a stream that is already closed.
See:
https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream#exceptions

Fixes #5070
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
This prevents the streaming engine from calling MediaSource.endOfStream when
media source's readyState is "closed". It's not valid to close a stream that is already closed.
See:
https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream#exceptions

Fixes #5070
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
This prevents the streaming engine from calling MediaSource.endOfStream when
media source's readyState is "closed". It's not valid to close a stream that is already closed.
See:
https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream#exceptions

Fixes #5070
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
This prevents the streaming engine from calling MediaSource.endOfStream when
media source's readyState is "closed". It's not valid to close a stream that is already closed.
See:
https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream#exceptions

Fixes #5070
@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
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.

An attempt was made to use an object that is not, or is no longer, usable
3 participants