AI-generated Key Takeaways
- 
          
The
cast.framework.systemnamespace provides classes and enumerations for handling system-related events and data within a Cast receiver application. - 
          
Classes like
ApplicationData,Sender, andSystemVolumeDatadescribe various system components and states. - 
          
Events such as
ReadyEvent,SenderConnectedEvent, andSystemVolumeChangedEventare dispatched bycast.framework.CastReceiverContextto notify the application of system changes. - 
          
Enumerations define possible values for device capabilities, disconnect reasons, event types, launch methods, message types, and system states like standby and visibility.
 - 
          
The
DeviceCapabilitiesenumeration provides information about the capabilities of the Cast-enabled device and connected display. 
cast.framework. system
            This is the cast.framework.system namespace.
Classes
ApplicationData
Metadata describing the data of the launched application.
Event
An event dispatched by cast.framework.CastReceiverContext which contains system information.
FeedbackStartedEvent
An event dispatched by cast.framework.CastReceiverContext when the system starts to create a feedback report.
MaxVideoResolutionChangedEvent
An event dispatched by cast.framework.CastReceiverContext when the system needs to update the restriction on maximum video resolution.
Message
A custom message received from a sender. To listen for custom events use the cast.framework.CastReceiverContext#addCustomMessageListener method.
ReadyEvent
An event dispatched by cast.framework.CastReceiverContext when the system is ready.
Sender
This represents the data of a connected sender device.
SenderConnectedEvent
An event dispatched by cast.framework.CastReceiverContext when a sender is connected.
SenderDisconnectedEvent
An event dispatched by cast.framework.CastReceiverContext when a sender is disconnected.
ShutdownEvent
An event dispatched by cast.framework.CastReceiverContext when the application is shut down.
StandbyChangedEvent
An event dispatched by cast.framework.CastReceiverContext when the TV
                enters or leaves the standby state, so the application should always verify
                the isStandby property. To know if the actual status is unknown, the
                application can call the
                cast.framework.CastReceiverContext#getStandbyState method.
              
SystemVolumeChangedEvent
An event dispatched by cast.framework.CastReceiverContext when the system volume changes.
SystemVolumeData
This represents the system volume data.
VisibilityChangedEvent
An event dispatched by cast.framework.CastReceiverContext when the visibility of the application changes - for instance, when the HDMI input changes, or the TV is turned off.
Enumerations
DeviceCapabilities
string
Describes the capabilities of the current setup, which is made up of the Cast-enabled device and, where applicable, the display device it is connected to.
                      Value | 
                  |
|---|---|
| 
                         AUDIO_ASSISTANT  | 
                      
                         string Audio Assistant support. Examples of Cast-enabled devices with Audio Assistant support include the Google Home and the Google Home Mini.  | 
                    
| 
                         BLUETOOTH_SUPPORTED  | 
                      
                         string Bluetooth support.  | 
                    
| 
                         DISPLAY_SUPPORTED  | 
                      
                         string Display output support. Examples of Cast-enabled devices with display support include Chromecast and Cast TVs. Examples of Cast-enabled devices that lack display support include Chromecast Audio and Google Home.  | 
                    
| 
                         HI_RES_AUDIO_SUPPORTED  | 
                      
                         string High-resolution audio (up to 24-bit / 96KHz) support.  | 
                    
| 
                         IS_DV_SUPPORTED  | 
                      
                         string Dolby Vision support.  | 
                    
| 
                         IS_HDR_SUPPORTED  | 
                      
                         string HDR video support.  | 
                    
| 
                         CAST_LITE_ONLY  | 
                      
                         string Whether this device is running on an audio-only platform. Some APIs may not be fully supported on such platforms.  | 
                    
| 
                         DPAD_INPUT_SUPPORTED  | 
                      
                         string Whether this device supports an input mechanism, such as an unlocking DPAD.  | 
                    
| 
                         TOUCH_INPUT_SUPPORTED  | 
                      
                         string Touch input support. Examples of Cast-enabled device that support touch input include Google Nest Hub and Google Nest Hub Max.  | 
                    
| 
                         IS_GROUP  | 
                      
                         string If the device is a virtual device and represents a group target rather than a physical device.  | 
                    
| 
                         IS_DEVICE_REGISTERED  | 
                      
                         string When set to   | 
                    
| 
                         IS_CBCS_SUPPORTED  | 
                      
                         string When set to   | 
                    
| 
                         IS_DOLBY_ATMOS_SUPPORTED  | 
                      
                         string When set to   | 
                    
DeviceInformation
string
Constants for the valid keys in cast.framework.CastReceiverContext.DeviceInformationObj.
                      Value | 
                  |
|---|---|
| 
                         MODEL_NAME  | 
                      
                         string The name of the device model (ex: Google TV Streamer, Nest Hub, Nest Mini, etc.) if known. 'unknown' if not known.  | 
                    
