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: fastQualitySwitch stability #1525

Merged
merged 7 commits into from
Jul 17, 2024
Merged

fix: fastQualitySwitch stability #1525

merged 7 commits into from
Jul 17, 2024

Conversation

adrums86
Copy link
Contributor

@adrums86 adrums86 commented Jul 10, 2024

Description

Currently, our fastQualitySwitch triggers a full video/main buffer clear twice. This is because we clear the buffer first with a resetEverything call on the mainSegmentLoader, then once that removal is complete we call setCurrentTime which calls resetEverything on all active segment loaders, clearing all the other buffers as well. This is causing some instability, specifically when a quality change occurs at or near a discontinuity.

Specific Changes proposed

Instead of calling setCurrentTime after a fastQualitySwitch, lets just call load on the mainSegmentLoader.
Note: There were 2 browser bugs that seemed to require a setCurrentTime call according to the comments, but after checking both URLs, those bugs seem to no longer be relevant, so we should be safe removing this part and only calling load.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.31%. Comparing base (0b4da7c) to head (8ecccc5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1525   +/-   ##
=======================================
  Coverage   86.31%   86.31%           
=======================================
  Files          43       43           
  Lines       11097    11097           
  Branches     2532     2532           
=======================================
  Hits         9578     9578           
  Misses       1519     1519           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adrums86 adrums86 marked this pull request as ready for review July 10, 2024 23:31
this.mainSegmentLoader_.pause();
this.mainSegmentLoader_.resetEverything(() => {
this.tech_.setCurrentTime(this.tech_.currentTime());
this.mainSegmentLoader_.load();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to load other loaders here?

Copy link
Contributor Author

@adrums86 adrums86 Jul 16, 2024

Choose a reason for hiding this comment

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

I don't think it's necessary, the only reason load was previously called on all the loaders was due to setCurrentTime calling pause then resetEverything on all the loaders, including the mainSegmentLoader a second time.

this.mainSegmentLoader_.pause();

@adrums86 adrums86 merged commit 28cb9fd into main Jul 17, 2024
15 checks passed
@adrums86 adrums86 deleted the fix-fastQualitySwitch branch July 17, 2024 05:28
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.

3 participants