Wysyła pytanie, czy aplikacja ma zostać uruchomiona podczas inicjowania interfejsu API, gdy karta jest już rzutowana. Aplikacje w treściach umieszczonych na stronie (np. w elementach iframe) powinny ustawić w tym polu wartość CAST_THIS_TAB, jeśli nie są główną aplikacją na stronie. Ta wartość określa też domyślne zachowanie wyskakującego okienka rozszerzenia na stronie.
Funkcja wywoływana, gdy dostępność odbiornika Cast, który obsługuje aplikację w sessionRequest, jest znana lub ulega zmianie. Ta funkcja będzie zawsze wywoływana co najmniej raz po zakończeniu inicjowania.
Detektor jest wywoływany podczas tworzenia sesji lub łączenia się przez pakiet SDK.
Ta funkcja może zostać wywołana po zainicjowaniu, jeśli istnieje sesja, która zostanie utworzona lub połączona automatycznie. Zwróć uwagę, że metoda requestSession nie powoduje wywołania tego detektora, ponieważ ma on własne wywołanie zwrotne.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[[["\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."]]