-
Notifications
You must be signed in to change notification settings - Fork 888
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 consecutive sponsor segments not being skipped. #4886
Conversation
Regardless of whether a dependency already exists in That being said the rest of FreeTube, even in the same file that you edited, manages completely fine without the |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
I also have a change pending to swap out the for loop in https://status.sponsor.ajay.app/ |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Found a video with consecutive sponsor segments |
Ah sorry yeah I was testing using this one https://youtu.be/5ghgTIBzuRA - it has an intro -> recap/preview -> sponsor at the start. There's also some extra examples in the linked issue #3534 |
Hi @RyanHx Thankyou for addressing this issue. Unfortunately i have to close this PR because there is a Player migration coming up. The part you addressed has/will be refactored in the player migration. We hope this wont discourage you to look into other issues as you did a wonderful job on this one :) |
Pull request was closed
@efb4f5ff-1298-471a-8973-3d47447115dc I look forward to the new player, but is it not worth just getting this fix through in the meantime? It's a 1 year old bug that I often run into myself 😭 |
I understand and share your frustration as I am the one that opened that bug report but it isnt worth it to fix and then refactor your code again |
I figured if it's already in the works it'd just require a rebase onto this, but fair enough. |
Fix consecutive sponsor segments not being skipped
Pull Request Type
Related issue
closes #3534
Description
Changed the implementation of sponsors auto skip. It instead relies on the
mousedown
event on the player's seekbar to detect manual seeking via user input, meaning sponsor segments can now be safely skipped consecutively. I also added a listener for the keyboard hotkeys used for seeking, to prevent auto skipping when moving into a sponsored segment that way. These event listeners are disposed of alongside the Player dispose event as I didn't want them left in the global scope (document
).Testing
I performed testing on a video with sponsored segments. I tested seeking on the player via clicking, clicking and dragging, and keyboard hotkeys. Currently there are no ramifications I have found.
Desktop
Additional context
The
keycode
package used to pick up the keyboard hotkeys already exists within the FreeTube project viavideo.js
, I didn't add it myself for the purpose of this bugfix.