j-holub / Node-MPV

A NodeJs Module for MPV Player
https://www.npmjs.com/package/node-mpv
MIT License
117 stars 73 forks source link

[Question] Replace current title with URL but not play, wait for specific buffer amount #105

Open KaKi87 opened 2 years ago

KaKi87 commented 2 years ago

Hello,

Is it possible to make mpv do the following ?

Thanks


Optional explanation below

I just learned about mpv being a programmable player, so I would like to try something out.

When streaming with low/moderate bandwith, using a player that starts instantly when buffer just began to load, then it will eventually become empty and playback will be interrupted, because it is consumed faster than it is loaded.

Therefore, I would like to create a player that mesures the buffer's loading speed, and calculate the optimal size to avoid interruption, so that the user will have to wait longer to start playing, but will not experience further interruptions.

If the network slows down while playing, the buffer size will be recalculated accordingly, and if possible, playback will be interrupted at the end of the current chapter, or at the nearest quiet time, in order to offer the best viewing experience possible.

I've been thinking about this project for a long time, but I need to be sure that it is doable using mpv, before starting implementing the basics of the player.

Thanks

vankasteelj commented 2 years ago

Hi there, you don't need MPV to do that, as the player (as far as I know) doesn't handle downloads by itself, it renders videos (duh^^). So you'll need to handle the download/stream yourself with Javascript, and then you can just fire up MPV player when you're ready

KaKi87 commented 2 years ago

the player (as far as I know) doesn't handle downloads by itself

Really?

If that's true, I will definitely give up, because I'm not motivated enough to implement that.