Skip to content

Conversation

@Abhyshekbhalaji
Copy link

@Abhyshekbhalaji Abhyshekbhalaji commented Oct 10, 2025

Resolves #3240 — Adds an "Advanced Video Buffering" toggle to the extension settings.

This new option allows users to aggressively buffer and preload more of the YouTube video for smoother playback, based on requests from users experiencing slow or interrupted playback.

UI Implementation

  • Toggle: Added an "Advanced Video Buffering" toggle in the extension's UI settings menu, positioned directly below the existing performance features (Codecs, Allow 60fps, Avoid HDR).
  • Duration Control: Added a user-adjustable duration input (number field or slider) for selecting buffer duration in seconds. Defaults to 30 seconds, but users can customize this value to their preference.

How It Works

  1. User enables the "Advanced Video Buffering" toggle
  2. User sets desired buffer duration (adjustable, default 30s)
  3. The feature hints the browser to preload more data and uses a seek-ahead trick to load additional video contents automatically whenever a video loads or changes quality
  4. Result: smoother playback with reduced interruptions

Testing

Thoroughly tested on various YouTube videos and all works as expected.

@ImprovedTube
Copy link
Member

hi and thanks! @Abhyshekbhalaji

You didn't add a toggle to our settings.need to add a toggle
Did you test it on youtube?
I assume If it helps somebody, then we should let them set the amount of seconds too.

@Abhyshekbhalaji
Copy link
Author

Abhyshekbhalaji commented Oct 11, 2025

Yes @ImprovedTube will have a look at it, currently the duration is set to 30 seconds for advance buffering if in case the duration is lower it is set to the entire duration for preload , the toggle is something i need to look at

@Abhyshekbhalaji
Copy link
Author

Can you elaborate where you like to have the toggle feature plus the duration?

@ImprovedTube
Copy link
Member

ImprovedTube commented Oct 14, 2025

hi! yes, had read code. is it working effectively?

currently it fits below our other performance features
Codecs
Allow 60fps
Avoid HDR, keep SDR

@ImprovedTube ImprovedTube added up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) labels Oct 15, 2025
@ImprovedTube
Copy link
Member

possible somebody new wants to add the missing toggle, still before you or I do: https://github.com/code-charity/youtube/wiki/Contributing#Development

to add an input you can mimic our other features with an input

Let's name this feature Preload / increase Buffer by x seconds (experimental), or so at first, in en/messages.js, until we confirmed it might works with different Youtube accounts

@Abhyshekbhalaji
Copy link
Author

Hey @ImprovedTube the UI part? Hope someone does it i think i have added the necessary backend part for that! i really dont think we do need a toggle for shorts ( i mean entire duration is preloaded) for long videos the toggle options are now enabled with my new pr

@HaleTom
Copy link

HaleTom commented Oct 29, 2025

Thanks @Abhyshekbhalaji! Does this work with DASH streaming, or only the legacy type?

@Abhyshekbhalaji
Copy link
Author

Thanks @ImprovedTube and @HaleTom for the feedback! Here's a summary of the current status and what's needed for merge:

Current Status:
✅ Backend buffering logic is implemented and tested on various YouTube videos
✅ Shorts automatically preload the entire duration
✅ Long videos use the configurable buffer approach (currently defaulting to 30 seconds)

What Still Needs to Be Done:
❌ UI toggle is not yet added in the extension settings - this is the main blocker
❌ Buffer duration selection (number input/slider) needs to be implemented for user control
❌ Localization entries need to be added in en/messages.js
❌ Compatibility testing with both legacy and DASH streaming needs confirmation (as @HaleTom asked)

Implementation Plan:
The UI toggle should be positioned below the existing performance features (Codecs, Allow 60fps, Avoid HDR) with the label: "Preload / increase Buffer by x seconds (experimental)"

The feature is mainly relevant for long videos since shorts already preload their entire duration automatically.

Once the UI work (toggle + duration input) and DASH streaming compatibility are confirmed, this PR should be ready for merge. I'm working on these remaining items - happy to have help from the community on the UI portion if anyone wants to contribute!

@ImprovedTube
Copy link
Member

hi! @HaleTom @Abhyshekbhalaji please indicate LLM parts of code (and messages (if any))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Generated Content help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💡Video Buffer

3 participants