chrome.cast. games
This is the chrome.cast.games namespace.
Classes
GameManagerClient
Used to allow a sender to interact with the cast game manager running on the receiver. Keeps track of player, game, and lobby state information and can send requests to the game manager on the receiver.
Do not instantiate this class directly. Instead, use chrome.cast.games.GameManagerClient.getInstanceFor to get an instance.
GameManagerError
Represents an error from the game manager or from the chrome sender SDK.
GameManagerGameMessageReceivedEvent
Event dispatched by chrome.cast.games.GameManagerClient when the receiver sends a game message for a specific player.
GameManagerInstanceResult
Result of a game manager getInstanceFor request.
GameManagerResult
Result of a game manager request to the receiver.
GameManagerState
Immutable class to represent a snapshot of the game manager state.
GameManagerStateChangedEvent
Event dispatched by chrome.cast.games.GameManagerClient when the state of the currently running game has changed.
PlayerInfo
Represents player information maintained by the game manager.
Interface
GameManagerEvent
Enumerations
GameManagerErrorCode
string
Game SDK specific error codes returned by the receiver that extend the codes from chrome.cast.ErrorCode.
Value |
|
---|---|
INVALID_REQUEST |
Error code indicating the request is invalid or contains invalid parameters. |
NOT_ALLOWED |
Error code indicating that the request was disallowed and could not be completed. |
INCORRECT_VERSION |
Error code indicating the SDK version in the request does not match the version expected by the game manager. |
TOO_MANY_PLAYERS |
Error code indicating the number of players connected and available on the receiver is greater than the maximum number of players specified in the configuration object for the receiver game. |
GameManagerEventType
string
Event types dispatched by chrome.cast.games.GameManagerClient.
Value |
|
---|---|
UNKNOWN |
The event is undefined. |
STATE_CHANGED |
Triggered by chrome.cast.games.GameManagerClient when the state of the currently running game has changed. The listener for this event will use chrome.cast.games.GameManagerStateChangedEvent. |
GAME_MESSAGE_RECEIVED |
Triggered by chrome.cast.games.GameManagerClient when the receiver sends a game message for a specific player. The listener for this event will use chrome.cast.games.GameManagerGameMessageReceivedEvent. |
GameplayState
number
Represents the game manager states.
Value |
|
---|---|
UNKNOWN |
Unknown game state. |
LOADING |
Game state for when the game is loading. |
RUNNING |
Game state for when the game is running. |
PAUSED |
Game state for when the game is paused. |
SHOWING_INFO_SCREEN |
Game state for when the game is showing an information screen. |
LobbyState
number
Represents the game lobby states.
Value |
|
---|---|
UNKNOWN |
Unknown lobby state. |
OPEN |
Lobby is open and accepting players to join. |
CLOSED |
Lobby is closed and not accepting players. |
PlayerState
number
Represents the player states.
Value |
|
---|---|
UNKNOWN |
Unknown player state. |
DROPPED |
The player is no longer connected to the receiver because of a network drop. |
QUIT |
The player has manually chosen to disconnect from the receiver. |
AVAILABLE |
The player is connected to the receiver and available to join a game. |
READY |
The player is connected to the receiver, and ready to enter the game. |
IDLE |
The player is connected to the receiver, in the game, and idle. |
PLAYING |
The player is in the game and actively playing. |
Properties
GameManagerErrorCode
string
Game SDK specific error codes returned by the receiver that extend the codes from chrome.cast.ErrorCode.
Value |
|
---|---|
INVALID_REQUEST |
Error code indicating the request is invalid or contains invalid parameters. |
NOT_ALLOWED |
Error code indicating that the request was disallowed and could not be completed. |
INCORRECT_VERSION |
Error code indicating the SDK version in the request does not match the version expected by the game manager. |
TOO_MANY_PLAYERS |
Error code indicating the number of players connected and available on the receiver is greater than the maximum number of players specified in the configuration object for the receiver game. |
GameManagerEventType
string
Event types dispatched by chrome.cast.games.GameManagerClient.
Value |
|
---|---|
UNKNOWN |
The event is undefined. |
STATE_CHANGED |
Triggered by chrome.cast.games.GameManagerClient when the state of the currently running game has changed. The listener for this event will use chrome.cast.games.GameManagerStateChangedEvent. |
GAME_MESSAGE_RECEIVED |
Triggered by chrome.cast.games.GameManagerClient when the receiver sends a game message for a specific player. The listener for this event will use chrome.cast.games.GameManagerGameMessageReceivedEvent. |
GameplayState
number
Represents the game manager states.
Value |
|
---|---|
UNKNOWN |
Unknown game state. |
LOADING |
Game state for when the game is loading. |
RUNNING |
Game state for when the game is running. |
PAUSED |
Game state for when the game is paused. |
SHOWING_INFO_SCREEN |
Game state for when the game is showing an information screen. |
LobbyState
number
Represents the game lobby states.
Value |
|
---|---|
UNKNOWN |
Unknown lobby state. |
OPEN |
Lobby is open and accepting players to join. |
CLOSED |
Lobby is closed and not accepting players. |
PlayerState
number
Represents the player states.
Value |
|
---|---|
UNKNOWN |
Unknown player state. |
DROPPED |
The player is no longer connected to the receiver because of a network drop. |
QUIT |
The player has manually chosen to disconnect from the receiver. |
AVAILABLE |
The player is connected to the receiver and available to join a game. |
READY |
The player is connected to the receiver, and ready to enter the game. |
IDLE |
The player is connected to the receiver, in the game, and idle. |
PLAYING |
The player is in the game and actively playing. |