Stay organized with collections Save and categorize content based on your preferences.
An abstract base class representing a session with a receiver device.
Subclasses must implement the start (GCKSession(Protected)) and endWithAction: (GCKSession(Protected)) methods, and must call the appropriate notifier methods (for example, notifyDidStartWithSessionID: (GCKSession(Protected))) to indicate corresponding changes in the session state. Subclasses may also implement setDeviceVolume: (GCKSession), setDeviceMuted: (GCKSession) and remoteMediaClient if the device supports such operations.
A session is created and controlled using the session methods in GCKSessionManager, which uses the appropriate GCKDeviceProvider to create the session, and then delegates session requests to that GCKSession object.
Inherits NSObject.
Inherited by GCKCastSession.
- (instancetype) initWithDevice: (GCKDevice *) device traits: (nullable GCKSessionTraits *) traits sessionID: (nullable NSString *) sessionIDInitializes a new session object for the given device, with default options.
nil
if it will be used to start a new session.
Initializes a new session object for the given device.
nil
if it will be used to start a new session. sessionOptions The session options, if any; otherwise nil
.
Sets the device's volume.
This is an asynchronous operation. The default implementation is a no-op that fails the request with a GCKErrorCodeUnsupportedFeature error.
void
.
Sets the device's mute state.
This is an asynchronous operation. The default implementation is a no-op that fails the request with a GCKErrorCodeUnsupportedFeature error.
void
.
Starts the session.
This is an asynchronous operation. Must be overridden by subclasses.
Provided by category GCKSession(Protected).
Ends the session with the specified action.
This is an asynchronous operation. Must be overridden by subclasses.
Provided by category GCKSession(Protected).
- (void) notifyDidStartWithSessionID: (NSString *) sessionIDCalled by subclasses to notify the framework that the session has been started.
Provided by category GCKSession(Protected).
- (void) notifyDidFailToStartWithError: (GCKError *) errorCalled by subclasses to notify the framework that the session has failed to start.
Provided by category GCKSession(Protected).
- (void) notifyDidEndWithError: (nullable NSError *) error willTryToResume: (BOOL) willTryToResumeCalled by subclasses to notify the framework that the session has ended.
nil
if the session was ended intentionally. willTryToResume Whether the session will try to resume itself automatically.
Provided by category GCKSession(Protected).
- (void) notifyDidReceiveDeviceVolume: (float) volume muted: (BOOL) mutedCalled by subclasses to notify the framework that updated device volume and mute state has been received from the device.
Provided by category GCKSession(Protected).
- (void) notifyDidReceiveDeviceStatus: (nullable NSString *) statusTextCalled by subclasses to notify the framework that updated status has been received from the device.
Provided by category GCKSession(Protected).
The device that this session is associated with.
The current session ID, if any.
- (GCKSessionOptions*) sessionOptions readnonatomicstrongThe session options, if any.
The current session connection state.
A flag indicating whether the session is currently suspended.
The current device status text.
- (float) currentDeviceVolume readnonatomicassignThe current device volume, in the range [0.0, 1.0].
- (BOOL) currentDeviceMuted readnonatomicassignThe current device mute state.
The current media metadata, if any.
Will be nil
if the session does not support the media namespace or if no media is currently loaded on the receiver.
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."],[[["`GCKSession` is an abstract base class representing a session with a receiver device, requiring subclasses to implement `start` and `endWithAction` methods."],["Subclasses must also call specific notifier methods to indicate changes in the session state and can implement methods for device volume, mute state, and remote media client if supported by the device."],["Sessions are created and managed by `GCKSessionManager`, which utilizes `GCKDeviceProvider` for device discovery and delegates session requests to the `GCKSession` object."],["Key properties of `GCKSession` include the associated device, session ID, connection state, device status, and optional remote media client for controlling media playback."],["Subclasses like `GCKCastSession` inherit from `GCKSession` and provide concrete implementations for specific Cast sessions."]]],["The GCKSession class represents a session with a receiver device, requiring subclasses to implement `start` and `endWithAction:` methods. Subclasses must also use methods like `notifyDidStartWithSessionID:` to communicate state changes. Optional methods like `setDeviceVolume:`, `setDeviceMuted:`, and `remoteMediaClient` are available for supported devices. Sessions are managed by `GCKSessionManager`, which uses `GCKDeviceProvider` to create them and delegates requests to `GCKSession`. Key properties include `device`, `sessionID`, and connection state, with methods to initialize, set device volume/mute state, start/end a session, and notify the framework of session status changes.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4