OpenBroadcaster Documentation
models / playlists_model.php

PlaylistsModel

Model

Manages playlist data, dynamic selections, their permissions, and LiveAssist items.

public  insert ( data )

Insert a playlist.

Parameters
data
public  update ( data )

Update a playlist.

Parameters
data
public  update_permissions_users ( playlist_id, user_ids )

Update the users who have permissions for a specified playlist.

Parameters
playlist_id
user_ids
public  update_permissions_groups ( playlist_id, group_ids )

Update the groups who have permissions for a specified playlist.

Parameters
playlist_id
group_ids
public  get_permissions ( playlist_id )

Get the user and group permissions for a specified playlist.

Parameters
playlist_id
Returns [groups, users]
public  get_by_id ( id )

Get a playlist.

Parameters
id
Returns playlist
public  get_items ( id )

Get detailed media items for a playlist ID.

Parameters
id
Returns playlist_items
public  get_liveassist_items ( id )

Get LiveAssist buttons associated with a playlist.

Parameters
id
Returns liveassist_buttons
public  where_used ( id )

Provide information about where a playlist is used. This includes player schedules, default playlists, and LiveAssist buttons.

Parameters
id
Returns [used, id, can_delate]
public  search ( query, limit, offset, sort_by, sort_dir, my=false )

Search for playlists.

Parameters
query,
limit
offset
sort_by
sort_dir
my Limit results to currently logged in user. Default FALSE.
Returns [num_results, playlists]
public  validate_playlist ( data )

Validate a playlist.

Parameters
data
Returns is_valid
public  validate_playlist_item ( item, playlist_id = null )

Validate a single playlist item.

Parameters
item
playlist_id Set if validating an existing playlist. Default NULL.
Returns is_valid
public  validate_liveassist_button_item ( playlist_id )

Validate that a LiveAssist button's playlist ID exists.

Parameters
playlist_id
Returns [exists, msg]
public  validate_dynamic_properties ( search_query, num_items, num_items_all, image_duration )

Validate dynamic properties.

Parameters
search_query
num_items
num_items_all Boolean set to TRUE to use all items. Overrides num_items.
image_duration
Returns [is_valid, msg]
public  update_liveassist_items ( playlist_id, items )

Update the LiveAssist buttons using a specific playlist.

Parameters
playlist_id
items
public  dynamic_selection_duration ( search_query, num_items, image_duration )

Figure out the dynamic selection duration. An estimate unless all items are selected.

Parameters
search_query
num_items
image_duration
Returns duration
public  delete ( id )

Delete playlist, associated items, and scheduled content.

Parameters
id
public  delete_items ( playlist_id )

Delete playlist items associated with playlist.

Parameters
playlist_id
public  resolve ( playlist_id, player_id, parent_player_id = false, start_time = null, max_duration = null )

Resolve playlist to create a set of media items only from variable/dynamic data.

Parameters
playlist_id
player_id
parent_player_id
start_time Datetime object