| 
                         BRAND_NAME  | 
                      
                         string The name of the device brand (ex: Google, LG, Sony, etc.) if known. A blank string if not known.  | 
                    
| 
                         OS_NAME  | 
                      
                         string The name of the device OS (ex: Android, Fuchsia, Linux, etc.) if known. A blank string if not known, or 'not Cast' if this is not a Cast device.  | 
                    
| 
                         OS_VERSION  | 
                      
                         string The version of the device OS (ex: 14.0, etc.) if known. A blank string if not known.  | 
                    
| 
                         ENVIRONMENT  | 
                      
                         string The type of environment the device is inside (ex: home, automotive, plane, hotel, etc.) if known. Typically 'home' for most devices.  | 
                    
| 
                         DEVICE_ID  | 
                      
                         string The unique ID of the receiver device, if known. Will be the same value as the Cast Receiver ID exposed by the Sender SDK. A blank string if not known.  | 
                    
| 
                         METADATA_FROM_FIRMWARE  | 
                      
                         string Whether the device information was provided by the firmware.  | 
                    
DisconnectReason
string
Represents the reason for a disconnect.
                      Value | 
                  |
|---|---|
| 
                         REQUESTED_BY_SENDER  | 
                      
                         string Connection close was actively requested by the sender application (usually triggered by the user).  | 
                    
| 
                         ERROR  | 
                      
                         string There was a protocol error.  | 
                    
| 
                         UNKNOWN  | 
                      
                         string It is unknown if the sender requested to disconnect gracefully by calling
                            | 
                    
EventType
string
System events dispatched by cast.framework.CastReceiverContext.
                      Value | 
                  |
|---|---|
| 
                         READY  | 
                      
                         string Fired when the system is ready.  | 
                    
| 
                         SHUTDOWN  | 
                      
                         string Fired when the application is terminated.  | 
                    
| 
                         SENDER_CONNECTED  | 
                      
                         string Fired when a new sender has connected.  | 
                    
| 
                         SENDER_DISCONNECTED  | 
                      
                         string Fired when a sender has disconnected.  | 
                    
| 
                         ERROR  | 
                      
                         string Fired when there is a system error.  | 
                    
| 
                         SYSTEM_VOLUME_CHANGED  | 
                      
                         string Fired when the system volume has changed.  | 
                    
| 
                         VISIBILITY_CHANGED  | 
                      
                         string Fired when the visibility of the application has changed (for example after a HDMI input change or when the TV is turned off or on and the Cast device is externally-powered). Note that this API has the same effect as the 'webkitvisibilitychange' event raised by the browser. This is provided as the cast.framework.CastReceiverContext API for convenience and to avoid a dependency on a webkit-prefixed event.  | 
                    
| 
                         STANDBY_CHANGED  | 
                      
                         string Fired when the standby state of the TV has changed. This event is related
                          to the cast.framework.system.EventType.VISIBILITY_CHANGED event,
                          because if the TV is in standby mode, the visibility will be  Visibility states are more granular than standby states (because visibility also includes TV channel selection) but are not reliably detected in all TVs. Standby can be used in those cases because most TVs implement it.  | 
                    
| 
                         MAX_VIDEO_RESOLUTION_CHANGED  | 
                      
                         string  | 
                    
| 
                         FEEDBACK_STARTED  | 
                      
                         string Fired when the system starts to create a feedback report.  | 
                    
LaunchedFrom
string
This represents what type of request launched the receiver.
                      Value | 
                  |
|---|---|
| 
                         UNKNOWN  | 
                      
                         string The launch owner could not be determined.  | 
                    
| 
                         DIAL  | 
                      
                         string App was launched by a DIAL request.  | 
                    
| 
                         CAST  | 
                      
                         string App was launched by a Cast V2 request.  | 
                    
| 
                         CLOUD  | 
                      
                         string App was launched by assistant request (for example, by a Google Assistant command).  | 
                    
MessageType
string
Types of custom messages.
                      Value | 
                  |
|---|---|
| 
                         STRING  | 
                      
                         string Messages are free-form strings. The application is responsible for encoding/decoding the information transmitted.  | 
                    
| 
                         JSON  | 
                      
                         string Messages are JSON-encoded. The underlying transport will use a JSON- encoded string.  | 
                    
StandbyState
string
This represents the current standby state reported by the platform. It may be
                UNKNOWN if the Cast platform is unable to determine the state.
              
                      Value | 
                  |
|---|---|
| 
                         STANDBY  | 
                      
                         string  | 
                    
| 
                         NOT_STANDBY  | 
                      
                         string  | 
                    
| 
                         UNKNOWN  | 
                      
                         string  | 
                    
SystemState
string
This represents the current system state.
                      Value | 
                  |
