Skip to content

Wait for pre-roll ads to finish in /player request#7887

Merged
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
absidue:wait-for-ads
Aug 22, 2025
Merged

Wait for pre-roll ads to finish in /player request#7887
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
absidue:wait-for-ads

Conversation

@absidue
Copy link
Member

@absidue absidue commented Aug 22, 2025

Pull Request Type

  • Bugfix

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 @YouTube channel doesn't have any pre-roll ads, this is the latest upload: https://youtu.be/TK5VMx3uzBI
Crab rave is an example of a video that has ads: https://youtu.be/LDU_Txk06tM

Desktop

  • OS: Windows
  • OS Version: 10

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 22, 2025
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 22, 2025 16:26
@FreeTubeBot FreeTubeBot merged commit 7313126 into FreeTubeApp:development Aug 22, 2025
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 22, 2025
@absidue absidue deleted the wait-for-ads branch August 22, 2025 18:40
efb4f5ff-1298-471a-8973-3d47447115dc pushed a commit to efb4f5ff-1298-471a-8973-3d47447115dc/FreeTube that referenced this pull request Aug 22, 2025
@FreeTubeApp FreeTubeApp deleted a comment from hboetes Aug 22, 2025
@FreeTubeApp FreeTubeApp locked and limited conversation to collaborators Aug 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Video Player Flickering while loading [Bug]: Error: This video is unavailable

5 participants