# cast.framework

namespace static

This is the cast.framework namespace.

## Classes

### [ActiveInputStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ActiveInputStateEventData)

Receiver active input state changed event data.

### [ApplicationMetadata](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ApplicationMetadata)

Cast application metadata.

### [ApplicationMetadataEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ApplicationMetadataEventData)

Application metadata changed event data.

### [ApplicationStatusEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ApplicationStatusEventData)

Application status text changed event data.

### [CastContext](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext)

Manages cast interaction. A singleton object that is fetched using
getInstance.
Manages states - provide the state of the cast icon, and session object.
Cast interaction is not supported till the cast options are provided by
setOptions.

### [CastOptions](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastOptions)

Page cast options.

### [CastSession](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastSession)

Manages a cast session.

### [CastStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastStateEventData)

Data for cast state changed event.

### [EventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.EventData)

Generic cast event data. Provide the event type.

### [MediaSessionEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.MediaSessionEventData)

Media session changed event data.

### [RemotePlayer](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer)

Remote player properties which are updated by
`cast.framework.RemotePlayerController`.

### [RemotePlayerChangedEvent](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayerChangedEvent)

Remote player field change event.

### [RemotePlayerController](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayerController)

Cast remote player controller, which provides data binding for a remote
player to the cast state. It manages a player object and updates its
properties, providing events for player changes.

### [SessionStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.SessionStateEventData)

Data for session state changed event.

### [VolumeEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.VolumeEventData)

Receiver volume or mute changed event data.

## Enumerations

### ActiveInputState

static

number

The possible states of the receiver active-input.

| #### Value ||
|---|---|
| ACTIVE_INPUT_STATE_UNKNOWN | number Indicates that it is not known (and/or not possible to know) whether the Google cast device is the currently active video input. Active input state can only be reported when the Google cast device is connected to a TV or AVR with CEC support. |
| ACTIVE_INPUT_STATE_NO | number Indicates that the Google cast device is not the currently active video input. |
| ACTIVE_INPUT_STATE_YES | number Indicates that the Google cast device is the currently active video input. |

### CastContextEventType

static

string

The events that [cast.framework.CastContext](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext) supports.

| #### Value ||
|---|---|
| CAST_STATE_CHANGED | string Event to track cast icon state. Event data is of type [cast.framework.CastStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastStateEventData). |
| SESSION_STATE_CHANGED | string Event to track current cast session. Event data is of type [cast.framework.SessionStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.SessionStateEventData). |

### CastState

static

string

The possible casting states.

| #### Value ||
|---|---|
| NO_DEVICES_AVAILABLE | string No cast devices are available. |
| NOT_CONNECTED | string Cast devices are available, but a cast session is not established. |
| CONNECTING | string Cast session is being established. |
| CONNECTED | string Cast session is established. |

### LoggerLevel

static

number

Logging levels for cast framework.

| #### Value ||
|---|---|
| DEBUG | number Debug logging (all messages). |
| INFO | number Info logging (events, general logs). |
| WARNING | number warning logging (warnings). |
| ERROR | number Error logging (errors). |
| NONE | number No logging. |

### RemotePlayerEventType

static

string

Event types for changes of [cast.framework.RemotePlayer](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer) data.

