<GCKSessionManagerListener> Protocol
Stay organized with collections
Save and categorize content based on your preferences.
The GCKSessionManager listener protocol.
The protocol's methods are all optional. All of the notification methods come in two varieties: one that is invoked for any session type, and one that is invoked specifically for Cast sessions.
Listeners are invoked in the order that they were registered. GCKSessionManagerListener instances which are registered by components of the framework itself (such as GCKUIMediaController), will always be invoked after those that are registered by the application for the callbacks sessionManager:willStartSession: (GCKSessionManagerListener-p), sessionManager:willStartCastSession: (GCKSessionManagerListener-p), sessionManager:willResumeSession: (GCKSessionManagerListener-p), and sessionManager:willResumeCastSession: (GCKSessionManagerListener-p); and before those that are registered by the application for all of the remaining callbacks.
- Since
- 3.0
Inherits <NSObjectNSObject>.
Called when a session is about to be started.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Called when a session has been successfully started.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Called when a Cast session is about to be started.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Called when a Cast session has been successfully started.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
Called when a session is about to be ended, either by request or due to an error.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
didEndSession: |
|
(GCKSession *) |
session |
withError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
Called when a session has ended, either by request or due to an error.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
error | The error, if any; otherwise nil. |
Called when a Cast session is about to be ended, either by request or due to an error.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Called when a Cast session has ended, either by request or due to an error.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
error | The error, if any; otherwise nil. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
didFailToStartSession: |
|
(GCKSession *) |
session |
withError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Called when a session has failed to start.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
error | The error. |
Called when a Cast session has failed to start.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
error | The error. |
Called when a session has been suspended.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
reason | The reason for the suspension. |
Called when a Cast session has been suspended.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
reason | The reason for the suspension. |
Called when a session is about to be resumed.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Called when a session has been successfully resumed.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Called when a Cast session is about to be resumed.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Called when a Cast session has been successfully resumed.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
Called when the device associated with this session has changed in some way (for example, the friendly name has changed).
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
device | The updated device object. |
- Since
- 3.2
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
session: |
|
(GCKSession *) |
session |
didReceiveDeviceVolume: |
|
(float) |
volume |
muted: |
|
(BOOL) |
muted |
|
|
| |
|
optional |
Called when updated device volume and mute state for a session have been received.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
volume | The current volume, in the range [0.0, 1.0]. |
muted | The current mute state. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
castSession: |
|
(GCKCastSession *) |
session |
didReceiveDeviceVolume: |
|
(float) |
volume |
muted: |
|
(BOOL) |
muted |
|
|
| |
|
optional |
Called when updated device volume and mute state for a Cast session have been received.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
volume | The current volume, in the range [0.0, 1.0]. |
muted | The current mute state. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
session: |
|
(GCKSession *) |
session |
didReceiveDeviceStatus: |
|
(NSString *__nullable) |
statusText |
|
|
| |
|
optional |
Called when updated device status for a session has been received.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
statusText | The new device status text. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
castSession: |
|
(GCKCastSession *) |
session |
didReceiveDeviceStatus: |
|
(NSString *__nullable) |
statusText |
|
|
| |
|
optional |
Called when updated device status for a Cast session has been received.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
statusText | The new device status text. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `GCKSessionManagerListener` protocol monitors the lifecycle of Cast sessions, including starting, ending, suspending, resuming, and device updates."],["It provides separate methods for general sessions and Cast-specific sessions, offering flexibility for developers."],["The `GCKSessionManagerDelegate` protocol provides methods for receiving device updates, including volume, mute state, and status."],["These methods are triggered when device information changes and can be used to update the application's UI or behavior."],["All methods in both protocols are optional, allowing developers to implement only the callbacks necessary for their application's needs."]]],[]]