Inherits from NSObject
Declared in OTPublisherKit.h

Overview

A publisher captures an audio-video stream from the sources you specify. You can then publish the audio-video stream to an OpenTok session by sending the [OTSession publish:error:] message.

Use OTPublisherKit to interface with <[OTSession]> to push audio and video to other peers or the OpenTok Cloud Media Router (aka. “Mantis”).

The OpenTok iOS SDK supports publishing on all multi-core iOS devices. See “Developer and client requirements” in the README file for the OpenTok iOS SDK.

Tasks

Initializing a publisher

Getting information about the publisher

  •   delegate

    The OTPublisherDelegate object, which is the delegate for the OTPublisher object.

    property
  •   session

    The session that owns this publisher.

    property
  •   stream

    The OTStream object associated with the publisher.

    property
  •   name

    A string that will be associated with this publisher’s stream. This string is displayed at the bottom of publisher videos and at the bottom of subscriber videos associated with the published stream. You can set this name after initializing the publisher and before sending the [OTSession publish:error:] message. Setting the property after sending the [OTSession publish:error:] message has no effect on the name displayed for the stream.

    property

Controlling audio and video output for a publisher

Setting publisher device configuration

Properties

delegate

The OTPublisherDelegate object, which is the delegate for the OTPublisher object.

@property (nonatomic, assign) id<OTPublisherKitDelegate> delegate

Declared In

OTPublisherKit.h

name

A string that will be associated with this publisher’s stream. This string is displayed at the bottom of publisher videos and at the bottom of subscriber videos associated with the published stream. You can set this name after initializing the publisher and before sending the [OTSession publish:error:] message. Setting the property after sending the [OTSession publish:error:] message has no effect on the name displayed for the stream.

@property (nonatomic, copy) NSString *name

Discussion

Note that you can also set the name when you send the [OTPublisherKit initWithDelegate:name:] message.

This value defaults to an empty string.

Declared In

OTPublisherKit.h

publishAudio

Whether to publish audio.

@property (nonatomic) BOOL publishAudio

Discussion

The default value is TRUE.

Declared In

OTPublisherKit.h

publishVideo

Whether to publish video.

@property (nonatomic) BOOL publishVideo

Discussion

The default value is TRUE.

Declared In

OTPublisherKit.h

session

The session that owns this publisher.

@property (readonly) OTSession *session

Declared In

OTPublisherKit.h

stream

The OTStream object associated with the publisher.

@property (readonly) OTStream *stream

Declared In

OTPublisherKit.h

videoCapture

The OTVideoCapture instance used to capture video to stream to the OpenTok session.

@property (nonatomic, retain) id<OTVideoCapture> videoCapture

Declared In

OTPublisherKit.h

videoRender

The OTVideoRender instance used to render video to stream to the OpenTok session.

@property (nonatomic, retain) id<OTVideoRender> videoRender

Declared In

OTPublisherKit.h

Instance Methods

initWithDelegate:

Initialize a publisher object and specify the delegate object.

- (id)initWithDelegate:(id<OTPublisherKitDelegate>)delegate

Parameters

delegate

The delegate (OTPublisherKitDelegate) object for the publisher.

Return Value

The pointer to the instance, or nil if initialization failed.

Discussion

When running in the XCode iOS Simulator, this method returns nil.

Declared In

OTPublisherKit.h

initWithDelegate:name:

Initialize a publisher object, and specify the delegate object and the stream’s name.

- (id)initWithDelegate:(id<OTPublisherKitDelegate>)delegate name:(NSString *)name

Parameters

delegate

The delegate (OTPublisherKitDelegate) object for the publisher.

name

The name for this stream. This string is displayed at the bottom of publisher videos and at the bottom of subscriber videos associated with the published stream.

Return Value

The pointer to the instance, or nil if initialization failed.

Discussion

When running in the XCode iOS Simulator, this method returns nil.

Declared In

OTPublisherKit.h