| #### Value ||
|---|---|
| ANY_CHANGE | string Any property has changed. Useful for an Angular binding application, where angular needs to be notified everytime a property is changed. |
| IS_CONNECTED_CHANGED | string Property [isConnected](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isConnected) has changed. |
| IS_MEDIA_LOADED_CHANGED | string Property [isMediaLoaded](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isMediaLoaded) has changed. |
| QUEUE_DATA_CHANGED | string Property [queueData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#queueData) has changed. |
| VIDEO_INFO_CHANGED | string Property [videoInfo](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#videoInfo) has changed. |
| DURATION_CHANGED | string Property [duration](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#duration) has changed. |
| CURRENT_TIME_CHANGED | string Property [currentTime](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentTime) has changed. |
| IS_PAUSED_CHANGED | string Property [isPaused](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isPaused) has changed. |
| VOLUME_LEVEL_CHANGED | string Property [volumeLevel](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#volumeLevel) has changed. |
| CAN_CONTROL_VOLUME_CHANGED | string Property [canControlVolume](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#canControlVolume) has changed. |
| IS_MUTED_CHANGED | string Property [isMuted](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isMuted) has changed. |
| CAN_PAUSE_CHANGED | string Property [canPause](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#canPause) has changed. |
| CAN_SEEK_CHANGED | string Property [canSeek](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#canSeek) has changed. |
| DISPLAY_NAME_CHANGED | string Property [displayName](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#displayName) has changed. |
| STATUS_TEXT_CHANGED | string Property [statusText](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#statusText) has changed. |
| TITLE_CHANGED | string Property [title](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#title) has changed. |
| DISPLAY_STATUS_CHANGED | string Property [displayStatus](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#displayStatus) has changed. |
| MEDIA_INFO_CHANGED | string Property [mediaInfo](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#mediaInfo) has changed. |
| IMAGE_URL_CHANGED | string Property [imageUrl](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#imageUrl) has changed. |
| PLAYER_STATE_CHANGED | string Property [playerState](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#playerState) has changed. |
| IS_PLAYING_BREAK_CHANGED | string Property [isPlayingBreak](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isPlayingBreak) has changed. |
| NUMBER_BREAK_CLIPS_CHANGED | string Property [numberBreakClips](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#numberBreakClips) has changed. |
| CURRENT_BREAK_CLIP_NUMBER_CHANGED | string Property [currentBreakClipNumber](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentBreakClipNumber) has changed. |
| CURRENT_BREAK_TIME_CHANGED | string Property [currentBreakTime](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentBreakTime) has changed. |
| CURRENT_BREAK_CLIP_TIME_CHANGED | string Property [currentBreakClipTime](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentBreakClipTime) has changed. |
| BREAK_ID_CHANGED | string Property [breakId](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#breakId) has changed. |
| BREAK_CLIP_ID_CHANGED | string Property [breakClipId](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#breakClipId) has changed. |
| WHEN_SKIPPABLE_CHANGED | string Property [whenSkippable](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#whenSkippable) has changed. |
| LIVE_SEEKABLE_RANGE_CHANGED | string Property [liveSeekableRange](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#liveSeekableRange) has changed. |

### SessionEventType

static

string

The events that [cast.framework.CastSession](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastSession) supports.

| #### Value ||
|---|---|
| APPLICATION_STATUS_CHANGED | string Application status text has changed. Event data is of type [cast.framework.ApplicationStatusEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ApplicationStatusEventData). |
| APPLICATION_METADATA_CHANGED | string Application metadata has changed. Event data is of type [cast.framework.ApplicationMetadataEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ApplicationMetadataEventData). |
| ACTIVE_INPUT_STATE_CHANGED | string Receiver active input state has changed. Event data is of type [cast.framework.ActiveInputStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ActiveInputStateEventData). |
| VOLUME_CHANGED | string Receiver volume or mute status has changed. Event data is of type [cast.framework.VolumeEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.VolumeEventData). |
| MEDIA_SESSION | string Started a new media session. Event data is of type [cast.framework.MediaSessionEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.MediaSessionEventData). |

### SessionState

static

string

The possible cast session states.

| #### Value ||
|---|---|
| NO_SESSION | string Cast session is not established. |
| SESSION_STARTING | string Cast session is being established. |
| SESSION_STARTED | string Cast session is established. |
| SESSION_START_FAILED | string Cast session failed to start. Failure reason is provided in the event data [cast.framework.SessionStateEventData#errorCode](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.SessionStateEventData#errorCode) field. |
| SESSION_ENDING | string Cast session is being disconnected. |
| SESSION_ENDED | string Cast session is disconnected. |
| SESSION_RESUMED | string Connection to an already existing session is established. |

## Properties

### ActiveInputState

static

number

The possible states of the receiver active-input.

| #### Value ||
|---|---|
| ACTIVE_INPUT_STATE_UNKNOWN | number Indicates that it is not known (and/or not possible to know) whether the Google cast device is the currently active video input. Active input state can only be reported when the Google cast device is connected to a TV or AVR with CEC support. |
| ACTIVE_INPUT_STATE_NO | number Indicates that the Google cast device is not the currently active video input. |
| ACTIVE_INPUT_STATE_YES | number Indicates that the Google cast device is the currently active video input. |

### CastContextEventType

static

string

The events that [cast.framework.CastContext](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext) supports.

| #### Value ||
|---|---|
| CAST_STATE_CHANGED | string Event to track cast icon state. Event data is of type [cast.framework.CastStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastStateEventData). |
| SESSION_STATE_CHANGED | string Event to track current cast session. Event data is of type [cast.framework.SessionStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.SessionStateEventData). |

### CastState

static

string

The possible casting states.

| #### Value ||
|---|---|
| NO_DEVICES_AVAILABLE | string No cast devices are available. |
| NOT_CONNECTED | string Cast devices are available, but a cast session is not established. |
| CONNECTING | string Cast session is being established. |
| CONNECTED | string Cast session is established. |

### LoggerLevel

static

number

Logging levels for cast framework.

| #### Value ||
|---|---|
| DEBUG | number Debug logging (all messages). |
| INFO | number Info logging (events, general logs). |
| WARNING | number warning logging (warnings). |
| ERROR | number Error logging (errors). |
| NONE | number No logging. |

### RemotePlayerEventType

static

string

Event types for changes of [cast.framework.RemotePlayer](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer) data.

| #### Value ||
|---|---|
| ANY_CHANGE | string Any property has changed. Useful for an Angular binding application, where angular needs to be notified everytime a property is changed. |
| IS_CONNECTED_CHANGED | string Property [isConnected](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isConnected) has changed. |
| IS_MEDIA_LOADED_CHANGED | string Property [isMediaLoaded](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isMediaLoaded) has changed. |
| QUEUE_DATA_CHANGED | string Property [queueData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#queueData) has changed. |
| VIDEO_INFO_CHANGED | string Property [videoInfo](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#videoInfo) has changed. |
| DURATION_CHANGED | string Property [duration](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#duration) has changed. |
| CURRENT_TIME_CHANGED | string Property [currentTime](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentTime) has changed. |
| IS_PAUSED_CHANGED | string Property [isPaused](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isPaused) has changed. |
| VOLUME_LEVEL_CHANGED | string Property [volumeLevel](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#volumeLevel) has changed. |
| CAN_CONTROL_VOLUME_CHANGED | string Property [canControlVolume](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#canControlVolume) has changed. |
| IS_MUTED_CHANGED | string Property [isMuted](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isMuted) has changed. |
| CAN_PAUSE_CHANGED | string Property [canPause](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#canPause) has changed. |
| CAN_SEEK_CHANGED | string Property [canSeek](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#canSeek) has changed. |
| DISPLAY_NAME_CHANGED | string Property [displayName](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#displayName) has changed. |
| STATUS_TEXT_CHANGED | string Property [statusText](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#statusText) has changed. |
| TITLE_CHANGED | string Property [title](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#title) has changed. |
| DISPLAY_STATUS_CHANGED | string Property [displayStatus](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#displayStatus) has changed. |
| MEDIA_INFO_CHANGED | string Property [mediaInfo](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#mediaInfo) has changed. |
| IMAGE_URL_CHANGED | string Property [imageUrl](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#imageUrl) has changed. |
| PLAYER_STATE_CHANGED | string Property [playerState](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#playerState) has changed. |
| IS_PLAYING_BREAK_CHANGED | string Property [isPlayingBreak](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#isPlayingBreak) has changed. |
| NUMBER_BREAK_CLIPS_CHANGED | string Property [numberBreakClips](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#numberBreakClips) has changed. |
| CURRENT_BREAK_CLIP_NUMBER_CHANGED | string Property [currentBreakClipNumber](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentBreakClipNumber) has changed. |
| CURRENT_BREAK_TIME_CHANGED | string Property [currentBreakTime](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentBreakTime) has changed. |
| CURRENT_BREAK_CLIP_TIME_CHANGED | string Property [currentBreakClipTime](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#currentBreakClipTime) has changed. |
| BREAK_ID_CHANGED | string Property [breakId](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#breakId) has changed. |
| BREAK_CLIP_ID_CHANGED | string Property [breakClipId](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#breakClipId) has changed. |
| WHEN_SKIPPABLE_CHANGED | string Property [whenSkippable](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#whenSkippable) has changed. |
| LIVE_SEEKABLE_RANGE_CHANGED | string Property [liveSeekableRange](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer#liveSeekableRange) has changed. |

### SessionEventType

static

string

The events that [cast.framework.CastSession](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastSession) supports.

| #### Value ||
|---|---|
| APPLICATION_STATUS_CHANGED | string Application status text has changed. Event data is of type [cast.framework.ApplicationStatusEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ApplicationStatusEventData). |
| APPLICATION_METADATA_CHANGED | string Application metadata has changed. Event data is of type [cast.framework.ApplicationMetadataEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ApplicationMetadataEventData). |
| ACTIVE_INPUT_STATE_CHANGED | string Receiver active input state has changed. Event data is of type [cast.framework.ActiveInputStateEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.ActiveInputStateEventData). |
| VOLUME_CHANGED | string Receiver volume or mute status has changed. Event data is of type [cast.framework.VolumeEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.VolumeEventData). |
| MEDIA_SESSION | string Started a new media session. Event data is of type [cast.framework.MediaSessionEventData](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.MediaSessionEventData). |

### SessionState

static

string

The possible cast session states.

| #### Value ||
|---|---|
| NO_SESSION | string Cast session is not established. |
| SESSION_STARTING | string Cast session is being established. |
| SESSION_STARTED | string Cast session is established. |
| SESSION_START_FAILED | string Cast session failed to start. Failure reason is provided in the event data [cast.framework.SessionStateEventData#errorCode](https://developers.google.com/cast/docs/reference/web_sender/cast.framework.SessionStateEventData#errorCode) field. |
| SESSION_ENDING | string Cast session is being disconnected. |
| SESSION_ENDED | string Cast session is disconnected. |
| SESSION_RESUMED | string Connection to an already existing session is established. |

### VERSION

constant static

string

Current sender Cast Framework version.

## Method

### setLoggerLevel

static

setLoggerLevel(level)

Set the logging level for cast.

| #### Parameter ||
|---|---|
| level | [cast.framework.LoggerLevel](https://developers.google.com/cast/docs/reference/web_sender/cast.framework#.LoggerLevel) Logging level. Value must not be null. |

## Abstract type

### EventType

static

(non-null [cast.framework.CastContextEventType](https://developers.google.com/cast/docs/reference/web_sender/cast.framework#.CastContextEventType), non-null [cast.framework.SessionEventType](https://developers.google.com/cast/docs/reference/web_sender/cast.framework#.SessionEventType), or non-null [cast.framework.RemotePlayerEventType](https://developers.google.com/cast/docs/reference/web_sender/cast.framework#.RemotePlayerEventType))

The supported event types.