GCKCastSession Class Reference

A class that manages a Cast session with a receiver device. More...

#import <GCKCastSession.h>

+ Inheritance diagram for GCKCastSession:

Instance Methods

(instancetype) - initWithDevice:sessionID:sessionOptions:castOptions:
 Constructs a new Cast session with the given Cast options. More...
 
(BOOL) - addChannel:
 Registers a channel with the session. More...
 
(BOOL) - removeChannel:
 Removes a previously registered channel from the session. More...
 
(void) - addDeviceStatusListener:
 Adds a GCKCastDeviceStatusListener to this object's list of listeners. More...
 
(void) - removeDeviceStatusListener:
 Removes a GCKCastDeviceStatusListener from this object's list of listeners. More...
 
(GCKRequest *) - setDeviceVolume:forMultizoneDevice:
 Sets the individual device's volume in a multizone group. More...
 
(GCKRequest *) - setDeviceMuted:forMultizoneDevice:
 Sets the individual device's muted state in a multizone group. More...
 
(GCKRequest *) - requestMultizoneStatus
 Request multizone status from a multizone group. More...
 
- Instance Methods inherited from GCKSession
(BOOL suspended) - GCK_DEPRECATED
 A flag indicating whether the session is currently suspended. More...
 
(instancetype) - initWithDevice:traits:sessionID:
 Initializes a new session object for the given device, with default options. More...
 
(instancetype) - initWithDevice:traits:sessionID:sessionOptions:
 Initializes a new session object for the given device. More...
 
(GCKRequest *) - setDeviceVolume:
 Sets the device's volume. More...
 
(GCKRequest *) - setDeviceMuted:
 Sets the device's mute state. More...
 
(void) - start
 Starts the session. More...
 
(void) - endWithAction:
 Ends the session with the specified action. More...
 
(void) - notifyDidStartWithSessionID:
 Called by subclasses to notify the framework that the session has been started. More...
 
(void) - notifyDidFailToStartWithError:
 Called by subclasses to notify the framework that the session has failed to start. More...
 
(void) - notifyDidEndWithError:willTryToResume:
 Called by subclasses to notify the framework that the session has ended. More...
 
(void) - notifyDidReceiveDeviceVolume:muted:
 Called by subclasses to notify the framework that updated device volume and mute state has been received from the device. More...
 
(void) - notifyDidReceiveDeviceStatus:
 Called by subclasses to notify the framework that updated status has been received from the device. More...
 
(void) - notifyDidSuspendWithReason:
 Deprecated, do not use - implemented as a no-op. More...
 

Properties

GCKActiveInputStatus activeInputStatus
 The device's current "active input" status. More...
 
GCKStandbyStatus standbyStatus
 The device's current "standby" status. More...
 
GCKApplicationMetadataapplicationMetadata
 The metadata for the receiver application that is currently running on the receiver device, if any; otherwise nil. More...
 
- Properties inherited from GCKSession
GCKDevicedevice
 The device that this session is associated with. More...
 
NSString * sessionID
 The current session ID, if any. More...
 
GCKSessionOptions * sessionOptions
 The session options, if any. More...
 
GCKConnectionState connectionState
 The current session connection state. More...
 
NSString * deviceStatusText
 The current device status text. More...
 
GCKSessionTraitstraits
 The session traits. More...
 
float currentDeviceVolume
 The current device volume, in the range [0.0, 1.0]. More...
 
BOOL currentDeviceMuted
 The current device mute state. More...
 
GCKRemoteMediaClientremoteMediaClient
 The GCKRemoteMediaClient object that can be used to control media playback in this session. More...
 
GCKMediaMetadatamediaMetadata
 The current media metadata, if any. More...
 

Detailed Description

A class that manages a Cast session with a receiver device.

Sessions are created and managed automatically by the GCKSessionManager. The application should not directly call the session lifecycle methods such as start (GCKSession(Protected)) or endWithAction: (GCKSession(Protected)).

Since
3.0

Method Documentation

- (BOOL) addChannel: (GCKCastChannel *)  channel

Registers a channel with the session.

If the session is connected and the receiver application supports the channel's namespace, the channel will be automatically connected. If the session is not connected, the channel will remain in a disconnected state until the session is started.

Parameters
channelThe channel to register.
Returns
YES if the channel was registered successfully, NO otherwise.
- (void) addDeviceStatusListener: (id< GCKCastDeviceStatusListener >)  listener

Adds a GCKCastDeviceStatusListener to this object's list of listeners.

Parameters
listenerThe listener to add.
- (instancetype) initWithDevice: (GCKDevice *)  device
sessionID: (NSString *GCK_NULLABLE_TYPE)  sessionID
sessionOptions: (GCKSessionOptions *GCK_NULLABLE_TYPE)  sessionOptions
castOptions: (GCKCastOptions *)  castOptions 

Constructs a new Cast session with the given Cast options.

Parameters
deviceThe receiver device.
sessionIDThe session ID, if resuming; otherwise nil.
sessionOptionsThe session options, if any; otherwise nil.
castOptionsThe Cast options.
Since
4.0
- (BOOL) removeChannel: (GCKCastChannel *)  channel

Removes a previously registered channel from the session.

Parameters
channelThe channel to unregister.
Returns
YES if the channel was unregistered successfully, NO otherwise.
- (void) removeDeviceStatusListener: (id< GCKCastDeviceStatusListener >)  listener

Removes a GCKCastDeviceStatusListener from this object's list of listeners.

Parameters
listenerThe listener to remove.
- (GCKRequest *) requestMultizoneStatus

Request multizone status from a multizone group.

This is an asynchronous operation. When the multizone status is received, the GCKCastDeviceStatusListener::castSession:didReceiveMultizoneStatus: delegate method will be messaged.

Returns
A GCKRequest object for tracking the request.
- (GCKRequest *) setDeviceMuted: (BOOL)  muted
forMultizoneDevice: (GCKMultizoneDevice *)  device 

Sets the individual device's muted state in a multizone group.

This is an asynchronous operation.

Parameters
mutedThe new muted state.
deviceThe multizone device.
Returns
A GCKRequest object for tracking the request.
- (GCKRequest *) setDeviceVolume: (float)  volume
forMultizoneDevice: (GCKMultizoneDevice *)  device 

Sets the individual device's volume in a multizone group.

This is an asynchronous operation.

Parameters
volumeThe new volume, in the range [0.0, 1.0].
deviceThe multizone device.
Returns
A GCKRequest object for tracking the request.

Property Documentation

- (GCKActiveInputStatus) activeInputStatus
readnonatomicassign

The device's current "active input" status.

- (GCKApplicationMetadata*) applicationMetadata
readnonatomiccopy

The metadata for the receiver application that is currently running on the receiver device, if any; otherwise nil.

- (GCKStandbyStatus) standbyStatus
readnonatomicassign

The device's current "standby" status.


The documentation for this class was generated from the following file: