# OTPublisherKitDelegate Protocol Reference

Conforms to | NSObject
Declared in | OTPublisherKit.h

## Overview

Used for sending messages for an OTPublisher instance. The OTPublisher class includes a `delegate` property. When you send the [OTPublisherKit initWithDelegate:] message or the [OTPublisherKit initWithDelegate:settings:] message, you specify an OTPublisherKitDelegate object.

### `– publisher:didFailWithError:` required method

Sent if the publisher encounters an error. After this message is sent, the publisher can be considered fully detached from a session and may be released.

`- (void)publisher:(nonnull OTPublisherKit *)publisher didFailWithError:(nonnull OTError *)error`

#### Parameters

`publisher` | The publisher that signalled this event.
`error` | The error (an OTError object). The `OTPublisherErrorCode` enum (defined in the OTError class) defines values for the `code` property of this object.

#### Declared In

`OTPublisherKit.h`

### `– muteForced:`

Sent when a moderator has forced this publisher to mute audio.

`- (void)muteForced:(nonnull OTPublisherKit *)publisher`

#### Parameters

`publisher` | The publisher.

#### Discussion

See [OTSession forceMuteAll:error:] and [OTSession forceMuteStream:error:].

#### Declared In

`OTPublisherKit.h`

### `– publisher:streamCreated:`

Sent when the publisher starts streaming.

`- (void)publisher:(nonnull OTPublisherKit *)publisher streamCreated:(nonnull OTStream *)stream`

#### Parameters

`publisher` | The publisher of the stream.
`stream` | The stream that was created.

#### Declared In

`OTPublisherKit.h`

### `– publisher:streamDestroyed:`

Sent when the publisher stops streaming.

`- (void)publisher:(nonnull OTPublisherKit *)publisher streamDestroyed:(nonnull OTStream *)stream`

#### Parameters

`publisher` | The publisher that stopped sending this stream.
`stream` | The stream that ended.

#### Declared In

`OTPublisherKit.h`

### `– publisherVideoDisabled:reason:`

This message is sent when the publisher stops sending video. Check the reason parameter for the reason why the video stopped.

`- (void)publisherVideoDisabled:(nonnull OTPublisherKit *)publisher reason:(OTPublisherVideoEventReason)reason`

#### Parameters

`publisher` | The OTPublisher that will no longer send video.
`reason` | The reason that the video track was disabled. See OTPublisherVideoEventReason.

#### Declared In

`OTPublisherKit.h`

### `– publisherVideoEnabled:reason:`

This message is sent when the publisher’s video stream resumes (after video was disabled). Check the reason parameter for the reason why the video resumed.

`- (void)publisherVideoEnabled:(nonnull OTPublisherKit *)publisher reason:(OTPublisherVideoEventReason)reason`

#### Parameters

`publisher` | The OTPublisher that will send video.
`reason` | The reason that the video track was enabled. See OTPublisherVideoEventReason.

#### Declared In

`OTPublisherKit.h`

### `– publisherVideoDisableWarning:`

This message is sent when the publisher determines that the stream quality has degraded and the video will be disabled if the quality degrades further. If the quality degrades further, the publisher disables the video and the [OTPublisherKitDelegate publisherVideoDisabled:reason:] message is sent. If the network congestion level improves, the [OTPublisherKitDelegate publisherVideoDisableWarningLifted:] message is sent.

`- (void)publisherVideoDisableWarning:(nonnull OTPublisherKit *)publisher`

#### Parameters

`publisher` | The OTPublisher that may stop sending video soon.

#### Discussion

This message is mainly sent when connection quality degrades.

#### Declared In

`OTPublisherKit.h`

### `– publisherVideoDisableWarningLifted:`

This message is sent when the publisher determines that the network congestion level has improved to the point at which the video being disabled is not an immediate risk. This message is sent after the [OTPublisherKitDelegate publisherVideoDisableWarning:] message is sent.

`- (void)publisherVideoDisableWarningLifted:(nonnull OTPublisherKit *)publisher`

#### Parameters

`publisher` | The OTPublisher instance.

#### Discussion

This message is mainly sent when connection quality improves.

#### Declared In

`OTPublisherKit.h`