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

Add preferManagedMediaSource API.md doc entry for ManagedMediaSource usage #5828

Merged
merged 2 commits into from Sep 20, 2023

Conversation

robwalch
Copy link
Collaborator

This PR will...

  • Add preferManagedMediaSource API.md doc entry
  • Only emit BUFFER_FLUSHED with removed ranges in ManagedMediaSource "bufferedchange" event

Why is this Pull Request needed?

ManagedMediaSource dispatches "bufferedchange" on append and when ejecting media independent of appends. The event includes removedRanges when media is ejected from the buffer.

Are there any points in the code the reviewer needs to double check?

Resolves issues:

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

…_FLUSHED with removed ranges in ManagedMediaSource "bufferedchange" event
@robwalch robwalch added this to the 1.5.0 milestone Sep 16, 2023
docs/API.md Show resolved Hide resolved
'bufferedchange',
(type: SourceBufferName, event: Event) => {
// If media was ejected check for a change. Added ranges are redundant with changes on 'updateend' event.
const removedRanges = (event as any).removedRanges;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have types for events so it won't be just any?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @OrenMe! Added an interface definition for the event based on the proposal: bc68a10

This event handler and BUFFER_FLUSHED trigger is primarily for internal book-keeping. The stream controllers use it to detect evicted fragments.

@robwalch
Copy link
Collaborator Author

Related to #5542

@robwalch robwalch merged commit 7c5a2d2 into master Sep 20, 2023
15 of 16 checks passed
@robwalch robwalch deleted the feature/managed-media-preference branch September 20, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants