Thuật toán để chọn mục tiếp theo khi mục hiện tại đã kết thúc.
Giá trị mặc định
chrome.cast.media.RepeatMode.OFF
startIndex
number
Chỉ mục của mục trong mảng items phải là currentItem đầu tiên (mục sẽ được phát đầu tiên). Lưu ý rằng đây là chỉ mục của mảng (bắt đầu từ 0) chứ không phải là itemId (vì hệ thống sẽ không biết đến khi tạo hàng đợi). Nếu repeatMode là chrome.cast.media.RepeatMode.OFF thì quá trình phát sẽ kết thúc khi mục cuối cùng trong mảng được phát (các phần tử trước startIndex sẽ không được phát). Điều này có thể hữu ích cho các trường hợp tiếp tục mà trong đó người dùng đã sử dụng ứng dụng của người gửi và quyết định truyền ở giữa. Bằng cách này, ứng dụng của người gửi không cần liên kết giữa vị trí hàng đợi cục bộ và hàng đợi từ xa hay lưu thêm một yêu cầu để cập nhật hàng đợi.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eQueueLoadRequest\u003c/code\u003e is used to load and potentially start playing a new, ordered list of media items on a Cast receiver.\u003c/p\u003e\n"],["\u003cp\u003eIt requires an array of \u003ccode\u003eQueueItem\u003c/code\u003e objects, specifying the media to be loaded and played.\u003c/p\u003e\n"],["\u003cp\u003eOptions for playback behavior include \u003ccode\u003ecustomData\u003c/code\u003e, \u003ccode\u003erepeatMode\u003c/code\u003e, and \u003ccode\u003estartIndex\u003c/code\u003e for controlling how the queue is handled.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003erepeatMode\u003c/code\u003e determines how the queue behaves after the last item is played (e.g., repeating the queue, repeating a single item, or stopping).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003estartIndex\u003c/code\u003e allows you to specify which item in the queue should be played first, useful for resuming playback from a specific point.\u003c/p\u003e\n"]]],["The `QueueLoadRequest` class manages loading and playing an ordered list of media items. It requires a non-empty array of `QueueItem` objects. Key properties include `items` (the media list), `repeatMode` (playback behavior after an item ends), `startIndex` (specifying the first item to play by its index), and `customData` (for receiver app customization). `startIndex` defaults to 0, and `repeatMode` defaults to OFF. The provided array is sorted by index.\n"],null,["# Class: QueueLoadRequest\n\nchrome.[cast](/cast/docs/reference/web_sender/chrome.cast).[media](/cast/docs/reference/web_sender/chrome.cast.media).QueueLoadRequest\n======================================================================================================================================\n\nclass static\n\nA request to load and optionally start playback of a new ordered list of\nmedia items.\n\nConstructor\n-----------\n\n### QueueLoadRequest\n\nnew\nQueueLoadRequest(items)\n\n| #### Parameter ||\n|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| items | Array of non-null [chrome.cast.media.QueueItem](/cast/docs/reference/web_sender/chrome.cast.media.QueueItem) The list of media items to load. Must not be null or empty. Value must not be null. |\n\nProperties\n----------\n\n### customData\n\nnullable Object\n\nCustom data for the receiver application.\n\n### items\n\nnon-null Array of non-null [chrome.cast.media.QueueItem](/cast/docs/reference/web_sender/chrome.cast.media.QueueItem)\n\nArray of items to load. It is sorted (first element will be played\nfirst). Must not be null or empty.\n\n### repeatMode\n\nnon-null [chrome.cast.media.RepeatMode](/cast/docs/reference/web_sender/chrome.cast.media#.RepeatMode)\n\nThe algorithm for selection of the next item when the current item has\nended.\n\nDefault value\n: chrome.cast.media.RepeatMode.OFF\n\n### startIndex\n\nnumber\n\nThe index of the item in the items array that must be the first\ncurrentItem (the item that will be played first). Note this is the index\nof the array (starts at 0) and not the itemId (as it is not known until\nthe queue is created). If repeatMode is chrome.cast.media.RepeatMode.OFF\nplayback will end when the last item in the array is played (elements\nbefore the startIndex will not be played). This may be useful for\ncontinuation scenarios where the user was already using the sender app\nand in the middle decides to cast. In this way the sender app does not\nneed to map between the local and remote queue positions or saves one\nextra request to update the queue.\n\nDefault value\n: 0"]]