Class: QueueReorderItemsRequest

  • chrome.cast.media.QueueReorderItemsRequest is used to change the playback order of media items within a queue on a cast receiver.

  • It requires a list of media item IDs (itemIds) to reorder and optionally an insertBefore item ID to specify the position in the queue.

  • Items not specified in the itemIds array retain their original order relative to each other, with the reordered items inserted as a block.

  • The reordered items are placed before the item specified by insertBefore, or appended to the end of the queue if insertBefore is not provided or is invalid.

  • Custom data can be passed to the receiver application using the customData property.

Constructor

QueueReorderItemsRequest

new QueueReorderItemsRequest(itemIdsToReorder)

Parameter

itemIdsToReorder

Array of number

The list of media item IDs to reorder. Must not be null or empty.

Value must not be null.

Properties

customData

nullable Object

Custom data for the receiver application.

insertBefore

nullable number

ID of the item that will be located immediately after the reordered list. If null or not found, the reordered list will be appended at the end of the queue. This ID can not be one of the IDs in the itemIds list.

itemIds

non-null Array of number

The list of media item IDs to reorder, in the new order. Items not provided will keep their existing order (without the items being reordered). The provided list will be inserted at the position determined by insertBefore.

For example:

If insertBefore is not specified Existing queue: “A”,”D”,”G”,”H”,”B”,”E” itemIds: “D”,”H”,”B” New Order: “A”,”G”,”E”,“D”,”H”,”B”

If insertBefore is “A” Existing queue: “A”,”D”,”G”,”H”,”B” itemIds: “D”,”H”,”B” New Order: “D”,”H”,”B”,“A”,”G”,”E”

If insertBefore is “G” Existing queue: “A”,”D”,”G”,”H”,”B” itemIds: “D”,”H”,”B” New Order: “A”,“D”,”H”,”B”,”G”,”E”

If any of the items does not exist it will be ignored. Must not be null or empty.