Conforms to NSObject
Declared in OTSession.h

Overview

Used to send messages for an OTSession instance. The OTSession class includes a delegate property. When you send the [OTSession initWithApiKey:sessionId:delegate:] message, you specify an OTSessionDelegate object.

Instance Methods

session:archiveStartedWithId:name:

Sent when an archive recording of a session starts. If you connect to a session in which recording is already in progress, this message is sent when you connect.

- (void)session:(id)session archiveStartedWithId:(id)archiveId name:(id)name

Parameters

session

The OTSession instance that sent this message.

archiveId

The unique ID of the archive.

name

The name of the archive (if one was provided when the archive was created).

Discussion

In response to this message, you may want to add a user interface notification (such as an icon in the Publisher view) that indicates that the session is being recorded.

For more information see the OpenTok Archiving Overview.

Declared In

OTSession.h

session:archiveStoppedWithId:

Sent when an archive recording of a session stops.

- (void)session:(id)session archiveStoppedWithId:(id)archiveId

Parameters

session

The OTSession instance that sent this message.

archiveId

The unique ID of the archive.

Discussion

In response to this message, you may want to change or remove a user interface notification (such as an icon in the Publisher view) that indicates that the session is being recorded.

For more information, see the OpenTok Archiving Overview.

Declared In

OTSession.h

session:connectionCreated:

Sent when another client connects to the session. The connection object represents the client’s connection.

- (void)session:(id)session connectionCreated:(id)connection

Parameters

session

The OTSession instance that sent this message.

connection

The new OTConnection object.

Discussion

This message is not sent when your own client connects to the session. Instead, the [OTSessionDelegate sessionDidConnect:] message is sent when your own client connects to the session.

Declared In

OTSession.h

session:connectionDestroyed:

Sent when another client disconnects from the session. The connection object represents the connection that the client had to the session.

- (void)session:(id)session connectionDestroyed:(id)connection

Parameters

session

The OTSession instance that sent this message.

connection

The OTConnection object for the client that disconnected from the session.

Discussion

This message is not sent when your own client disconnects from the session. Instead, the [OTSessionDelegate sessionDidDisconnect:] message is sent when your own client connects to the session.

Declared In

OTSession.h

session:didFailWithError:

Sent if the session fails to connect, some time after your application invokes [OTSession connectWithToken:].

- (void)session:(id)session didFailWithError:(id)error

Parameters

session

The OTSession instance that sent this message.

error

An OTError object describing the issue. The OTSessionErrorCode enum (defined in the OTError.h file) defines values for the code property of this object.

Declared In

OTSession.h

session:receivedSignalType:fromConnection:withString:

Sent when a message is received in the session.

- (void)session:(id)session receivedSignalType:(id)type fromConnection:(id)connection withString:(id)string

Parameters

session

The OTSession instance that sent this message.

type

The type string of the signal.

connection

The connection identifying the client that sent the message.

string

The signal data.

Declared In

OTSession.h

session:streamCreated:

Sent when a new stream is created in this session.

- (void)session:(id)session streamCreated:(id)stream

Parameters

session

The OTSession instance that sent this message.

stream

The stream associated with this event.

Discussion

Note that if your application publishes to this session, your own session delegate will not receive the [OTSessionDelegate session:streamCreated:] message for its own published stream. For that event, see the delegate callback [OTPublisherKit publisher:streamCreated:].

Declared In

OTSession.h

session:streamDestroyed:

Sent when a stream is no longer published to the session.

- (void)session:(id)session streamDestroyed:(id)stream

Parameters

session

The OTSession instance that sent this message.

stream

The stream associated with this event.

Declared In

OTSession.h

sessionDidConnect:

Sent when the client connects to the session.

- (void)sessionDidConnect:(id)session

Parameters

session

The OTSession instance that sent this message.

Declared In

OTSession.h

sessionDidDisconnect:

Sent when the client disconnects from the session.

- (void)sessionDidDisconnect:(id)session

Parameters

session

The OTSession instance that sent this message.

Declared In

OTSession.h