Hide

Class chrome.cast.ApiConfig

Holds the configuraton for the API when initialized.

Class summary
 
chrome.cast.ApiConfig(sessionRequest, sessionListener, receiverListener, opt_autoJoinPolicy, opt_defaultActionPolicy)
Holds the configuraton for the API when initialized.
Properties summary
chrome.cast.AutoJoinPolicy
must not be null
Determines whether the SDK will automatically connect to a running session after initialization.
chrome.cast.DefaultActionPolicy
must not be null
Requests whether the application should be launched on API initialization when the tab is already being cast.
function(non-nullable chrome.cast.ReceiverAvailability)
Function invoked when the availability of a Cast receiver that supports the application in sessionRequest is known or changes.
function(non-nullable chrome.cast.Session)
Listener invoked when a session is created or connected by the SDK.
chrome.cast.SessionRequest
must not be null
Describes the session to launch or the session to connect.

Class details

chrome.cast.ApiConfig(sessionRequest, sessionListener, receiverListener, opt_autoJoinPolicy, opt_defaultActionPolicy)
Holds the configuraton for the API when initialized.
Parameters:
chrome.cast.SessionRequest sessionRequest
The session request. Must not be null.
function(chrome.cast.Session) sessionListener
A listener to notify when a session is available to the application.
function(chrome.cast.ReceiverAvailability) receiverListener
A listener to notify when there is a receiver available.
chrome.cast.AutoJoinPolicy opt_autoJoinPolicy
The auto join policy for the application. Optional.
chrome.cast.DefaultActionPolicy opt_defaultActionPolicy
The default action to take when the user is already casting when the application is initialized. Optional.

Property details

autoJoinPolicy
chrome.cast.AutoJoinPolicy
Determines whether the SDK will automatically connect to a running session after initialization.
Must not be null.
Default Value:
chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED

defaultActionPolicy
chrome.cast.DefaultActionPolicy
Requests whether the application should be launched on API initialization when the tab is already being cast. Apps in embedded content (like iframes) should set this field to CAST_THIS_TAB if they are not the main app on the page. This value also configures the default behavior of the extension popup for the page.
Must not be null.
Default Value:
chrome.cast.DefaultActionPolicy.CREATE_SESSION

receiverListener
function(non-nullable chrome.cast.ReceiverAvailability)
Function invoked when the availability of a Cast receiver that supports the application in sessionRequest is known or changes. This function will always be invoked at least once after initialization completes.

sessionListener
function(non-nullable chrome.cast.Session)
Listener invoked when a session is created or connected by the SDK. This function may be invoked after initialization, if there is a session that is automatically created or connected. Note that requestSession method does not cause this listener to be invoked, since it has its own success callback.

sessionRequest
chrome.cast.SessionRequest
Describes the session to launch or the session to connect.
Must not be null.