Запрашивает, следует ли запускать приложение при инициализации API, когда вкладка уже транслируется. Приложения во встроенном контенте (например, iframe) должны установить в этом поле значение CAST_THIS_TAB, если они не являются основным приложением на странице. Это значение также определяет поведение всплывающего окна расширения по умолчанию для страницы.
Функция вызывается, когда известно или изменяется доступность приемника Cast, поддерживающего приложение в sessionRequest. Эта функция всегда будет вызываться хотя бы один раз после завершения инициализации.
Прослушиватель вызывается, когда сеанс создается или подключается с помощью SDK. Эту функцию можно вызвать после инициализации, если существует сеанс, который автоматически создается или подключается. Обратите внимание, что метод requestSession не вызывает вызов этого прослушивателя, поскольку у него есть собственный обратный вызов успеха.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-24 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,["chrome.[cast](/cast/docs/reference/web_sender/chrome.cast).ApiConfig \nclass static\n\nHolds the configuration for the API when initialized.\n\nConstructor\n\nApiConfig\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\nautoJoinPolicy\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\ndefaultActionPolicy\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\nreceiverListener\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\nsessionListener\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\nsessionRequest\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."]]