Korbyt Media Player API Commands for Layouts

API Commands that allow a a Layout to interact with the Media Player that is displaying it

Written By Ed Kinne

Last updated 11 months ago

Player API

The player provides the following API methods to allow a layout to interact with the player on which it is being displayed. All methods should be called on the playerApi object.

.previous() – Navigate to the previous item in the current playlist.

.next() – Navigate to the next item in the current playlist.

.pause() – Pause the current playlist.

.resume() – Resume playback of the playlist if it has been paused.

.resumeNext() – Resume playback of the playlist if it has been paused and immediately play the next slide.

.getHeaders() or .headers() – Return the headers needed for authentication when making web service calls.

.webService() – Return the base address of the web services.

.loginDetails() – Returns information about the player’s login. The following fields are available:

  • accessToken

  • id

  • name

  • type

  • webService.onMessage

.onMessage(string, callback) – Used to subscribe to messages sent to the player over the network. To send a message, you would access the player via http://[player]:65001/player/[string]. The callback gets a parameter with any GET variables passed along with the URL. See below for an example.

.playerMetaData() – Returns an object with a variety of player metadata. The following fields are available (note: an additional 20 custom metadata fields are available for the customer to define and use)

  1. player_name

  2. street

  3. city

  4. state

  5. country

  6. floor

  7. room

  8. notes

  9. zip

  10. latitude

  11. longitude

  12. orientation

  13. Custom Metadata fields 1-20

Player API Example

Display different elements based on a player’s zip code.

var zip = playerApi.playerMetaData().zip;

if(zip.indexOf(‘75075’) > -1){

$(‘#element_0_0’).hide();

$(‘#element_0_1’).show();

}

Modify content based on an HTTP message sent across the network

//assuming a request to http://myplayer:65001/player/message?title=Hello&body=I see you’re looking at my signage.

playerApi.onMessage(‘message’, function(args){

$(‘#0_0’).text(args.title);

$(‘#0_1’).text(args.body);

});

Media Player API Calls via Korbyt Services API

Player

GET

Get player details or enumerate players

POST

Create/Update a media file and play it on a player

PUT

Play existing media file on player

DELETE

Delete existing push or play request

PUT

Trigger player action

Player Group

GET

Get player details from player group or enumerate groups

POST

Create/Update a media file and play it across a player group

PUT

Play existing media file across player group

DELETE

Delete existing push or play request (group)

PUT

Trigger players action by group

Playlist

GET

Get playlist details or enumerate playlists

PUT

Update dynamic playlist – Set tags and force associated player checkins

POST

Create new clever playlist with static content

POST

Update static or clever playlist and force associated player checkins

Scriptlets

GET

Get scriptlet details or enumerate scriptlets

PUT

Install scriptlet

DELETE

Uninstall scriptlet