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

✨ [Story video] Run sortSources/load only if hasLowerBitrate #33065

Merged
merged 10 commits into from
Mar 25, 2021

Conversation

mszylkowski
Copy link
Contributor

Closes #32731

Do not call sortSources or load if the video doesn't have a lower bitrate video.
This applies to updateOtherManagedAndPausedVideo since the other calls to sortSources already check for lower bitrates before sorting

@mszylkowski mszylkowski self-assigned this Mar 4, 2021
@mszylkowski mszylkowski changed the title ✨ [Story video] Hide sortSources behind hasLowerBitrate ✨ [Story video] Run sortSources only if hasLowerBitrate Mar 4, 2021
@mszylkowski mszylkowski changed the title ✨ [Story video] Run sortSources only if hasLowerBitrate ✨ [Story video] Run sortSources/load only if hasLowerBitrate Mar 5, 2021
Copy link
Contributor

@gmajoulet gmajoulet left a comment

Choose a reason for hiding this comment

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

Can you add unit tests?

extensions/amp-video/0.1/flexible-bitrate.js Outdated Show resolved Hide resolved
extensions/amp-video/0.1/flexible-bitrate.js Outdated Show resolved Hide resolved
extensions/amp-video/0.1/flexible-bitrate.js Show resolved Hide resolved
extensions/amp-video/0.1/flexible-bitrate.js Outdated Show resolved Hide resolved
extensions/amp-video/0.1/test/test-flexible-bitrate.js Outdated Show resolved Hide resolved
@mszylkowski mszylkowski merged commit 74f2878 into ampproject:master Mar 25, 2021
@mszylkowski mszylkowski deleted the ampvideo_sortnoop branch March 25, 2021 17:53
rochapablo pushed a commit to rochapablo/amphtml that referenced this pull request Aug 30, 2021
…ect#33065)

* Hide sortSources behind hasLowerBitrate

* Fix call

* Added test

* Run flexible-bitrate

* Updated codestyle for comments

* Added test for not loading

* Linted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Story video] Don't call load() if sortSources was a noop
3 participants