اطلاعات اقلام در صف توسعه دهندگان برنامه ممکن است نیاز به ایجاد یک QueueItem برای درج یک عنصر صف با استفاده از cast.framework.messages.InsertQueueItems داشته باشند. در این مورد، آنها نباید یک itemId ارائه کنند (زیرا itemId واقعی زمانی که آیتم در صف قرار می گیرد، اختصاص داده می شود). این از برخورد ID با موارد اضافه شده از یک برنامه فرستنده جلوگیری می کند.
سازنده
QueueItem
QueueItem جدید (opt_itemId)
پارامتر
opt_itemId
اختیاری
عدد
شناسه مورد
خواص
activeTrackIds
(آرایه اعداد غیر تهی یا تعریف نشده)
آرایه ای از TrackIds که فعال هستند. اگر آرایه ارائه نشده باشد، آهنگ های پیش فرض فعال خواهند بود.
پخش خودکار
(بولی یا تعریف نشده)
اگر پارامتر پخش خودکار مشخص نشده باشد یا درست باشد، پخش کننده رسانه شروع به پخش عنصر در صف زمانی می کند که مورد به عنوان فعلی تبدیل شود.
داده های سفارشی
(شیء باطل یا تعریف نشده)
برنامه می تواند هر گونه اطلاعات صف اضافی مورد نیاز را تعریف کند.
شناسه مورد
(تعداد یا تعریف نشده)
شناسه منحصر به فرد مورد در صف. این ویژگی اختیاری است زیرا برای LOAD یا INSERT نباید ارائه شود (زیرا زمانی که یک مورد برای اولین بار ایجاد/درج می شود توسط گیرنده اختصاص داده می شود).
برای ردیابی سفارش اصلی یک آیتم در صف برای واگرد زدن به هم زدن استفاده می شود.
preloadTime
(تعداد یا تعریف نشده)
این پارامتر اشاره ای به گیرنده برای بارگذاری مجدد این آیتم رسانه قبل از پخش آن است. این امکان انتقال صاف بین آیتم های پخش شده از صف را فراهم می کند. زمان بر حسب ثانیه، نسبت به ابتدای پخش این آیتم (معمولاً پایان پخش آیتم قبلی) بیان می شود. به عنوان مثال، اگر مقدار 10 ثانیه باشد، این مورد 10 ثانیه قبل از اتمام آیتم قبلی از قبل بارگذاری می شود. گیرنده سعی می کند این مقدار را رعایت کند اما آن را تضمین نمی کند، به عنوان مثال اگر مقدار از مدت زمان مورد قبلی بیشتر باشد، گیرنده ممکن است این مورد را مدت کوتاهی پس از شروع پخش آیتم قبلی از قبل بارگذاری کند (هرگز دو مورد از قبل بارگذاری نمی شوند. به موازات). همچنین، اگر یک آیتم درست بعد از currentItem در صف قرار گیرد و زمان پیش بارگذاری بیشتر از زمان باقی مانده در currentItem باشد، پیش بارگذاری در اسرع وقت انجام می شود. مقادیر منفی به صراحت پیش بارگیری را غیرفعال می کنند. اگر مقدار 0 یا تعریف نشده باشد، به محض اینکه مورد قبلی پس از موقعیت پخش به طور کامل بارگیری شد، آیتم رسانه شروع به بارگیری از قبل می کند.
زمان شروع
(تعداد یا تعریف نشده)
چند ثانیه از شروع محتوا. اگر محتوا محتوای زنده باشد و startTime مشخص نشده باشد، پخش جریانی از موقعیت زنده شروع می شود.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eQueueItem\u003c/code\u003e objects represent items within a media queue, holding information like media metadata, playback settings, and custom data.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can create \u003ccode\u003eQueueItem\u003c/code\u003e instances to insert elements into the queue, but should omit the \u003ccode\u003eitemId\u003c/code\u003e for new items to avoid conflicts.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of a \u003ccode\u003eQueueItem\u003c/code\u003e include \u003ccode\u003emedia\u003c/code\u003e for content details, \u003ccode\u003eautoplay\u003c/code\u003e and \u003ccode\u003estartTime\u003c/code\u003e for playback control, and \u003ccode\u003epreloadTime\u003c/code\u003e to optimize transitions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecustomData\u003c/code\u003e property allows developers to attach application-specific information to queue items for extended functionality.\u003c/p\u003e\n"],["\u003cp\u003eExisting queue items can be identified and managed using their unique \u003ccode\u003eitemId\u003c/code\u003e, assigned by the receiver upon insertion.\u003c/p\u003e\n"]]],["`QueueItem` stores queue element information. Developers create it for inserting queue elements, omitting `itemId` to prevent collisions. Key properties include: `activeTrackIds` (active track IDs), `autoplay` (automatic playback), `customData` (extra data), `media` (metadata), `orderId` (original order), `preloadTime` (preloading hint), and `startTime` (content start time). `itemId` is assigned by the receiver during creation/insertion, and `preloadTime` helps smooth transitions between queued items.\n"],null,["# Class: QueueItem\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[messages](/cast/docs/reference/web_receiver/cast.framework.messages).QueueItem\n==================================================================================================================================================\n\nclass static\n\nQueue item information. Application developers may need to create a QueueItem\nto insert a queue element using\ncast.framework.messages.InsertQueueItems. In this case they should\nnot provide an itemId (as the actual itemId will be assigned when the item is\ninserted in the queue). This prevents ID collisions with items added from a\nsender app.\n\nConstructor\n-----------\n\n### QueueItem\n\nnew\nQueueItem(opt_itemId)\n\n| #### Parameter ||\n|------------|------------------------------|\n| opt_itemId | Optional number The item ID. |\n\nProperties\n----------\n\n### activeTrackIds\n\n(non-null Array of number or undefined)\n\nArray of Track trackIds that are active. If the array is not provided,\nthe default tracks will be active.\n\n### autoplay\n\n(boolean or undefined)\n\nIf the autoplay parameter is not specified or is true, the media player\nwill begin playing the element in the queue when the item becomes the\ncurrentItem.\n\n### customData\n\n(nullable Object or undefined)\n\nThe application can define any extra queue item information needed.\n\n### itemId\n\n(number or undefined)\n\nUnique identifier of the item in the queue. The attribute is optional\nbecause for LOAD or INSERT should not be provided (as it will be assigned\nby the receiver when an item is first created/inserted).\n\n### media\n\n(non-null [cast.framework.messages.MediaInformation](/cast/docs/reference/web_receiver/cast.framework.messages.MediaInformation) or undefined)\n\nMetadata (including contentId) of the playlist element.\n\n### orderId\n\n(number or undefined)\n\nUsed to track original order of an item in the queue to undo shuffle.\n\n### preloadTime\n\n(number or undefined)\n\nThis parameter is a hint for the receiver to preload this media item\nbefore it is played. It allows for a smooth transition between items\nplayed from the queue. The time is expressed in seconds, relative to the\nbeginning of this item playback (usually the end of the previous item\nplayback). For example, if the value is 10 seconds, this item will be\npreloaded 10 seconds before the previous item has finished. The receiver\nwill try to honor this value but will not guarantee it, for example if\nthe value is larger than the previous item duration the receiver may just\npreload this item shortly after the previous item has started playing\n(there will never be two items being preloaded in parallel). Also, if an\nitem is inserted in the queue just after the currentItem and the time to\npreload is higher than the time left on the currentItem, the preload will\njust happen as soon as possible. Negative values explicitly disable\npreloading. If the value is 0 or undefined, the media item will start to\npreload as soon as the previous item is fully downloaded after its\nplayback position.\n\n### startTime\n\n(number or undefined)\n\nSeconds since beginning of content. If the content is live content, and\nstartTime is not specified, the stream will start at the live position."]]