Skip to content

Player Commands

Landie edited this page Jun 18, 2022 · 3 revisions

Set Playback State

Sets the playback state of the player.

Parameters

Box Name Type required? Description
Playstate Dropdown The playstate you wish to set.

Playstates:
Play, Next, Previous, Stop, Pause, and Random

Set Playback Mode

Sets the playback mode of the player.

Parameters

Box Name Type required? Description
Playback Mode Dropdown The playback mode you wish to set.

Playback Modes:
Default, Repeat (Playlist), Repeat (Track), Random, Shuffle (Tracks), Shuffle (Albums), and Shuffle (Folders)

Set Song

Sets the song for the player.

Parameters

Box Name Type required? Description
playlistID/index string The Playlist ID or index of the playlist you wish to play a song from.
Song Index string The index of the song you wish to play

Get Current Song Info

Gets the current set/playing song info from the player.

Parameters

Box Name Type required? Description
Save Object Variable string The Object Variable you wish to save to.
Columns string (special syntax) A comma delimited list of column data to return (e.g. "%artist%,%title%")

you may also not use colons, however, everything returns in one line which is not ideal.

Response

Value Type Description
.duration int Number indicating the duration of the current song
.index int Song's position in the playlist
.playlistIndex int Playlist's position in playlist list that the current song resides in
.position int Current song's position relative to .duration
.playlistId String Playlist ID of the current song's location
.columns[] Array Array of column data requested
.columns[0-?] String column data is in order of provided pattern. Depending on how many comma delimited entries, this array can have multiple entries.

e.g. %album%,%title%,%length% => columns[0],columns[1],columns[2]

Example Response📝

{
  "currentSongInfo": { //Save Object Variable
    "position": 6.806788, //position relative to duration below
    "duration": 245.121458,
    "columns": ["Remind Me (someone else's radio remix)", "Remind Me", "4:05"], //%title%,%album%,%length%
    "playlistIndex": 4,
    "playlistId": "p5",
    "index": 15
  }
}

Example LB get current song info

Get Song Artwork

Gets the specified song's artwork as a direct link.

Parameters

Box Name Type required? Description
Save Variable string The Variable you wish to save to
Playlist ID string The Playlist ID (not index) of the playlist the song resides in
Song Index int The song's index in the playlist

Response

Value Type Description
. String The direct link to the song's artwork. Can be displayed using a OBS Web Source

Example Response📝

{
  "songArtwork": "http://127.0.0.1:8880/api/artwork/p5/4" // Save Variable containing returned direct link
}

example lb obs Song Artwork