When you publish a campaign On Demand to Android and Windows players, it is possible to trigger it by clicking on “Play icon” within the player, or through a HTTP request.
Don’t you know what is an On Demand campaign? Check out the tutorial How to publish On Demand Campaigns
In this tutorial we will explain how to obtain the campaign on demand URL and trigger it on the screen according to the desired parameters:
- Open the player or group of players in which you have published the campaign on demand.
- Select "Campaigns in Player" tab.
- The published campaign will be marked as "Play On Demand". Right click the blue play button and choose "Copy Link Address" to get a
Playback URLcan be used to automate playback of that campaign in that specific player, through a regular
- When doing so, some parameters can be used to control the behavior of playback:
A number from 0 to 999 to specify for how long the campaign should be played. Special value
||Controls the On Demand Queue. Read more bellow.|
Any other parameter added to the
Requesting the URL below will cause the player to play an item indefinitely, having the parameter
info available for the campaign.
$ curl 'https://app.onsign.tv/play/VL3GR4qlL7ZcdHLOF4O0?repeat=0&info=1234'
Using the On Demand Queue
By default, the campaign playback starts as soon as the
Playback URL is accessed, interrupting whatever is currently playing, be it either scheduled or other on demand campaign.
OnSign TV Android Player version 7.0.3 or greater adds new ways of playing a campaign on demand, through the
Interrupts the currently playing campaign and starts playing the new content. Any existing queued content is discarted. Default if
||Queue the new content to be played as soon as the currently playing campaign is done. If there is other content in the queue, they will be played first.|
||Queue the new content. If the currently playing campaign is from a scheduled loop (meaning not played on demand), interrupt it and start playing the queue.|
Those three actions allow for a myriad of interactions.
Assume that a player has the campaigns "A", "B" and "C" published on demand, while having two campaigns playing through the scheduled loop: "X", "Y".
- Trigger three campaigns on demand on a sequence: If the player is playing "X" and one calls:
https://app.onsign.tv/play/token_A?action=playqueue https://app.onsign.tv/play/token_B?action=playqueue https://app.onsign.tv/play/token_C?action=playqueue
The player would immediately interrupt the campaign "X" and start playing campaign "A", followed by campaign "B", and "C".
The player would immediately start playing the campaign "A", followed by campaign "X", that was previously interrupted. After that it would resume the loop, playing "Y", "X", "Y", and so on.
Please mind that campaign "C" would not play on this scenario, because the queue is dropped when