-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Regarding the Scheduled Playback of Promotional Ads #4217
Comments
Hi @dycfan666,
I think it may be |
Regrettably, the issue persists. Here is my revised code: Define the audio source for adsinput_ad = mksafe(playlist(reload_mode="watch", mode="randomize", "/var/www/html/radiolist/local_scunicomad.playlist.m3u")) Ensure promotional content is inserted every 10 minutestimed_promotions = delay(600., input_ad) However, the desired functionality is still not achieved. My goal is for the main stream to play for 10 minutes, followed by the entire ad playlist being played in full. Currently, after 10 minutes of the main stream, only a single item from the ad playlist is played before returning to the main stream. I have no choice but to seek further assistance! |
As an option.
We've got ads playlist which doesn't reload itself and doesn't loop. Instead reload is called every 10 minutes. Of course the duration of tracks should be taken into consideration too. So what we have is: radio source plays, at 10m and so on minutes of every hour ads playlist is reloaded and played fully without interruption of radio source, then stops until next reload. Downside: if ads starts to play at 09m55s and the reload happens at 10m (when it's still playing) - we are likely to hear the whole playlist for the second time. So either we need track_sensitive=false or to ponder more! |
So if you want your ads to interrupt the main source - you can use the above function changing # Our main playlist:
radio = playlist("/music")
# Path (only path) to our ads playlist:
ads = "/path/to/ads.m3u"
# We create a queue for ads, where we will push our playlist
ads_queue = request.queue()
# Our function where we check if queue is empty or not. If it's empty we push our ads playlist into it.
# If it has tracks - we do nothing.
def play_ads_queue()
if ads_queue.queue() == [] then
tracks = list.iter(fun (x) -> begin
let (_, uri) = x
ads_queue.push.uri(uri)
end, playlist.parse("#{ads}"))
log("Pushed ads playlist to queue")
else
log("Queue is already populated")
end
end
# We run the above function every 10 minutes
thread.run(every=600., play_ads_queue)
# Our fallback
radio = fallback(track_sensitive=true,[
ads_queue, radio
])
radio = mksafe(radio)
output(radio) |
Thank you very much for your enthusiastic and meticulous guidance. Following the method you provided, I have successfully achieved the functionality I needed! |
Description
I am using Liquidsoap 2.2.5+dev.
I have a playlist for an advertising audio file:
input_ad = mksafe(playlist(reload_mode="watch", mode="sequence", "/var/www/html/radiolist/local_scunicomad.playlist.m3u"))
This playlist contains a dozen or so promotional advertisement audio files.
I want the main stream to play the entire playlist input_ad every 10 minutes. My Liquidsoap script is as follows:
timed_promotions = delay(600., input_ad) outputmusic_two = fallback([timed_promotions, outputmusic_one])
The Liquidsoap script runs fine, and indeed, it plays one item from input_ad every 10 minutes. However, it does not play the entire playlist input_ad as I intended; it only plays one file every 10 minutes instead of completing the full playlist.
I am seeking help with how to make the main stream play the entire advertisement playlist input_ad every 10 minutes.
Thank you so much!
Steps to reproduce
I want the main stream to play the entire playlist input_ad every 10 minutes. My Liquidsoap script is as follows:
timed_promotions = delay(600., input_ad) outputmusic_two = fallback([timed_promotions, outputmusic_one])
Expected behavior
The Liquidsoap script runs fine, and indeed, it plays one item from input_ad every 10 minutes. However, it does not play the entire playlist input_ad as I intended; it only plays one file every 10 minutes instead of completing the full playlist.
Liquidsoap version
Liquidsoap build config
Installation method
From OPAM
Additional Info
No response
The text was updated successfully, but these errors were encountered: