يطلب ما إذا كان يجب تشغيل التطبيق عند إعداد واجهة برمجة التطبيقات
عندما تكون علامة التبويب قيد البث. ويجب أن تضبط التطبيقات المضمّنة في المحتوى المضمّن (مثل إطارات iframe) هذا الحقل على CAST_THIS_TAB إذا لم يكن التطبيق الرئيسي
على الصفحة. تضبط هذه القيمة أيضًا السلوك التلقائي للنافذة المنبثقة للإضافة في الصفحة.
تم تفعيل هذه الوظيفة عند معرفة مدى توفّر جهاز استقبال بث متوافق مع
التطبيق في sessionRequest أو يتغير. وسيتم استدعاء هذه الدالة دائمًا مرة واحدة على الأقل بعد اكتمال عملية الإعداد.
تم استدعاء أداة معالجة عند إنشاء جلسة أو ربطها بواسطة حزمة تطوير البرامج (SDK).
وقد يتم استدعاء هذه الدالة بعد الإعداد إذا كانت هناك جلسة تم إنشاؤها أو ربطها تلقائيًا. يُرجى العلم أنّ
طريقة requestSession لا تؤدي إلى استدعاء هذا المستمع،
لأن لها استدعاء خاص بها للنجاح.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003echrome.cast.ApiConfig\u003c/code\u003e holds the configuration for the Cast API and is initialized with parameters like session request, listeners, and policies.\u003c/p\u003e\n"],["\u003cp\u003eIt defines how the application interacts with Cast sessions, including automatic connection (autoJoinPolicy) and behavior when a tab is already casting (defaultActionPolicy).\u003c/p\u003e\n"],["\u003cp\u003eProperties like \u003ccode\u003esessionRequest\u003c/code\u003e and \u003ccode\u003esessionListener\u003c/code\u003e manage session creation and connection, while \u003ccode\u003ereceiverListener\u003c/code\u003e handles receiver availability updates.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can configure \u003ccode\u003eApiConfig\u003c/code\u003e to customize the Cast integration within their applications, controlling aspects like session management and receiver interaction.\u003c/p\u003e\n"]]],[],null,["# Class: ApiConfig\n\nchrome.[cast](/cast/docs/reference/web_sender/chrome.cast).ApiConfig\n====================================================================\n\nclass static\n\nHolds the configuration for the API when initialized.\n\nConstructor\n-----------\n\n### ApiConfig\n\nnew\nApiConfig(sessionRequest, sessionListener, receiverListener, autoJoinPolicy, defaultActionPolicy)\n\n| #### Parameter ||\n|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| sessionRequest | [chrome.cast.SessionRequest](/cast/docs/reference/web_sender/chrome.cast.SessionRequest) The session request. Value must not be null. |\n| sessionListener | function(non-null [chrome.cast.Session](/cast/docs/reference/web_sender/chrome.cast.Session)) A listener to notify when a session is available to the application. |\n| receiverListener | function(non-null [chrome.cast.ReceiverAvailability](/cast/docs/reference/web_sender/chrome.cast#.ReceiverAvailability)) A listener to notify when there is a receiver available. |\n| autoJoinPolicy | Optional [chrome.cast.AutoJoinPolicy](/cast/docs/reference/web_sender/chrome.cast#.AutoJoinPolicy) The auto join policy for the application. Value must not be null. |\n| defaultActionPolicy | Optional [chrome.cast.DefaultActionPolicy](/cast/docs/reference/web_sender/chrome.cast#.DefaultActionPolicy) The default action to take when the user is already casting when the application is initialized. Value must not be null. |\n\nProperties\n----------\n\n### autoJoinPolicy\n\nnon-null [chrome.cast.AutoJoinPolicy](/cast/docs/reference/web_sender/chrome.cast#.AutoJoinPolicy)\n\nDetermines whether the SDK will automatically connect to a running\nsession after initialization.\n\n### defaultActionPolicy\n\nnon-null [chrome.cast.DefaultActionPolicy](/cast/docs/reference/web_sender/chrome.cast#.DefaultActionPolicy)\n\nRequests whether the application should be launched on API initialization\nwhen the tab is already being cast. Apps in embedded content (like\niframes) should set this field to CAST_THIS_TAB if they are not the main\napp on the page. This value also configures the default behavior of the\nextension popup for the page.\n\n### receiverListener\n\nfunction(non-null [chrome.cast.ReceiverAvailability](/cast/docs/reference/web_sender/chrome.cast#.ReceiverAvailability))\n\nFunction invoked when the availability of a Cast receiver that supports\nthe application in sessionRequest is known or changes. This function\nwill always be invoked at least once after initialization completes.\n\n### sessionListener\n\nfunction(non-null [chrome.cast.Session](/cast/docs/reference/web_sender/chrome.cast.Session))\n\nListener invoked when a session is created or connected by the SDK.\nThis function may be invoked after initialization, if there is a\nsession that is automatically created or connected. Note that\nrequestSession method does not cause this listener to be invoked,\nsince it has its own success callback.\n\n### sessionRequest\n\nnon-null [chrome.cast.SessionRequest](/cast/docs/reference/web_sender/chrome.cast.SessionRequest)\n\nDescribes the session to launch or the session to connect."]]