Call command in playlist
Posted: 19 Nov 2020 12:05
Hi all,
I want to be able to call a command (which makes an HTTP call to an external server) only when that particular item is played within a playlist. Let me better explain...
I currently have a script that loads a particular set of songs from my libraries. In the middle of these songs, I have an item that starts playing the Line-In feed for 1 hour. The actual content that I get from the Line-In feed is less than 1 hour so right now when the content is ready, we manually click the 'Play Next Use Fading' button so in the playlist, we move to the next track. All is good there.
What I'd like to happen is that just before the Line-In feed item in my script plays, I execute a command then, when I hit the 'Play Next Use Fading' button, another command is executed. To be more clear, I want to call an external HTTP request as soon as the Line-in feed starts playing and call another external HTTP request as soon as the Line-in feed stops playing (or as soon as the 'Play Next Use Fading' button is clicked).
Right now, the full script is loaded by calling a Scheduled Program so it loads in a specific time. I tried to add the commands in the script itself but what happened is that both commands ran as soon as the Scheduled Program ran, which kind of makes sense.
So, I guess, my question is, can I have an item in my script that calls the command only when that particular playlist item is played?
I want to be able to call a command (which makes an HTTP call to an external server) only when that particular item is played within a playlist. Let me better explain...
I currently have a script that loads a particular set of songs from my libraries. In the middle of these songs, I have an item that starts playing the Line-In feed for 1 hour. The actual content that I get from the Line-In feed is less than 1 hour so right now when the content is ready, we manually click the 'Play Next Use Fading' button so in the playlist, we move to the next track. All is good there.
What I'd like to happen is that just before the Line-In feed item in my script plays, I execute a command then, when I hit the 'Play Next Use Fading' button, another command is executed. To be more clear, I want to call an external HTTP request as soon as the Line-in feed starts playing and call another external HTTP request as soon as the Line-in feed stops playing (or as soon as the 'Play Next Use Fading' button is clicked).
Right now, the full script is loaded by calling a Scheduled Program so it loads in a specific time. I tried to add the commands in the script itself but what happened is that both commands ran as soon as the Scheduled Program ran, which kind of makes sense.
So, I guess, my question is, can I have an item in my script that calls the command only when that particular playlist item is played?