OTSubscriberKitDelegate
Used to send messages for an OTSubscriber instance. When you send the [OTSubscriberKit initWithStream:delegate:] message, you specify an OTSubscriberKitDelegate object.
Methods
| Name | Description |
|---|---|
subscriberDidConnectToStream:(subscriber) |
Sent when the subscriber successfully connects to the stream. |
subscriber:didFailWithError:(subscriber, error) |
Sent if the subscriber fails. |
subscriberVideoDisabled:reason:(subscriber, reason) |
This message is sent when the subscriber stops receiving video. |
subscriberVideoEnabled:reason:(subscriber, reason) |
This message is sent when the subscriber's video stream starts (when there previously was no video) or resumes (after video was disabled). |
subscriberVideoDisableWarning:(subscriber) |
This message is sent when the OpenTok Media Router determines that the stream quality has degraded and the video will be disabled if the quality degrades further. |
subscriberVideoDisableWarningLifted:(subscriber) |
This message is sent when the OpenTok Media Router determines that the stream quality has improved to the point at which the video being disabled is not an immediate risk. |
subscriberDidDisconnectFromStream:(subscriber) |
Called when the subscriber's stream has been interrupted. |
subscriberDidReconnectToStream:(subscriber) |
Sent when the subscriber's stream has resumed, after the [OTSubscriberKitDelegate subscriberDidDisconnectFromStream:] message is sent. |
subscriberDidConnectToStream:(subscriber)
Sent when the subscriber successfully connects to the stream.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber that generated this event. |
subscriber:didFailWithError:(subscriber, error)
Sent if the subscriber fails. Most errors are fatal: the subscriber is automatically dropped and can no longer be used. Some errors are continuable and leave the subscriber usable; when an error is non-fatal it is stated in the error description.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber that generated this event. |
error |
OTError * | The error (an OTError object) that describes this error. The OTSubscriberErrorCode enum (defined in the OTError class) defines values for the code property of this object. |
subscriberVideoDisabled:reason:(subscriber, reason)
This message is sent when the subscriber stops receiving video. Check the reason parameter for the reason why the video stopped.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The OTSubscriber that will no longer receive video. |
reason |
OTSubscriberVideoEventReason | The reason that the video track was disabled. See OTSubscriberVideoEventReason. |
subscriberVideoEnabled:reason:(subscriber, reason)
This message is sent when the subscriber's video stream starts (when there previously was no video) or resumes (after video was disabled). Check the reason parameter for the reason why the video started (or resumed).
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The OTSubscriber that will receive video. |
reason |
OTSubscriberVideoEventReason | The reason that the video track was enabled. See OTSubscriberVideoEventReason. |
subscriberVideoDisableWarning:(subscriber)
This message is sent when the OpenTok Media Router determines that the stream quality has degraded and the video will be disabled if the quality degrades further. If the quality degrades further, the subscriber disables the video and the [OTSubscriberKitDelegate subscriberVideoDisabled:reason:] message is sent. If the stream quality improves, the [OTSubscriberKitDelegate subscriberVideoDisableWarningLifted:] message is sent.
This feature is only available in sessions that use the OpenTok Media Router (sessions with the media mode set to routed), not in sessions with the media mode set to relayed.
This message is mainly sent when connection quality degrades.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The OTSubscriber that may stop receiving video soon. |
subscriberVideoDisableWarningLifted:(subscriber)
This message is sent when the OpenTok Media Router determines that the stream quality has improved to the point at which the video being disabled is not an immediate risk. This message is sent after the [OTSubscriberKitDelegate subscriberVideoDisableWarning:] message is sent.
This feature is only available in sessions that use the OpenTok Media Router (sessions with the media mode set to routed), not in sessions with the media mode set to relayed.
This message is mainly sent when connection quality improves.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The OTSubscriber instance. |
subscriberDidDisconnectFromStream:(subscriber)
Called when the subscriber's stream has been interrupted.
In response to this message being sent, you may want to provide a user interface notification, to let the user know that the audio-video stream is temporarily disconnected and the app is trying to reconnect to the stream.
If the client reconnects to the stream, the [OTSubscriberKitDelegate subscriberDidReconnectToStream:] message is sent.
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber that generated this event. |
subscriberDidReconnectToStream:(subscriber)
Sent when the subscriber's stream has resumed, after the [OTSubscriberKitDelegate subscriberDidDisconnectFromStream:] message is sent.
See [OTSessionDelegate sessionDidReconnect:].
Parameters:
| Name | Type | Description |
|---|---|---|
subscriber |
OTSubscriberKit * | The subscriber that generated this event. |