Object: Playlist

Playlist app. Manages multiple playlists by itself or in combination with a Player
Parameters:
Name Type Argument Description
config Object See: playlist configuration properties
player Object <optional> A Player object to signal when the item pointer changes
Properties:
Name Type Description
config Object The app configuration properties with defaults applied
listUrls Array Currently stored playlist urls. See: config.media & config.playlists
id String Identifies the current loaded playlist
lists Array Cached playlist data
listsPointer Number Index of the current playlist. note: directly modifying this value is unsafe
items Array Item data of the current playlist
pointer Number Index of the current item. note: directly modifying this value is unsafe
length Number Number of items in the current playlist
name String Title of the current playlist
description String Description of the current playlist
cycles Number Number of times the current playlist has rolled back to 1st item. Reset when changing playlists
beacon Object jQuery object. Broadcasts various events
dfd Object jQuery Deferred. Resolves once playlists are cached and ready to use.

Methods

Breaks functionality and attempts to remove references

Updates the item-pointer of the current playlist, and signals a render update.
Parameters:
Name Type Description
i Number Index of the item. If the index is out of bounds, it will roll over. Ex. if i = -1, the last item of the playlist will be set

Changes the lists-pointer and signals render updates. If the index is out of bounds, it will roll over.
Parameters:
Name Type Argument Description
listIndex Number Index of the playlist url
itemIndex Number <optional> Index of the item at which to start. If the index is out of bounds, it will roll over. Will use startIndex configuration property for default value

Returns:
Current item of the playlist
Type:
Object

Returns an item from the current playlist
Name Type Description
i Number Index of the item in the current playlist
Returns:
Type:
Object | null

Fetch 2nd level item data
Returns:
Type:
Object
Parameters:
Name Type Description
url string The content_url property of an item
id Number The id property of the same item
Returns:
jquery Deferred
Type:
Object

Returns the next item on the playlist and increments the item pointer on the current playlist
Returns:
Returns null if incrementing the pointer will cause a new playlist to load
Type:
Object | null

Events

Triggered when the current playlist index is changed
Parameters:
Name Type Description
config Object
listData Object
Triggered when the current item index is changed
Parameters:
Name Type Description
config Object
itemData Object