cast.framework.messages. QueueInsertRequestData
Media event queue INSERT request data.
Constructor
QueueInsertRequestData
new QueueInsertRequestData(items)
Parameter |
|
---|---|
items |
Array of non-null cast.framework.messages.QueueItem List of queue items. The itemId field of the items should be empty or the request will fail with an INVALID_PARAMS error. It is sorted (first element will be played first). Value must not be null. |
Properties
currentItemId
(number or undefined)
ID of the current media Item after the insertion (if not provided, the currentItem value will be the same as before the insertion).
currentItemIndex
(number or undefined)
Index (relative to the items array, starting with 0) of the new current media Item. For inserted items we use the index (similar to startIndex in QUEUE_LOAD) and not currentItemId, because the itemId is unknown until the items are inserted. If not provided, the currentItem value will be the same as before the insertion (unless currentItemId is provided). This param allows to make atomic the common use case of insert and play an item.
currentTime
(number or undefined)
Seconds since the beginning of content to start playback of the current item. If provided, this value will take precedence over the startTime value provided at the QueueItem level but only the first time the item is played. This is to cover the common case where the user jumps to the middle of an item so the currentTime does not apply to the item permanently like the QueueItem startTime does. It avoids having to reset the startTime dynamically (that may not be possible if the phone has gone to sleep).
customData
(non-null Object or undefined)
Application-specific data for this request. It enables the sender and receiver to easily extend the media protocol without having to use a new namespace with custom messages.
- Inherited from
- cast.framework.messages.RequestData#customData
insertBefore
(number or undefined)
ID of the item that will be located immediately after the inserted list. If the ID is not found or it is not provided, the list will be appended at the end of the existing list.
items
non-null Array of non-null cast.framework.messages.QueueItem
List of queue items. The itemId field of the items should be empty. It is sorted (first element will be played first).
mediaSessionId
(number or undefined)
Id of the media session that the request applies to.
- Inherited from
- cast.framework.messages.RequestData#mediaSessionId
requestId
number
Id of the request, used to correlate request/response.
- Inherited from
- cast.framework.messages.RequestData#requestId
sequenceNumber
(number or undefined)
A number to synchronize all queue commands. If provided for a queue command, the SDK will verify the queue latest sequence number match the request. Current sequenceNumber is provided as part of outgoing queue changed messages.
- Inherited from
- cast.framework.messages.RequestData#sequenceNumber