OpenBroadcaster Documentation
models / players_model.php

PlayersModel

Model

Manages players that play the content managed on the server.

public  get_one ( id )

Retrieve data from a single player. ID passed as parameter, rather than in a data array. Also includes all station IDs for that player.

Parameters
id
Returns player
public  get_all ( )

Retrieve all players.

Returns players
public  get ( params )

Retrieve players filtered by parameters.

Parameters
params Filters used when selecting players. See controller for specifics.
Returns players
public  get_station_ids ( id )

Get station IDs for a player. ID passed as single parameter, not in data array.

Parameters
id
Returns media_ids
public  station_id_average_duration ( )

Very unintelligently guess at a station ID duration. Since this is used in playlists which are not tied to a player, and since station ID durations can vary considerably, this is probably going to be a pretty terrible estimate.

Returns duration
public  validate ( data, id=false )

Validate data for updating/insert a player.

Parameters
data Data array. See controller for details.
id player ID. FALSE when inserting a new player.
Returns [status, msg]
public  save ( data, id=false )

Insert or update a player.

Parameters
data
id
Returns id
public  update_version ( id, version )

Update player version.

Parameters
id
version
public  update_location ( id, longitude, latitude )

Update player location.

Parameters
id
longitude
latitude
public  delete_check_permission ( id )

Validate whether it is possible to delete a player. Return FALSE in cases where a player has emergency broadcast content associated with it, or schedule data that the current user has no permission to delete.

Parameters
id
Returns is_deletable
public  player_is_parent ( id )

Check whether the player is a parent of any other players.

Parameters
id
Returns is_parent
public  delete ( id )

Delete a player.

Parameters
id
public  monitor_search ( params )

Search the player monitor log.

Parameters
params
Returns [results, numrows]
public  monitor_csv ( results )

Convert monitor results into CSV format.

Parameters
results
Returns csv
public  now_playing ( player_id )

Return what's currently playing on a player.

Parameters
id
Returns [show_name, show_time_left, media]