GoogleCastSessionManagerPlatformInterface class abstract
A class that manages sessions.
The method startSessionWithDevice: (GCKSessionManager) is used to create a new session with a given GCKDevice. The session manager uses the GCKDeviceProvider for that device type to construct a new GCKSession object, to which it then delegates all session requests.
GCKSessionManager handles the automatic resumption of suspended sessions (that is, resuming sessions that were ended when the application went to the background, or in the event that the application crashed or was forcibly terminated by the user). When the application resumes or restarts, the session manager will wait for a short time for the device provider of the suspended session's device to discover that device again, and if it does, it will attempt to reconnect to that device and re-establish the session automatically.
If the application has created a GCKUICastButton without providing a target and selector, then a user tap on the button will display the default Cast dialog and it will automatically start and stop sessions based on user selection or disconnection of a device. If however the application is providing its own device selection/control dialog UI, then it should use the GCKSessionManager directly to create and control sessions.
Whether or not the application uses the GCKSessionManager to control sessions, it can attach a GCKSessionManagerListener to be notified of session events, and can also use KVO to monitor the connectionState property to track the current session lifecycle state.
- Since
- 3.0
- Inheritance
-
- Object
- PlatformInterface
- GoogleCastSessionManagerPlatformInterface
- Implementers
Constructors
- GoogleCastSessionManagerPlatformInterface.new({required Object token})
- Creates a new GoogleCastSessionManagerPlatformInterface.
Properties
- connectionState → GoogleCastConnectState
-
readnonatomicassign
The current session connection state.
no setter
- currentSession → GoogleCastSession?
-
The current session, if any.
no setter
-
currentSessionStream
→ Stream<
GoogleCastSession?> -
Stream of current session changes.
no setter
- hasConnectedSession → bool
-
Tests if a session is currently being managed by this session manager, and it is currently connected.
This will be YES if the session state is ConnectionStateConnected.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
endSession(
) → Future< bool> - Ends the current session. This is an asynchronous operation. Returns YES if the operation has been started successfully, NO if there is no session currently established or if the operation could not be started.
-
endSessionAndStopCasting(
) → Future< bool> - Ends the current session and stops casting if one sender device is connected; otherwise, optionally stops casting if multiple sender devices are connected. Use the stopCasting parameter to indicate whether casting on the receiver should stop when the session ends. This parameter only applies when multiple sender devices are connected. For example, the same app is open on multiple sender devices and each sender device has an active Cast session with the same receiver device. If you set stopCasting to YES, the receiver app stops casting when multiple devices are connected. If stopCasting is NO and other devices have an active session, the receiver keeps playing. If only one sender device is connected, the receiver app stops casting the media and ignores the stopCasting value, even if it's set to NO. Parameters stopCasting Whether casting on the receiver should stop when the session ends. Only used when multiple sender devices are connected. Returns YES if the operation to end the session started successfully, NO if there is no session currently established or if the operation could not be started.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDefaultSessionOptions(
) → Future< void> - Sets the default session options for devices in a specific category (iOS only).
-
setDeviceVolume(
double value) → void - Sets the device volume.
-
startSessionWithDevice(
GoogleCastDevice device) → Future< bool> - Starts a new session with the given device, using the default session options that were registered for the device category, if any. This is an asynchronous operation. Parameters device The device to use for this session. Returns YES if the operation has been started successfully, NO if there is a session currently established or if the operation could not be started.
-
startSessionWithOpenURLOptions(
) → Future< bool> - Attempts to join or start a session with options that were supplied to the UIApplicationDelegate::application:openURL:options: method. Typically this is a request to join an existing Cast session on a particular device that was initiated by another app. Parameters openURLOptions The options that were extracted from the URL.
-
suspendSessionWithReason(
) → Future< bool> - Suspends the current session. This is an asynchronous operation. Parameters
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited