PeerTube icon indicating copy to clipboard operation
PeerTube copied to clipboard

Admin setting to customize the player buffering behaviour

Open stemy2 opened this issue 11 months ago • 8 comments

Describe the problem to be solved

Hello,

My connection is pretty slow, and i'd like to change the buffering behaviour to reduce the annoyance.

Describe the solution you would like

-Allow buffering when video is paused. -Allow buffering until the end of the video once for all.

stemy2 avatar Jan 05 '25 23:01 stemy2

-Allow buffering until the end of the video once for all.

No thank you! When you factor in high quality (40Mbps+ bitrate) 4k videos that could be up to an hour long loading the entire video into the buffer would be a complete nightmare!

You would be literally throwing away bandwidth on the server if the user closes the video before finishing it.

If you need this feature you should consider editing the source code and compiling peertube yourself from scratch!

Here is a guide for compiling:

https://docs.joinpeertube.org/install/unofficial

Also, PR's are welcome if you can get this feature to work in a way that won't be abused.

frenzybiscuit avatar Jan 05 '25 23:01 frenzybiscuit

I'm not advanced enough in coding to compile a such thing. Why not add the options in a server config file ? I intent using it on a confidential instance.

stemy2 avatar Jan 05 '25 23:01 stemy2

-Allow buffering when video is paused.

It already does this!

frenzybiscuit avatar Jan 05 '25 23:01 frenzybiscuit

advanced enough in coding to compile a such thing. Why not add the options in a server config file ? I intent using it on a confidential instance.

Why don't you just enable video downloads and let users download the video?

It's literally the same thing if you want the entire video to load into the buffer.

frenzybiscuit avatar Jan 05 '25 23:01 frenzybiscuit

Reopening this issue because an admin setting to customize the player buffer behaviour seems a good idea.

Chocobozzz avatar Jan 06 '25 09:01 Chocobozzz

Just curious, is there a limitation on how large the buffer can be?

frenzybiscuit avatar Jan 06 '25 16:01 frenzybiscuit

Also a request to customize the player buffer settings. The problem I have is with HLS playback is that it waits to long before requesting the next segment. So by the time the new segment arrives, it is to late and cause the playback to stutter/stop. So a bit of tinkering (and help from AP) I made a client-overide.js file that is a bit more aggressive in pre-fetching segments (see attached file). It works for my setup, might be a problem for larger setups that has bigger traffic to think of.

(You don't have to change source code, just drop the file in the config folder and restart PeerTube)

client-overrides.js.zip

primaldev avatar Aug 12 '25 11:08 primaldev

You can also use the plugin hooks to change the player settings (filter:internal.player.videojs.options.result or filter:internal.player.p2p-media-loader.options.result): https://docs.joinpeertube.org/api/plugins#client-hooks

Chocobozzz avatar Aug 12 '25 11:08 Chocobozzz