AI-generated Key Takeaways
-
The
QueueManager
class provides methods for manipulating the queue of media items, such as inserting, removing, and updating items. -
It allows developers to get information about the queue, like retrieving the current item, item index, or all items.
-
Developers can access
QueueManager
through thePlayerManager
instance and should not directly instantiate it. -
QueueManager
supports managing container metadata, which provides contextual information about the queue. -
The number of queue items reported in Media Status can be limited using
setQueueStatusLimit
for performance optimization.
cast.framework. QueueManager
QueueManager exposes several queue manipulation APIs to developers.
- Throws
-
non-null Error
If constructor is used directly. The QueueManager should only be accessed by calling cast.framework.PlayerManager#getQueueManager.
Methods
getContainerMetadata
getContainerMetadata() returns cast.framework.messages.ContainerMetadata
Get Container Metadata.
- Returns
getCurrentItem
getCurrentItem() returns cast.framework.messages.QueueItem
Returns the current queue item.
- Returns
-
nullable cast.framework.messages.QueueItem
getCurrentItemIndex
getCurrentItemIndex() returns number
Returns the index of the current queue item.
- Returns
-
number
The current item index
getItems
getItems() returns Array of non-null cast.framework.messages.QueueItem
Returns the queue items.
- Returns
-
non-null Array of non-null cast.framework.messages.QueueItem
insertItems
insertItems(items, insertBefore)
Inserts items into the queue.
Parameter |
|
---|---|
items |
Array of non-null cast.framework.messages.QueueItem Value must not be null. |
insertBefore |
Optional number ID of the item that will be located immediately after the inserted list. If it is not provided or it is not found, the list will be appended to the end of the queue. |
removeItems
removeItems(itemIds)
Removes items from the queue.
Parameter |
|
---|---|
itemIds |
Array of number The IDs of the items to reorder. Value must not be null. |
setContainerMetadata
setContainerMetadata(containerMetadata)
Set Container Metadata.
Parameter |
|
---|---|
containerMetadata |
cast.framework.messages.ContainerMetadata Value may be null. |
setQueueStatusLimit
setQueueStatusLimit(limitQueueItemsInStatus)
Sets whether to limit the number of queue items to be reported in Media Status (default is true).
Parameter |
|
---|---|
limitQueueItemsInStatus |
boolean |
updateItems
updateItems(items)
Updates existing queue items by matching itemId.
Parameter |
|
---|---|
items |
Array of non-null cast.framework.messages.QueueItem Value must not be null. |