-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer duration control? #11
Comments
No, it's not a limitation, you can edit the buffer size with the Please check the README: https://github.com/Pato05/just_audio_media_kit?tab=readme-ov-file#plugin-specific-configuration-settings-for-media_kits-player-instance |
That is true. I wanted to create a proxy server to handle this, but that would be too bloat-y to include in the main plugin, so I'll probably never actually do this. However, feel free to create a new plugin for it! Actually this might not be necessary as it seems mpv already supports this via the |
So there's no way to set the buffer size based on a duration somehow? The |
Not as far as I'm aware...
According to docs it's kinda similar to what Also I'm not really sure how "gapless" would be different than pre-fetching the next track.. I'll implement this anyways (also cause it doesn't hurt to), though, can you try it yourself as to check whether this meets your needs? |
I am a bit confused by the part about it not pre-fetching video data. It sounded like it would simply open a connection and fetch the header of the next item, instead of actually loading any media data. I guess we'll have to try it out. Where would I need to add this option to try things out? |
You may actually be right, that's why it says "merely", I guess...
You could add it right after |
Ok, so I did some testing by using a python HTTP server (from scratch, so that I can check whenever the connection is open), and it seems that Screencast.from.2024-04-09.14-25-14.webmI don't think increasing the demuxer buffer will actually do anything, as by default it should be about 150MB, and, well, the song doesn't even go close to that... It's surely better to put the option to use |
I was looking at the mpv docs, and yes, you can specify a duration instead of specifying bytes, with the If ryanheise/just_audio#1222 gets fixed, I could export the |
While testing the new option, it seems that the actual behaviour in I'll cut to the chase: it started loading the track when there were about 15 minutes left from the podcast, and it didn't only stop when it received the headers, but the entire song was downloaded way before it was required for playback! prefetch.webmWith that said, this issue can be now closed (feel free to reopen if you find a new solution or feel like this is incomplete). |
Sorry for not responding to this, I'm currently sitting on a huge stack of unread notifications and I'm spread way to thin. So thanks for all your work, and the nice write-ups. I see that you've already published your changes. I'll give this a try immediately and report back! |
Yeah, that seems to work well! Sometimes the buffer doesn't show up in our UI immediately, but the next track is definitely starting to play immediately. Either way, I also consider this issue closed. Providing the buffer duration in seconds would be nice, but if you want to wait for ryanheise/just_audio#1222 for that, that's also fine with me! |
As I said earlier, media-kit itself doesn't have a way of specifying the buffer in seconds, even though mpv does have a property Exporting the native platform would of course mean that you can set this property yourself, thus reaching your goal. Though I would like to avoid tinkering with properties (and introducing "hacks") as much as possible and just sticking to what media-kit already provides. Though of course, if a hack is needed for a huge deficiency (like in #3), that would be completely fine as there wouldn't be any way around it. |
I'm still a but fuzzy with the relation between media-kit and mpv. I thought media-kit was a stand-alone player that doesn't use platform-specific implementations, but your comment makes me think it's just an additional wrapper around the "native" players for all platforms, that exposes a unified API? |
media-kit uses |
This reverts commit 47504b7.
Is there any way to control the buffer duration with the media-kit backend? For Android there's
AndroidLoadControl.minBufferDuration
andAndroidLoadControl.minBufferDuration
, and for iOS there'sDarwinLoadControl.preferredForwardBufferDuration
in just_audio.It appears like currently the player is using the
AndroidLoadControl
on Windows, but that could just be a coincidence.Either way, it seems like the buffer always stops at the end of the current track, and does not pre-fetch the next track, contrary to what happens on the mobile platforms. Setting the buffer duration to 10 minutes should always fetch the next 10 minutes of the current audio source (which is a
ConcatenatingAudioSouce
in this case), even if the current track is shorter than that.Is that a limitation of media-kit?
The text was updated successfully, but these errors were encountered: