ForsideSupportTrigger On Demand Campaign by HTTP Request
When you publish an On Demand Campaign to Android and Windows Players, it is possible to trigger it by clicking the “Play» icon on the Player in your screenpublishing account, or through an HTTP request.
In this tutorial, we explain how to obtain the Campaign On Demand URL and trigger it on screen to desired parameters:
Open the Player or Player Group in which you have published the On Demand Campaign.
Go to the «Campaigns in Player» tab.
The published Campaign will be marked as «Play On Demand». Right click on the blue «Play» button and choose «Copy Link Address» to get a Playback URL.The Playback URL can be used to automate playback of the Campaign on that specific Player, through a regular GET HTTP request:
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 content.
The screenpublishing Android Player version 7.0.3 or greater adds new ways of playing a Campaign on demand, through the action parameter.
Action
Result
play
Interrupts the currently playing Campaign and starts playing the new content. Any existing queued content is discarded. This is the default if action is not specified otherwise.
queue
Queues the new content to be played as soon as the currently playing Campaign is over. If there is other content in queue, they will be played first.
playqueue
Queues the new content. If the currently playing Campaign is from a scheduled loop (meaning not played on demand), this interrupts it and starts playing the queue.
Those three actions allow for a myriad of interactions.
Examples:
Assume 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 in a sequence: If the player is playing «X» and you call:
The Player would immediately interrupt the Campaign «X» and start playing Campaign «A», followed by Campaigns «B» and «C».
Trigger another cCmpaign on demand and discard queue: Now assume that the Campaign «B» is playing and you call:
https://app.screenpublishing/play/token_A
The player would immediately start playing the Campaign «A», followed by Campaign «X» which 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 in this scenario, because the queue is dropped when action=play.