Wait for pre-roll ads to finish in /player request#7887
Merged
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom Aug 22, 2025
Merged
Wait for pre-roll ads to finish in /player request#7887FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
Conversation
MarmadileManteater
approved these changes
Aug 22, 2025
efb4f5ff-1298-471a-8973-3d47447115dc
approved these changes
Aug 22, 2025
kommunarr
approved these changes
Aug 22, 2025
efb4f5ff-1298-471a-8973-3d47447115dc
pushed a commit
to efb4f5ff-1298-471a-8973-3d47447115dc/FreeTube
that referenced
this pull request
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Type
Related issue
Description
This pull request removes the now broken shorts player parameters that we were using to workaround the pre-roll ad wait time and replaces it with a somewhat hacky solution that digs through that ad parameters and waits for the duration of that ads. The reason this is hacky is because we wait inside the fetch function wrapper, which is simple to implement but means that the user sits on the watch page loading screen for longer, once we switch to SABR it'll be nicer because then only the player has to wait, so users can read the description or browse the comments while they are waiting. Another disadvantage of this solution is that it waits the full duration of the ads even if they are skippable, whereas with SABR the server will tell you how long you need to back-off for which is equivalent to the minimum time you would need to wait.
Testing
Test playing videos with pre-roll ads and ones without.
The official
@YouTubechannel doesn't have any pre-roll ads, this is the latest upload: https://youtu.be/TK5VMx3uzBICrab rave is an example of a video that has ads: https://youtu.be/LDU_Txk06tM
Desktop