Holds the configuration for the API when initialized.
CredentialsDataCredentials data used to identify the credentials of the sender.
DialRequestA request to start a DIAL app.
ErrorDescribes an error returned by the API. Normally, these objects should not be created by the client.
ImageAn image that describes a receiver application or media item. This could be an application icon, cover art, or a thumbnail.
ReceiverDescribes the receiver running an application. Normally, these objects should not be created by the client.
ReceiverDisplayStatusReceiver status shown to the user in the extension UI. Only valid for CUSTOM receivers.
SenderApplicationDescribes a sender application. Normally, these objects should not be created by the client.
SessionDescribes the state of a currently running Cast application. Normally, these objects should not be created by the client.
SessionRequestA request to start or connect to a session.
TimeoutDefines default timeout values in milliseconds for API methods.
VolumeThe volume of a device or media stream.
Namespace media Enumerations AutoJoinPolicystatic
string
Auto-join policy determines when the SDK will automatically connect a sender application to an existing session after API initialization.
ValueTAB_AND_ORIGIN_SCOPED
string
Automatically connects when the session was started with the same appId, in the same tab and page origin.
ORIGIN_SCOPED
string
Automatically connects when the session was started with the same appId and the same page origin (regardless of tab).
PAGE_SCOPED
string
No automatic connection.
static
string
Capabilities that are supported by the receiver device.
ValueVIDEO_OUT
string
The receiver supports video output.
AUDIO_OUT
string
The receiver supports audio output.
VIDEO_IN
string
The receiver supports video input (camera).
AUDIO_IN
string
The receiver supports audio input (microphone).
MULTIZONE_GROUP
string
The receiver represents a multi-zone group.
static
string
Default action policy determines when the SDK will automatically create a session after initializing the API. This also controls the default action for the tab in the extension popup.
ValueCREATE_SESSION
string
If the tab containing the app is being casted when the API initializes, the SDK stops tab casting and automatically launches the app. The extension popup prompts the user to cast the app.
CAST_THIS_TAB
string
No automatic launch is done after initializing the API, even if the tab is being cast. The extension popup prompts the user to cast the tab.
static
string
Possible states of a DIAL application.
ValueRUNNING
string
STOPPED
string
ERROR
string
Not part of the spec, used to signal errors.
static
string
Errors that may be returned by the SDK.
ValueCANCEL
string
The operation was canceled by the user.
TIMEOUT
string
The operation timed out.
API_NOT_INITIALIZED
string
The API is not initialized.
INVALID_PARAMETER
string
The parameters to the operation were not valid.
EXTENSION_NOT_COMPATIBLE
string
The API script is not compatible with the installed Cast extension.
EXTENSION_MISSING
string
The Cast extension is not available.
RECEIVER_UNAVAILABLE
string
No receiver was compatible with the session request.
SESSION_ERROR
string
A session could not be created, or a session was invalid.
CHANNEL_ERROR
string
A channel to the receiver is not available.
LOAD_MEDIA_FAILED
string
Load media failed.
static
string
Actions that the user can take on a receiver in the extension. These can be used to show a transition in the sender application UI before the casting action has fully completed (or failed).
ValueCAST
string
The user selected a receiver with the intent of casting to it with the sender application. The exact identity of the receiver may not be known.
STOP
string
The user requested to stop the session running on a receiver.
static
string
Describes availability of a Cast receiver.
ValueAVAILABLE
string
At least one receiver is available that is compatible with the session request.
UNAVAILABLE
string
No receivers are available.
static
string
ValueCAST
string
Cast receiver, e.g. Chromecast
DIAL
string
DIAL device, e.g. smart TV
HANGOUT
string
Hangout
CUSTOM
string
Custom receiver provided by client
static
string
Describes a sender application platform.
ValueCHROME
string
IOS
string
ANDROID
string
static
string
Describes status of a Cast session to its receiver application.
ValueCONNECTED
string
The session is connected to the receiver application.
DISCONNECTED
string
The session is disconnected from the receiver application. The receiver application may or may not still be running.
STOPPED
string
The receiver application has been stopped.
static
string
Describes types of volume control.
ValueATTENUATION
string
Cast device volume can be changed.
FIXED
string
Cast device volume is fixed and cannot be changed.
MASTER
string
Master system volume control, i.e. TV or Audio device volume is changed.
static
string
Auto-join policy determines when the SDK will automatically connect a sender application to an existing session after API initialization.
ValueTAB_AND_ORIGIN_SCOPED
string
Automatically connects when the session was started with the same appId, in the same tab and page origin.
ORIGIN_SCOPED
string
Automatically connects when the session was started with the same appId and the same page origin (regardless of tab).
PAGE_SCOPED
string
No automatic connection.
static
string
Capabilities that are supported by the receiver device.
ValueVIDEO_OUT
string
The receiver supports video output.
AUDIO_OUT
string
The receiver supports audio output.
VIDEO_IN
string
The receiver supports video input (camera).
AUDIO_IN
string
The receiver supports audio input (microphone).
MULTIZONE_GROUP
string
The receiver represents a multi-zone group.
static
string
Default action policy determines when the SDK will automatically create a session after initializing the API. This also controls the default action for the tab in the extension popup.
ValueCREATE_SESSION
string
If the tab containing the app is being casted when the API initializes, the SDK stops tab casting and automatically launches the app. The extension popup prompts the user to cast the app.
CAST_THIS_TAB
string
No automatic launch is done after initializing the API, even if the tab is being cast. The extension popup prompts the user to cast the tab.
static
string
Possible states of a DIAL application.
ValueRUNNING
string
STOPPED
string
ERROR
string
Not part of the spec, used to signal errors.
static
string
Errors that may be returned by the SDK.
ValueCANCEL
string
The operation was canceled by the user.
TIMEOUT
string
The operation timed out.
API_NOT_INITIALIZED
string
The API is not initialized.
INVALID_PARAMETER
string
The parameters to the operation were not valid.
EXTENSION_NOT_COMPATIBLE
string
The API script is not compatible with the installed Cast extension.
EXTENSION_MISSING
string
The Cast extension is not available.
RECEIVER_UNAVAILABLE
string
No receiver was compatible with the session request.
SESSION_ERROR
string
A session could not be created, or a session was invalid.
CHANNEL_ERROR
string
A channel to the receiver is not available.
LOAD_MEDIA_FAILED
string
Load media failed.
static
boolean
Flag for clients to check whether the API is loaded.
static
string
Actions that the user can take on a receiver in the extension. These can be used to show a transition in the sender application UI before the casting action has fully completed (or failed).
ValueCAST
string
The user selected a receiver with the intent of casting to it with the sender application. The exact identity of the receiver may not be known.
STOP
string
The user requested to stop the session running on a receiver.
static
string
Describes availability of a Cast receiver.
ValueAVAILABLE
string
At least one receiver is available that is compatible with the session request.
UNAVAILABLE
string
No receivers are available.
static
string
ValueCAST
string
Cast receiver, e.g. Chromecast
DIAL
string
DIAL device, e.g. smart TV
HANGOUT
string
Hangout
CUSTOM
string
Custom receiver provided by client
static
string
Describes a sender application platform.
ValueCHROME
string
IOS
string
ANDROID
string
static
string
Describes status of a Cast session to its receiver application.
ValueCONNECTED
string
The session is connected to the receiver application.
DISCONNECTED
string
The session is disconnected from the receiver application. The receiver application may or may not still be running.
STOPPED
string
The receiver application has been stopped.
static
non-null chrome.cast.Timeout
Default timeout values in milliseconds for API methods.
constant static
non-null Array of number
The API version. The first number is the major version, and the second the minor version.
static
string
Describes types of volume control.
ValueATTENUATION
string
Cast device volume can be changed.
FIXED
string
Cast device volume is fixed and cannot be changed.
MASTER
string
Master system volume control, i.e. TV or Audio device volume is changed.
static
addReceiverActionListener(listener)
Adds a listener function that will be invoked when the user has acted through the UI to start or stop casting. The sender application can use this to show a transition in its user interface (i.e., pause locally playing media) before the casting action has completed or failed.
If using Framework API, use cast.framework.CastContext#addEventListener instead and listen to cast.framework.CastContextEventType#CAST_STATE_CHANGED events.
Parameterlistener
chrome.cast.ReceiverActionListener
The listener function to add. The first argument to the listener is the receiver that was acted on. The second argument to the listener is the action that was requested (see chrome.cast.ReceiverAction).
Value must not be null.
static
initialize(apiConfig, successCallback, errorCallback)
Initializes the API. Note that either successCallback and errorCallback will be invoked once the API has finished initialization. The sessionListener and receiverListener may be invoked at any time afterwards, and possibly more than once.
If using Framework API, use cast.framework.CastContext#setOptions instead of this function.
ParameterapiConfig
The object with parameters to initialize the API.
Value must not be null.
successCallback
function()
errorCallback
function(non-null chrome.cast.Error)
The possible errors are TIMEOUT, INVALID_PARAMETER, EXTENSION_MISSING.
static
logMessage(message)
Logs a debug message from the app. This message may be sent in a feedback report to Google if users explicitly choose to include fine logs.
Parametermessage
string
The message to log.
static
precache(data)
Send a request to precache data. If a session is connected it will send a direct request, otherwise it will send to all devices in the network.
Parameterdata
string
Data to precache.
static
removeReceiverActionListener(listener)
Removes a listener function that was previously added with addReceiverActionListener.
static
requestSession(successCallback, errorCallback, sessionRequest)
Requests that a receiver application session be created or joined. By default, the SessionRequest passed to the API at initialization time is used; this may be overridden by passing a different session request in sessionRequest.
If using Framework API, use cast.framework.CastContext#requestSession instead of this function.
ParametersuccessCallback
function(non-null chrome.cast.Session)
errorCallback
function(non-null chrome.cast.Error)
The possible errors are TIMEOUT, INVALID_PARAMETER, API_NOT_INITIALIZED, CANCEL, CHANNEL_ERROR, SESSION_ERROR, RECEIVER_UNAVAILABLE, and EXTENSION_MISSING. Note that the timeout timer starts after users select a receiver. Selecting a receiver requires user's action, which has no timeout. If a session request is already in progress, errorCallback is invoked with INVALID_PARAMETER error code and a description explaining the error.
sessionRequest
Optional
Value must not be null.
static
requestSessionById(sessionId)
Requests to join an existing session with the given id. Once joined, the session will be passed to the sessionListener set by chrome.cast.initialize.
If the session with the given sessionId is already known when this function is called, then sessionListener is called immediately. Otherwise, once a session with the given sessionId is discovered, sessionListener will be called.
ParametersessionId
string
The id of the session to join.
static
setCustomReceivers(receivers, successCallback, errorCallback)
Sets custom receiver list
Parameterreceivers
Array of non-null chrome.cast.Receiver
The new list.
Value must not be null.
successCallback
function()
errorCallback
function(non-null chrome.cast.Error)
The possible errors are TIMEOUT, API_NOT_INITIALIZED, INVALID_PARAMETER, CHANNEL_ERROR, and EXTENSION_MISSRING.
static
setPageContext(win)
Initializes Cast functionality for a page that loads Cast SDK in an iframe. Should be called after the SDK was initialized.
Parameterwin
Window
Page window object.
Value must not be null.
static
setReceiverDisplayStatus(receiver, successCallback, errorCallback)
Sets the receiver name and display status. To show the receiver as idle, set displayStatus to null.
Only valid for CUSTOM receivers. The receiver's displayStatus is ignored if this receiver is CAST; Cast receiver status is updated by the receiver application.
Parameterreceiver
The receiver.
Value must not be null.
successCallback
function()
Callback when setting status succeeds.
errorCallback
function(non-null chrome.cast.Error)
The possible errors are TIMEOUT, INVALID_PARAMETER, API_NOT_INITIALIZED, and EXTENSION_MISSING.
static
unescape(escaped) returns string
Utility method to unescape URI-escaped strings. For example, the receiver friendly name is returned as an URI-escaped string. Use this method to unescape that string if needed.
Parameterescaped
string
A string to unescape
string
Unescaped string
static
ReceiverActionListener()
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3