|---|---|
| 
                         NOT_STARTED  | 
                      
                         string The application has not been requested to start yet.  | 
                    
| 
                         STARTING_IN_BACKGROUND  | 
                      
                         string Application is starting but is not visible to the user.  | 
                    
| 
                         STARTING  | 
                      
                         string Application is starting.  | 
                    
| 
                         READY  | 
                      
                         string Application is in the foreground and is ready to send and receive messages.  | 
                    
| 
                         STOPPING_IN_BACKGROUND  | 
                      
                         string Application is stopping while in the background.  | 
                    
| 
                         STOPPING  | 
                      
                         string Application is stopping.  | 
                    
VisibilityState
string
This represents the current visibility state reported by the platform. It may
                be UNKNOWN if the Cast platform is unable to determine the visibility
                state.
                      Value | 
                  |
|---|---|
| 
                         VISIBLE  | 
                      
                         string  | 
                    
| 
                         NOT_VISIBLE  | 
                      
                         string  | 
                    
| 
                         UNKNOWN  | 
                      
                         string  | 
                    
Properties
DeviceCapabilities
string
Describes the capabilities of the current setup, which is made up of the Cast-enabled device and, where applicable, the display device it is connected to.
                      Value | 
                  |
|---|---|
| 
                         AUDIO_ASSISTANT  | 
                      
                         string Audio Assistant support. Examples of Cast-enabled devices with Audio Assistant support include the Google Home and the Google Home Mini.  | 
                    
| 
                         BLUETOOTH_SUPPORTED  | 
                      
                         string Bluetooth support.  | 
                    
| 
                         DISPLAY_SUPPORTED  | 
                      
                         string Display output support. Examples of Cast-enabled devices with display support include Chromecast and Cast TVs. Examples of Cast-enabled devices that lack display support include Chromecast Audio and Google Home.  | 
                    
| 
                         HI_RES_AUDIO_SUPPORTED  | 
                      
                         string High-resolution audio (up to 24-bit / 96KHz) support.  | 
                    
| 
                         IS_DV_SUPPORTED  | 
                      
                         string Dolby Vision support.  | 
                    
| 
                         IS_HDR_SUPPORTED  | 
                      
                         string HDR video support.  | 
                    
| 
                         CAST_LITE_ONLY  | 
                      
                         string Whether this device is running on an audio-only platform. Some APIs may not be fully supported on such platforms.  | 
                    
| 
                         DPAD_INPUT_SUPPORTED  | 
                      
                         string Whether this device supports an input mechanism, such as an unlocking DPAD.  | 
                    
| 
                         TOUCH_INPUT_SUPPORTED  | 
                      
                         string Touch input support. Examples of Cast-enabled device that support touch input include Google Nest Hub and Google Nest Hub Max.  | 
                    
| 
                         IS_GROUP  | 
                      
                         string If the device is a virtual device and represents a group target rather than a physical device.  | 
                    
| 
                         IS_DEVICE_REGISTERED  | 
                      
                         string When set to   | 
                    
| 
                         IS_CBCS_SUPPORTED  | 
                      
                         string When set to   | 
                    
| 
                         IS_DOLBY_ATMOS_SUPPORTED  | 
                      
                         string When set to   | 
                    
DeviceInformation
string
Constants for the valid keys in cast.framework.CastReceiverContext.DeviceInformationObj.
                      Value | 
                  |
|---|---|
| 
                         MODEL_NAME  | 
                      
                         string The name of the device model (ex: Google TV Streamer, Nest Hub, Nest Mini, etc.) if known. 'unknown' if not known.  | 
                    
| 
                         BRAND_NAME  | 
                      
                         string The name of the device brand (ex: Google, LG, Sony, etc.) if known. A blank string if not known.  | 
                    
| 
                         OS_NAME  | 
                      
                         string The name of the device OS (ex: Android, Fuchsia, Linux, etc.) if known. A blank string if not known, or 'not Cast' if this is not a Cast device.  | 
                    
| 
                         OS_VERSION  | 
                      
                         string The version of the device OS (ex: 14.0, etc.) if known. A blank string if not known.  | 
                    
| 
                         ENVIRONMENT  | 
                      
                         string The type of environment the device is inside (ex: home, automotive, plane, hotel, etc.) if known. Typically 'home' for most devices.  | 
                    
| 
                         DEVICE_ID  | 
                      
                         string The unique ID of the receiver device, if known. Will be the same value as the Cast Receiver ID exposed by the Sender SDK. A blank string if not known.  | 
                    
| 
                         METADATA_FROM_FIRMWARE  | 
                      
                         string Whether the device information was provided by the firmware.  | 
                    
DisconnectReason
string
Represents the reason for a disconnect.
                      Value | 
                  |
