继承 GCKSession。
- (instancetype) initWithDevice: |
|
(GCKDevice *) |
device |
sessionID: |
|
(NSString *__nullable) |
sessionID |
castOptions: |
|
(GCKCastOptions *) |
castOptions |
|
|
| |
指定的初始化程序。
使用给定的投放选项构造新的投放会话。
- Parameters
-
device | The receiver device. |
sessionID | The session ID, if resuming; otherwise nil . |
castOptions | The Cast options. |
在会话中注册渠道。
如果会话已连接,且接收端应用支持频道的命名空间,那么系统会自动连接频道。如果会话未连接,则在会话开始之前,频道将保持断开连接的状态。
- Parameters
-
channel | The channel to register. |
- 返回
如果频道已成功注册,则为 YES
,否则为 NO
。
从会话中移除之前注册的频道。
- Parameters
-
channel | The channel to unregister. |
- 返回
如果频道取消注册成功,则为 YES
,否则为 NO
。
在多可用区群组中设置单个设备的音量。
这是一项异步操作。
- Parameters
-
volume | The new volume, in the range [0.0, 1.0]. |
device | The multizone device. |
- 返回
- 用于跟踪请求的 GCKRequest 对象。
在多可用区群组中设置单个设备的静音状态。
这是一项异步操作。
- Parameters
-
muted | The new muted state. |
device | The multizone device. |
- 返回
- 用于跟踪请求的 GCKRequest 对象。
- (instancetype) initWithDevice: |
|
(GCKDevice *) |
device |
traits: |
|
(GCKSessionTraits *) |
traits |
sessionID: |
|
(NSString *__nullable) |
sessionID |
|
|
| |
初始化给定设备的新会话对象。
- Parameters
-
device | The device. |
traits | The session traits. |
sessionID | The session ID of an existing session, if this object will be used to resume a session; otherwise nil if it will be used to start a new session. |
设置设备的音量。
这是一项异步操作。默认实现是一个空操作,它会使请求失败,并返回 GCKErrorCodeUnsupportedFeature 错误。
- Parameters
-
- 返回
- 用于跟踪请求的 GCKRequest 对象。
- 辛塞
- 3.4;在以前的框架版本中,此方法返回
void
。
设置设备的静音状态。
这是一项异步操作。默认实现是一个空操作,它会使请求失败,并返回 GCKErrorCodeUnsupportedFeature 错误。
- Parameters
-
- 返回
- 用于跟踪请求的 GCKRequest 对象。
- 辛塞
- 3.4;在以前的框架版本中,此方法返回
void
。
- (void) endAndStopCasting: |
|
(BOOL) |
stopCasting |
|
结束会话。
这是一项异步操作。必须替换为子类。
- Parameters
-
stopCasting | Whether to stop casting content to the receiver. |
由类别“GCKSession(Protected)”提供。
- (void) notifyDidStartWithSessionID: |
|
(NSString *) |
sessionID |
|
- (void) notifyDidFailToStartWithError: |
|
(NSError *) |
error |
|
- (void) notifyDidEndWithError: |
|
(NSError *__nullable) |
error |
|
由子类调用以通知框架会话已结束。
- Parameters
-
error | The error that caused the session to end, if any. Should be nil if the session was ended intentionally. |
由类别“GCKSession(Protected)”提供。
- (void) notifyDidReceiveDeviceVolume: |
|
(float) |
volume |
muted: |
|
(BOOL) |
muted |
|
|
| |
由子类调用,以通知框架已收到设备已更新的设备音量和静音状态。
- Parameters
-
volume | The device's current volume. Must be in the range [0, 1.0]; |
muted | The device's current mute state. |
由类别“GCKSession(Protected)”提供。
- (void) notifyDidReceiveDeviceStatus: |
|
(NSString *__nullable) |
statusText |
|
接收方设备上当前正在运行的接收方应用的元数据(如果有);否则,返回 nil
。
|
readnonatomicstronginherited |
|
readnonatomiccopyinherited |
|
readnonatomicassigninherited |
|
readnonatomicassigninherited |
- (NSString*) deviceStatusText |
|
readnonatomiccopyinherited |
|
readnonatomiccopyinherited |
- (float) currentDeviceVolume |
|
readnonatomicassigninherited |
- (BOOL) currentDeviceMuted |
|
readnonatomicassigninherited |
|
readnonatomicstronginherited |
|
readnonatomicstronginherited |
当前媒体元数据(如果有)。
如果会话不支持媒体命名空间,或者接收器上目前未加载任何媒体,则此值为 nil
。