Constructor

MediaQueue

new MediaQueue(idGenerator)

Parameter

idGenerator

function()

Value must not be null.

Methods

getCurrentItem

getCurrentItem() returns cast.receiver.media.QueueItem

Gets the current queue item.

Returns

nullable cast.receiver.media.QueueItem The current item.

getCurrentItemId

getCurrentItemId() returns (number or undefined)

Gets the ID of the current queue item.

Returns

(number or undefined) The current itemId or undefined if not found.

getCurrentItemIndex

getCurrentItemIndex() returns number

Gets the current item index in the queue.

Returns

number The current item index.

getItems

getItems(includeMedia, limitQueueItems) returns Array of non-null cast.receiver.media.QueueItem

Returns a list of current items or limited set of items from the queue. Note: When we don't include Media Information, we always return cloned copies of the items.

Parameter

includeMedia

Optional

boolean

Whether to include the media information with each item. It is included by default.

limitQueueItems

Optional

boolean

Whether to limit the amount of queue items returned to be only items near (+-1) of current item.

Returns

non-null Array of non-null cast.receiver.media.QueueItem The queue items.

getLength

getLength() returns number

Gets the number of items in the queue.

Returns

number The number of items in the queue.

getRepeatMode

getRepeatMode() returns cast.receiver.media.RepeatMode

Gets the queue repeat mode (the behavior of the queue when all items have been played).

Returns

non-null cast.receiver.media.RepeatMode The behavior of the queue when all items have been played.