chrome.cast.VERSION
The API version.
chrome.cast.timeout
Default timeout values in milliseconds for API methods.
chrome.cast.ReceiverActionListener
chrome.cast.isAvailable
Flag for clients to check whether the API is loaded.
chrome.cast.initialize
static void
chrome.cast.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.
- Parameters:
- chrome.cast.ApiConfig apiConfig
- The object with parameters to initialize the API. Must not be null.
- function() successCallback
- function(chrome.cast.Error) errorCallback
- The possible errors are TIMEOUT, INVALID_PARAMETER, EXTENSION_MISSING.
chrome.cast.requestSession
static void
chrome.cast.requestSession(successCallback, errorCallback, opt_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 opt_sessionRequest.
- Parameters:
- function(chrome.cast.Session) successCallback
- function(chrome.cast.Error) errorCallback
- 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.
- chrome.cast.SessionRequest opt_sessionRequest
- Optional.
chrome.cast.requestSessionById
static void
chrome.cast.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.
- Parameters:
- string sessionId
- The id of the session to join.
chrome.cast.addReceiverActionListener
static void
chrome.cast.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.
- The listener is not guaranteed to be invoked and applications should not rely on it to function correctly.
- The listener will be passed the receiver that was acted upon, if available. However the receiver may not be known and null will be passed instead.
- The listener will be called as soon as possible after the user has acted. It should be invoked before the application is notified of the resulting state change through the API.
- Parameters:
- chrome.cast.ReceiverActionListener listener
- 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).
chrome.cast.removeReceiverActionListener
static void
chrome.cast.removeReceiverActionListener(listener)
Removes a listener function that was previously added with
addReceiverActionListener.
- Parameters:
- chrome.cast.ReceiverActionListener listener
- The listener function to remove.
chrome.cast.logMessage
static void
chrome.cast.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.
- Parameters:
- string message
- The message to log.
chrome.cast.setCustomReceivers
static void
chrome.cast.setCustomReceivers(receivers, successCallback, errorCallback)
Sets custom receiver list
- Parameters:
- Array of chrome.cast.Receiver receivers
- The new list. Must not be null.
- function() successCallback
- function(chrome.cast.Error) errorCallback
- The possible errors are TIMEOUT, API_NOT_INITIALIZED, INVALID_PARAMETER, CHANNEL_ERROR, and EXTENSION_MISSRING.
chrome.cast.setReceiverDisplayStatus
static void
chrome.cast.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.
- Parameters:
- chrome.cast.Receiver receiver
- The receiver. Must not be null.
- function() successCallback
- Callback when setting status succeeds.
- function(chrome.cast.Error) errorCallback
- The possible errors are TIMEOUT, INVALID_PARAMETER, API_NOT_INITIALIZED, and EXTENSION_MISSING.
chrome.cast.ApiConfig
Holds the configuraton for the API when initialized.
| Properties |
|---|
chrome.cast.AutoJoinPolicy
Auto-join policy determines when the SDK will automatically connect a sender
application to an existing session after API initialization.
| Values |
|---|
chrome.cast.Capability
Capabilities that are supported by the receiver device.
| Values |
|---|
chrome.cast.DefaultActionPolicy
Default action policy determines when the SDK will automatically create a
session after initializing the API.
| Values |
|---|
chrome.cast.Error
Describes an error returned by the API.
| Properties |
|---|
chrome.cast.ErrorCode
Errors that may be returned by the SDK.
| Values |
|---|
chrome.cast.Image
An image that describes a receiver application or media item.
| Properties |
|---|
chrome.cast.media.EditTracksInfoRequest
A request to modify the text tracks style or change the tracks status.
| Properties |
|---|
chrome.cast.media.GenericMediaMetadata
A generic media description.
| Properties |
|---|
chrome.cast.media.GetStatusRequest
A request to get the media status.
| Properties |
|---|
chrome.cast.media.IdleReason
Possible reason why a media is idle.
| Values |
|---|
chrome.cast.media.LoadRequest
A request to load new media into the player.
| Properties |
|---|
chrome.cast.media.Media
Represents a media item that has been loaded into the receiver application.
| Functions | |
|---|---|
| Properties |
chrome.cast.media.MediaCommand
Possible media commands supported by the receiver application.
| Values |
|---|
chrome.cast.media.MediaInfo
Describes a media item.
| Properties |
|---|
chrome.cast.media.MetadataType
Possible types of media metadata.
| Values |
|---|
chrome.cast.media.MovieMediaMetadata
A movie media description.
| Properties |
|---|
chrome.cast.media.MusicTrackMediaMetadata
A music track media description.
| Properties |
|---|
chrome.cast.media.PauseRequest
A request to pause the currently playing media.
| Properties |
|---|
chrome.cast.media.PhotoMediaMetadata
A photo media description.
| Properties |
|---|
chrome.cast.media.PlayerState
Possible states of the media player.
| Values |
|---|
chrome.cast.media.PlayRequest
A request to play the currently paused media.
| Properties |
|---|
chrome.cast.media.ResumeState
States of the media player after resuming.
| Values |
|---|
chrome.cast.media.SeekRequest
A request to seek the current media.
| Properties |
|---|
chrome.cast.media.StopRequest
A request to stop the media player.
| Properties |
|---|
chrome.cast.media.StreamType
Possible media stream types.
| Values |
|---|
chrome.cast.media.TextTrackEdgeType
Possible text track edge types.
| Values |
|---|
chrome.cast.media.TextTrackFontGenericFamily
Possible text track font generic family.
| Values |
|---|
chrome.cast.media.TextTrackFontStyle
Possible text track font style.
| Values |
|---|
chrome.cast.media.TextTrackStyle
Describes style information for a text track.
| Properties |
|---|
chrome.cast.media.TextTrackType
Possible text track types.
| Values |
|---|
chrome.cast.media.TextTrackWindowType
Possible text track window types.
| Values |
|---|
chrome.cast.media.timeout
Default timeout values in milliseconds for media API methods.
| Properties |
|---|
chrome.cast.media.Track
Describes track metadata information.
| Properties |
|---|
chrome.cast.media.TrackType
Possible media track types.
| Values |
|---|
chrome.cast.media.TvShowMediaMetadata
A TV episode media description.
| Properties |
|---|
chrome.cast.media.VolumeRequest
A request to set the stream volume of the playing media.
| Properties |
|---|
chrome.cast.Receiver
Describes the receiver running an application.
| Properties |
|---|
chrome.cast.ReceiverAction
Actions that the user can take on a receiver in the extension.
| Values |
|---|
chrome.cast.ReceiverAvailability
Describes availability of a Cast receiver.
| Values |
|---|
chrome.cast.ReceiverDisplayStatus
Receiver status shown to the user in the extension UI.
| Properties |
|---|
chrome.cast.ReceiverType
| Values |
|---|
chrome.cast.SenderApplication
Describes a sender application.
| Properties |
|---|
chrome.cast.SenderPlatform
Describes a sender application platform.
| Values |
|---|
chrome.cast.Session
Describes the state of a currently running Cast application.
| Functions | |
|---|---|
| Properties |
chrome.cast.SessionRequest
A request to start or connect to a session.
| Properties |
|---|
chrome.cast.SessionStatus
Describes status of a Cast session to its receiver application.
| Values |
|---|
chrome.cast.timeout
Default timeout values in milliseconds for API methods.
| Properties |
|---|
chrome.cast.Volume
The volume of a device or media stream.
| Properties |
|---|