<GCKSessionManagerListener> 协议

<GCKSessionManagerListener> 协议参考

概览

GCKSessionManager 监听器协议。

该协议的所有方法都是可选的。所有通知方法都有两种类型:一种是针对任何会话类型调用的,另一种是专门为 Cast 会话调用的。

系统会按照注册顺序调用监听器。由框架本身的组件(例如 GCKUIMediaController)注册的 GCKSessionManagerListener 实例将始终在由应用为回调 sessionManager:willStartSession: (GCKSessionManagerListener-p)sessionManager:willStartCastSession: (GCKSessionManagerListener-p)sessionManager:willResumeSession: (GCKSessionManagerListener-p)sessionManager:willResumeCastSession: (GCKSessionManagerListener-p) 注册的实例之后,以及由应用为其余所有回调注册的实例之后调用。

辛塞
3.0

继承 <NSObjectNSObject>。

实例方法摘要

(void) - sessionManager:willStartSession:
 在会话即将开始时调用。更多...
 
(void) - sessionManager:didStartSession:
 在会话成功启动时调用。更多...
 
(void) - sessionManager:willStartCastSession:
 在投放会话即将开始时调用。更多...
 
(void) - sessionManager:didStartCastSession:
 在投放会话成功启动后调用。更多...
 
(void) - sessionManager:willEndSession:
 在会话即将结束(因请求或出现错误)时调用。更多...
 
(void) - sessionManager:didEndSession:withError:
 在会话结束(因请求或出现错误)时调用。更多...
 
(void) - sessionManager:willEndCastSession:
 在 Cast 会话即将结束(因请求或出现错误)时调用。更多...
 
(void) - sessionManager:didEndCastSession:withError:
 在 Cast 会话已结束时(因请求或出错)而调用。更多...
 
(void) - sessionManager:didFailToStartSession:withError:
 在会话启动失败时调用。更多...
 
(void) - sessionManager:didFailToStartCastSession:withError:
 在投放会话启动失败时调用。更多...
 
(void) - sessionManager:didSuspendSession:withReason:
 在会话被暂停时调用。更多...
 
(void) - sessionManager:didSuspendCastSession:withReason:
 在投放会话暂停时调用。更多...
 
(void) - sessionManager:willResumeSession:
 在会话即将恢复时调用。更多...
 
(void) - sessionManager:didResumeSession:
 在会话成功恢复后调用。更多...
 
(void) - sessionManager:willResumeCastSession:
 在投放会话即将恢复时调用。更多...
 
(void) - sessionManager:didResumeCastSession:
 在投放会话成功恢复后调用。更多...
 
(void) - sessionManager:session:didUpdateDevice:
 在与此会话关联的设备发生某种变化(例如,好记名称已更改)时调用。更多...
 
(void) - sessionManager:session:didReceiveDeviceVolume:muted:
 当收到会话的设备更新和静音状态时调用。更多...
 
(void) - sessionManager:castSession:didReceiveDeviceVolume:muted:
 在收到投放会话的更新设备音量和静音状态时调用。更多...
 
(void) - sessionManager:session:didReceiveDeviceStatus:
 在收到会话的设备状态更新时调用。更多...
 
(void) - sessionManager:castSession:didReceiveDeviceStatus:
 在收到投放会话的更新设备状态时调用。更多...
 

方法详细信息

- (void) sessionManager: (GCKSessionManager *)  sessionManager
willStartSession: (GCKSession *)  session 
optional

在会话即将开始时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didStartSession: (GCKSession *)  session 
optional

在会话成功启动时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
willStartCastSession: (GCKCastSession *)  session 
optional

在投放会话即将开始时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didStartCastSession: (GCKCastSession *)  session 
optional

在投放会话成功启动后调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
willEndSession: (GCKSession *)  session 
optional

在会话即将结束(因请求或出现错误)时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didEndSession: (GCKSession *)  session
withError: (NSError *__nullable)  error 
optional

在会话结束(因请求或出现错误)时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
errorThe error, if any; otherwise nil.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
willEndCastSession: (GCKCastSession *)  session 
optional

在 Cast 会话即将结束(因请求或出现错误)时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didEndCastSession: (GCKCastSession *)  session
withError: (NSError *__nullable)  error 
optional

在 Cast 会话已结束时(因请求或出错)而调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
errorThe error, if any; otherwise nil.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didFailToStartSession: (GCKSession *)  session
withError: (NSError *)  error 
optional

在会话启动失败时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
errorThe error.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didFailToStartCastSession: (GCKCastSession *)  session
withError: (NSError *)  error 
optional

在投放会话启动失败时调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
errorThe error.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didSuspendSession: (GCKSession *)  session
withReason: (GCKConnectionSuspendReason reason 
optional

在会话被暂停时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
reasonThe reason for the suspension.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didSuspendCastSession: (GCKCastSession *)  session
withReason: (GCKConnectionSuspendReason reason 
optional

在投放会话暂停时调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
reasonThe reason for the suspension.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
willResumeSession: (GCKSession *)  session 
optional

在会话即将恢复时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didResumeSession: (GCKSession *)  session 
optional

在会话成功恢复后调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
willResumeCastSession: (GCKCastSession *)  session 
optional

在投放会话即将恢复时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
didResumeCastSession: (GCKCastSession *)  session 
optional

在投放会话成功恢复后调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
session: (GCKSession *)  session
didUpdateDevice: (GCKDevice *)  device 
optional

在与此会话关联的设备发生某种变化(例如,好记名称已更改)时调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
deviceThe updated device object.
辛塞
3.2
- (void) sessionManager: (GCKSessionManager *)  sessionManager
session: (GCKSession *)  session
didReceiveDeviceVolume: (float)  volume
muted: (BOOL)  muted 
optional

当收到会话的设备更新和静音状态时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
volumeThe current volume, in the range [0.0, 1.0].
mutedThe current mute state.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
castSession: (GCKCastSession *)  session
didReceiveDeviceVolume: (float)  volume
muted: (BOOL)  muted 
optional

在收到投放会话的更新设备音量和静音状态时调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
volumeThe current volume, in the range [0.0, 1.0].
mutedThe current mute state.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
session: (GCKSession *)  session
didReceiveDeviceStatus: (NSString *__nullable)  statusText 
optional

在收到会话的设备状态更新时调用。

Parameters
sessionManagerThe session manager.
sessionThe session.
statusTextThe new device status text.
- (void) sessionManager: (GCKSessionManager *)  sessionManager
castSession: (GCKCastSession *)  session
didReceiveDeviceStatus: (NSString *__nullable)  statusText 
optional

在收到投放会话的更新设备状态时调用。

Parameters
sessionManagerThe session manager.
sessionThe Cast session.
statusTextThe new device status text.