تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوفّر إطار عمل Google Cast واجهات برمجة تطبيقات لإضافة قوائم الانتظار تتيح إنشاء قوائم.
عناصر المحتوى، مثل عمليات بث الفيديو أو الصوت، لتشغيلها بالتتابع على الويب
المتلقّي يمكن تعديل قائمة انتظار عناصر المحتوى وإعادة ترتيبها وتحديثها، وما إلى ذلك
المقدمة.
تحتفظ "حزمة SDK الخاصة باستقبال الويب" بقائمة الانتظار وتستجيب للعمليات في
قائمة الانتظار طالما أن قائمة الانتظار تتضمن عنصرًا واحدًا على الأقل نشطًا حاليًا (يتم تشغيل
مؤقتًا). يمكن للمرسلين الانضمام إلى الجلسة وإضافة عناصر إلى قائمة الانتظار. المستلِم
الاحتفاظ بجلسة عناصر قائمة الانتظار إلى أن يكتمل تشغيل العنصر الأخير أو
يوقف المرسل التشغيل وينهي الجلسة، أو إلى أن يوقف المرسل
تحمّل قائمة انتظار جديدة على جهاز المُستلِم. لا يحافظ المستلِم على
معلومات حول قوائم الانتظار التي تم إنهاؤها بشكل تلقائي. عندما يصبح العنصر الأخير في قائمة الانتظار
وتنتهي جلسة الوسائط وتختفي قائمة الانتظار.
إنشاء عناصر قائمة انتظار الوسائط وتحميلها
في iOS، يتم تمثيل عنصر قائمة انتظار الوسائط في إطار عمل البث على شكل
مثال واحد (GCKMediaQueueItem)
عند إنشاء عنصر في قائمة انتظار الوسائط باستخدام محتوى تكيّفي، يمكنك ضبط
وقت التحميل المسبق بحيث يمكن للمشغل بدء التخزين المؤقت لعنصر قائمة انتظار الوسائط قبل
ينتهي تشغيل العنصر الذي ينتظره في قائمة الانتظار. الاطّلاع على المزيد حول التحميل المُسبق في
الـ
دليل التحميل المُسبق لـ "جهاز استقبال الويب"
ضبط التشغيل التلقائي للعنصر
على "صحيح" تسمح لمستقبل الويب بتشغيلها تلقائيًا. على سبيل المثال:
يمكنك استخدام نمط أداة إنشاء لإنشاء عنصر قائمة انتظار الوسائط على النحو التالي:
يمكنك تحميل صفيف من عناصر قائمة انتظار الوسائط في قائمة الانتظار باستخدام الأدوات المناسبة
طريقة queueLoadItems من
GCKRemoteMediaClient
الصف.
تلقّي تحديث عن حالة قائمة انتظار الوسائط
عندما يحمّل جهاز استقبال الويب عنصرًا قائمة انتظار وسائط، فإنه يعين معرفًا فريدًا
عنصر قائم طوال مدة الجلسة (وعمر قائمة الانتظار).
يمكنك الاطّلاع على حالة قائمة الانتظار التي تشير إلى العنصر المُحمَّل حاليًا.
(قد لا يتم تشغيله) أو تحميله أو تحميله مسبقًا يمكنك أيضًا الحصول على طلب
قائمة بجميع العناصر في قائمة الانتظار. تشير رسالة الأشكال البيانية
GCKMediaStatus
الفئة معلومات الحالة التالية:
preloadedItemID
السمة - معرّف السلعة التي تمّ تحميلها مسبقًا، إن توفّرت.
loadingItemID
السمة - معرّف العنصر الذي يتم تحميله حاليًا،
currentItemID
الخاصية - معرّف عنصر قائمة الانتظار الحالي، إن وجد.
queueItemCount
الطريقة - لعرض عدد العناصر في قائمة انتظار التشغيل.
queueItemAtIndex
الطريقة - لعرض العنصر في الفهرس المحدد في قائمة انتظار التشغيل.
استخدم هؤلاء الأعضاء مع غيرهم من أعضاء حالة الوسائط لإبلاغ
التطبيق حول حالة قائمة الانتظار والعناصر الموجودة في قائمة الانتظار. بالإضافة إلى
تحديثات حالة الوسائط من مستقبل الويب، فيمكنك الاستماع إلى التغييرات التي تطرأ على
عن طريق تنفيذ -[remoteMediaClientDidUpdateQueue:] من
GCKRemoteMediaClientListener
تعديل قائمة المحتوى التالي
للتعامل مع العناصر الموجودة في قائمة الانتظار، استخدم طرق قائمة الانتظار
GCKRemoteMediaClient
لديك العديد من واجهات برمجة التطبيقات. وهي تتيح لك تحميل صفيف من العناصر في قائمة انتظار جديدة،
إدراج عناصر في قائمة انتظار حالية، وتحديث خصائص العناصر في
قائمة الانتظار، وجعل عنصر ينتقل للأمام أو الخلف في قائمة الانتظار، وتعيين خصائص
قائمة المحتوى التالي نفسها (على سبيل المثال، تغيير repeatMode الذي يختار التالي
ثم إزالة العناصر من قائمة الانتظار وإعادة ترتيب العناصر في قائمة الانتظار.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe Google Cast framework enables the creation and management of media queues on Web Receivers for sequential playback of audio or video content.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can build media queue items, set autoplay and preload times, and load them into the queue using the \u003ccode\u003eGCKRemoteMediaClient\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGCKMediaStatus\u003c/code\u003e class provides information about the queue's status, including the currently playing, loading, and preloaded items.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGCKRemoteMediaClient\u003c/code\u003e offers various methods to edit the queue, such as inserting, updating, removing, and reordering items, as well as controlling queue behavior.\u003c/p\u003e\n"],["\u003cp\u003eSender applications should display the upcoming autoplay item from the queue in their user interface to enhance the user experience.\u003c/p\u003e\n"]]],["The Cast framework enables sequential playback of content items (like audio/video) via queueing APIs. Senders can create, edit, reorder, and update queues. The Web Receiver manages the queue as long as it has an active item, maintaining session until the last item finishes or the session is terminated. In iOS, `GCKMediaQueueItem` represents queue items, with options for autoplay and preloading. `GCKMediaStatus` provides information about the loaded, loading, or preloaded item and the queue status. `GCKRemoteMediaClient` allows to load, insert, update, remove, and reorder items.\n"],null,["# Queueing\n\nThe Cast framework provides queueing APIs that support the creation of lists of\ncontent items, such as video or audio streams, to play sequentially on the Web\nReceiver. The queue of content items may be edited, reordered, updated, and so\nforth.\n| **Note:** Review the [Google Cast Autoplay](/cast/docs/design_checklist/cast-autoplay) for best practices when designing an autoplay or queueing experience for Cast.\n\nThe Web Receiver SDK maintains the queue and responds to operations on the\nqueue as long as the queue has at least one item currently active (playing or\npaused). Senders can join the session and add items to the queue. The receiver\nmaintains a session for queue items until the last item completes playback or\nthe sender stops the playback and terminates the session, or until a sender\nloads a new queue on the receiver. The receiver does not maintain any\ninformation about terminated queues by default. Once the last item in the queue\nfinishes, the media session ends and the queue vanishes.\n| **Note:** The [Styled](/cast/docs/styled_receiver) and [Default Media](/cast/docs/web_receiver#default_media_web_receiver) Receivers only support a queue of audio or video streams. To use a queue of images, you must develop a [Custom Receiver](/cast/docs/web_receiver/basic).\n\nCreate and load media queue items\n---------------------------------\n\nIn iOS, a media queue item is represented in the Cast framework as a\n[`GCKMediaQueueItem` instance](/cast/docs/reference/ios/interface_g_c_k_media_queue_item).\nWhen you create a media queue item with adaptive content, you can set the\npreload time so that the player can begin buffering the media queue item before\nthe item ahead of it in the queue finishes playing. See more about preloading in\nthe\n[Web Receiver preloading guide](/cast/docs/web_receiver/core_features#content_preload).\n\nSetting the item's autoplay\nattribute to true allows the Web Receiver to play it automatically. For example,\nyou can use a builder pattern to create your media queue item as follows:\nSwift \n\n```swift\nlet builder = GCKMediaQueueItemBuilder.init()\nbuilder.mediaInformation = mediaInformation\nbuilder.autoplay = true\nbuilder.preloadTime = 8.0\nlet newItem = builder.build()\n```\nObjective-C \n\n```objective-c\nGCKMediaQueueItemBuilder *builder = [[GCKMediaQueueItemBuilder alloc] init];\nbuilder.mediaInformation = self.mediaInformation;\nbuilder.autoplay = YES;\nbuilder.preloadTime = 8.0;\nGCKMediaQueueItem *newItem = [builder build];\n```\n\nLoad an array of media queue items in the queue by using the appropriate\n`queueLoadItems` method of the\n[`GCKRemoteMediaClient`](/cast/docs/reference/ios/interface_g_c_k_remote_media_client)\nclass.\n\nReceive media queue status update\n---------------------------------\n\nWhen the Web Receiver loads a media queue item, it assigns a unique ID to the\nitem that persists for the duration of the session (and the life of the queue).\nYou can learn the status of the queue indicating which item is currently loaded\n(it might not be playing), loading, or preloaded. You can also get an ordered\nlist of all the items in the queue. The\n[`GCKMediaStatus`](/cast/docs/reference/ios/interface_g_c_k_media_status)\nclass provides this status information:\n\n- [`preloadedItemID`](/cast/docs/reference/ios/interface_g_c_k_media_status#aca544cb983806b859c0d62c6e1438150) property - The ID of the item that is currently preloaded, if any.\n- [`loadingItemID`](/cast/docs/reference/ios/interface_g_c_k_media_status#a0676da67792f35cbea8de2bc9015b05d) property - The ID of the item that is currently loading,\n- [`currentItemID`](/cast/docs/reference/ios/interface_g_c_k_media_status#a1818b62cd378f6648d06042dce494c58) property - The ID of the current queue item, if any.\n- [`queueItemCount`](/cast/docs/reference/ios/interface_g_c_k_media_status#a2ba0ff0a3da66b18520c2858388bc58d) method - Returns the number of items in the playback queue.\n- [`queueItemAtIndex`](/cast/docs/reference/ios/interface_g_c_k_media_status#ad1417e02dca50f0cfd5841c614bd41fa) method - Returns the item at the specified index in the playback queue.\n\nUse these members together with the other media status members to inform your\napp about the status of the queue and the items in the queue. In addition to\nmedia status updates from the Web Receiver, you can listen for changes to the\nqueue by implementing `-[remoteMediaClientDidUpdateQueue:]` of the\n[`GCKRemoteMediaClientListener`](/cast/docs/reference/ios/protocol_g_c_k_remote_media_client_listener-p).\n| **Note:** To provide the best user experience, the sender app must show the next autoplay item in the queue in the sender UI.\n\nEdit the queue\n--------------\n\nTo work with the items in the queue, use the queue methods of\n[`GCKRemoteMediaClient`](/cast/docs/reference/ios/interface_g_c_k_remote_media_client).\nyou have several APIs. These let you load an array of items into a new queue,\ninsert items into an existing queue, update the properties of items in the\nqueue, make an item jump forward or backward in the queue, set the properties of\nthe queue itself (for example, change the `repeatMode` that selects the next\nitem), remove items from the queue, and reorder the items in the queue."]]