Replies: 2 comments 15 replies
-
Hi, This is the default, yes. If you need more involved implementations, you can define your own. Each request dynamic source has a This way, you can create a source, add an initial track and queue the next track when it gets near the end. Something like this: s = request.dynamic(prefetch=0, ...)
if not s.add(some_initial_request) then
log("Error while queueing initial request!")
end
def on_end(_, _) =
new_request = ...
if not s.add(new_request) then
log("Error while queueing next request!")
end
end
s = source.on_end(s, on_end) Be aware, though, that doing things like that can be tricky, in particular if it takes too long to prepare the next track or if your source is behind a switch/fallback and may not get played for a while etc. The general philosophy of our implementation designs is to choose a default implementation that is simple and fits most people's need but leave it open to implement advanced uses like this.. 🙂 |
Beta Was this translation helpful? Give feedback.
-
Here's the beginning of my LS-file
Running it gives me an error on the on_end part
|
Beta Was this translation helpful? Give feedback.
-
I have a source that looks like this
gbsfm = request.dynamic(prefetch=1, id="gbsfm", get_request)
setting prefetch to 1 makes the source work, but not the way I want. when starting LS it makes two requests to get_request, for the current song, and next song. At the end of current song, next song is played and one new request is done.
I want the initial request to only ask get_request once
I thought that was what the prefetch=0 would do, but it seems to just... disable the entire source
Beta Was this translation helpful? Give feedback.
All reactions