|---|---|
| 
                         REQUESTED_BY_SENDER  | 
                      
                         string Connection close was actively requested by the sender application (usually triggered by the user).  | 
                    
| 
                         ERROR  | 
                      
                         string There was a protocol error.  | 
                    
| 
                         UNKNOWN  | 
                      
                         string It is unknown if the sender requested to disconnect gracefully by calling
                            | 
                    
EventType
string
System events dispatched by cast.framework.CastReceiverContext.
                      Value | 
                  |
|---|---|
| 
                         READY  | 
                      
                         string Fired when the system is ready.  | 
                    
| 
                         SHUTDOWN  | 
                      
                         string Fired when the application is terminated.  | 
                    
| 
                         SENDER_CONNECTED  | 
                      
                         string Fired when a new sender has connected.  | 
                    
| 
                         SENDER_DISCONNECTED  | 
                      
                         string Fired when a sender has disconnected.  | 
                    
| 
                         ERROR  | 
                      
                         string Fired when there is a system error.  | 
                    
| 
                         SYSTEM_VOLUME_CHANGED  | 
                      
                         string Fired when the system volume has changed.  | 
                    
| 
                         VISIBILITY_CHANGED  | 
                      
                         string Fired when the visibility of the application has changed (for example after a HDMI input change or when the TV is turned off or on and the Cast device is externally-powered). Note that this API has the same effect as the 'webkitvisibilitychange' event raised by the browser. This is provided as the cast.framework.CastReceiverContext API for convenience and to avoid a dependency on a webkit-prefixed event.  | 
                    
| 
                         STANDBY_CHANGED  | 
                      
                         string Fired when the standby state of the TV has changed. This event is related
                          to the cast.framework.system.EventType.VISIBILITY_CHANGED event,
                          because if the TV is in standby mode, the visibility will be  Visibility states are more granular than standby states (because visibility also includes TV channel selection) but are not reliably detected in all TVs. Standby can be used in those cases because most TVs implement it.  | 
                    
| 
                         MAX_VIDEO_RESOLUTION_CHANGED  | 
                      
                         string  | 
                    
| 
                         FEEDBACK_STARTED  | 
                      
                         string Fired when the system starts to create a feedback report.  | 
                    
LaunchedFrom
string
This represents what type of request launched the receiver.
                      Value | 
                  |
|---|---|
| 
                         UNKNOWN  | 
                      
                         string The launch owner could not be determined.  | 
                    
| 
                         DIAL  | 
                      
                         string App was launched by a DIAL request.  | 
                    
| 
                         CAST  | 
                      
                         string App was launched by a Cast V2 request.  | 
                    
| 
                         CLOUD  | 
                      
                         string App was launched by assistant request (for example, by a Google Assistant command).  | 
                    
MessageType
string
Types of custom messages.
                      Value | 
                  |
|---|---|
| 
                         STRING  | 
                      
                         string Messages are free-form strings. The application is responsible for encoding/decoding the information transmitted.  | 
                    
| 
                         JSON  | 
                      
                         string Messages are JSON-encoded. The underlying transport will use a JSON- encoded string.  | 
                    
StandbyState
string
This represents the current standby state reported by the platform. It may be
                UNKNOWN if the Cast platform is unable to determine the state.
              
                      Value | 
                  |
|---|---|
| 
                         STANDBY  | 
                      
                         string  | 
                    
| 
                         NOT_STANDBY  | 
                      
                         string  | 
                    
| 
                         UNKNOWN  | 
                      
                         string  | 
                    
SystemState
string
This represents the current system state.
                      Value | 
                  |
|---|---|
| 
                         NOT_STARTED  | 
                      
                         string The application has not been requested to start yet.  | 
                    
| 
                         STARTING_IN_BACKGROUND  | 
                      
                         string Application is starting but is not visible to the user.  | 
                    
| 
                         STARTING  | 
                      
                         string Application is starting.  | 
                    
| 
                         READY  | 
                      
                         string Application is in the foreground and is ready to send and receive messages.  | 
                    
| 
                         STOPPING_IN_BACKGROUND  | 
                      
                         string Application is stopping while in the background.  | 
                    
| 
                         STOPPING  | 
                      
                         string Application is stopping.  | 
                    
VisibilityState
string
This represents the current visibility state reported by the platform. It may
                be UNKNOWN if the Cast platform is unable to determine the visibility
                state.
                      Value | 
                  |
|---|---|
| 
                         VISIBLE  | 
                      
                         string  | 
                    
| 
                         NOT_VISIBLE  | 
                      
                         string  | 
                    
| 
                         UNKNOWN  | 
                      
                         string  | 
                    
Abstract types
DeviceCapabilitiesObj
Describes the object returned by getDeviceCapabilities
DeviceInformationObj
Describes the object returned by getDeviceInformation