-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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: Fix playback rate iteration if rates are not in the ascending order #7618
fix: Fix playback rate iteration if rates are not in the ascending order #7618
Conversation
… order On the playback rate button's click, the iteration over all possible rates will not happen as expected. E.g. if you follow youtube's pattern ([ 2, 1.75, 1.5, 1.25, 1, 0.75, 0.5, 0.25 ]), and click on the playback rate button it will change to 2x and you won't be able to change it anymore. Fixes videojs#7617
💖 Thanks for opening this pull request! 💖 Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
Thanks. This makes sense, but it would be good to add a test. |
Sure thing! I'll do that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the PR. Would you mind adding some tests to verify? Nevermind, saw above comment after submitting.
Hey guys! Sorry for the late reply. Just added some tests to check the playback rate iteration. |
Codecov Report
@@ Coverage Diff @@
## main #7618 +/- ##
==========================================
+ Coverage 80.24% 80.36% +0.11%
==========================================
Files 116 116
Lines 7325 7322 -3
Branches 1771 1770 -1
==========================================
+ Hits 5878 5884 +6
+ Misses 1447 1438 -9
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems solid and I tested it manually and works as advertised! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Congrats on merging your first pull request! 🎉🎉🎉 |
On the playback rate button's click, the iteration over all possible rates will not happen as expected. E.g. if you follow youtube's pattern ([ 2, 1.75, 1.5, 1.25, 1, 0.75, 0.5, 0.25 ]), and click on the playback rate button it will change to 2x and you won't be able to change it anymore.
Description
Fixes #7617
Specific Changes proposed
The iteration over the rates array are now done by the array's index.
Requirements Checklist