Implement track preloading

Will preload the next track close to the end of the currently playing
track. Should make playback of queued tracks a little smoother.
This commit is contained in:
Henrik Friedrichsen
2021-04-11 15:51:19 +02:00
parent decf7c2aef
commit 98e572169b
5 changed files with 38 additions and 0 deletions

View File

@@ -842,6 +842,10 @@ impl Spotify {
self.send_worker(WorkerCommand::SetVolume(Self::log_scale(volume)));
}
pub fn preload(&self, track: &Playable) {
self.send_worker(WorkerCommand::Preload(track.clone()));
}
pub fn shutdown(&self) {
self.send_worker(WorkerCommand::Shutdown);
}