ECRoom Class Reference

Inherits from NSObject
Conforms to ECClientDelegate
ECSignalingChannelRoomDelegate
Declared in ECRoom.h
ECRoom.m

Initializers

– initWithEncodedToken:delegate:andPeerFactory:

Create a ECRoom instance with a given Licode token and ECRoomDelegate.

- (instancetype)initWithEncodedToken:(NSString *)encodedToken delegate:(id<ECRoomDelegate>)delegate andPeerFactory:(RTCPeerConnectionFactory *)factory

Parameters

encodedToken

Base64 encoded string.

delegate

ECRoomDelegate instance for this room.

factory

RTCPeerConnectionFactory instance for this room.

Return Value

instancetype

Discussion

Encoded token sample:

{
    @"tokenId":@"559ee50ec55db4935dd0d865",
    @"host":@"example.com:443",
    @"secure":@TRUE,
    @"signature":@"MDA3MDQxZTZkMWZlOWIwNTA0NmYzZjU1NmIzODQyNWUzNzIyZTJhOA=="
}

Declared In

ECRoom.h

– initWithDelegate:andPeerFactory:

Create an ECRoom with the given ECRoomDelegate.

- (instancetype)initWithDelegate:(id<ECRoomDelegate>)roomDelegate andPeerFactory:(RTCPeerConnectionFactory *)factory

Parameters

roomDelegate

ECRoomDelegate instance for this room.

factory

RTCPeerConnectionFactory instance for this room.

Return Value

instancetype

Discussion

Notice that if initialize ECRoom like this, you will never be able to publish/subscribe streams without first call method connectWithEncodedToken: method.

Declared In

ECRoom.h

Properties

  delegate

ECRoomDelegate were this room will invoke methods as events.

@property (weak, nonatomic, readonly) id<ECRoomDelegate> delegate

Declared In

ECRoom.h

  statsDelegate

ECRoomStatsDelegate delegate to receive stats. Notice that you should also set publishingStats to YES.

@property (weak, nonatomic) id<ECRoomStatsDelegate> statsDelegate

Declared In

ECRoom.h

  signalingChannel

ECSignalingChannel signaling delegate instance associtated with this room. Is not required for you to set this property manually.

@property ECSignalingChannel *signalingChannel

Declared In

ECRoom.h

  status

The status of this Room.

@property (nonatomic, readonly) ECRoomStatus status

Declared In

ECRoom.h

  roomMetadata

Full response after signalling channel connect the server.

@property NSDictionary *roomMetadata

Declared In

ECRoom.h

  roomId

The Erizo room id for this room instance.

@property NSString *roomId

Declared In

ECRoom.h

  publishStreamId

NSString stream id of the stream being published

@property (readonly) NSString *publishStreamId

Declared In

ECRoom.h

  publishStream

ECStream referencing the stream being published.

@property (weak, readonly) ECStream *publishStream

Declared In

ECRoom.h

  streamsByStreamId

ECStream streams in the room.

@property (readonly) NSMutableDictionary *streamsByStreamId

Declared In

ECRoom.h

  remoteStreams

List of remote ECStream streams available in this room. They might be subscribed or not.

@property (readonly) NSArray *remoteStreams

Declared In

ECRoom.h

  recordEnabled

BOOL set/get enable recording of the stream being published.

@property BOOL recordEnabled

Declared In

ECRoom.h

  peerToPeerRoom

BOOL is P2P kind of room.

@property (readonly) BOOL peerToPeerRoom

Declared In

ECRoom.h

  peerFactory

RTC Factory shared by streams of this room.

@property RTCPeerConnectionFactory *peerFactory

Declared In

ECRoom.h

  publishingStats

BOOL enable/disable log publishing stats. Stats are collected each 2 seconds max, having this flag on produces console output, take a look to ECRoomStatsDelegate to being able to receive events when stats are collected.

@property BOOL publishingStats

Declared In

ECRoom.h

  defaultSubscribingStreamOptions

Represent a dictionary with the default values that will be sent at the moment of subscribe an ECStream.

@property NSMutableDictionary *defaultSubscribingStreamOptions

Declared In

ECRoom.h

Public Methods

– connectWithEncodedToken:

Creates a ECSignalingChannel instance using the given token.

- (void)connectWithEncodedToken:(NSString *)encodedToken

Parameters

encodedToken

The auth token for room access. See initWithEncodedToken: for token composition details.

Discussion

This method is required if you have instantiated ECRoom class without provided a token.

Declared In

ECRoom.h

– publish:

Publishes a given ECStream with given options.

- (void)publish:(ECStream *)stream

Parameters

stream

The stream from where we will be publishing.

See Also

Declared In

ECRoom.h

– unpublish

Un-Publish the stream being published.

- (void)unpublish

Declared In

ECRoom.h

– subscribe:

Subscribe to a remote stream.

- (BOOL)subscribe:(ECStream *)stream

Parameters

stream

ECStream object containing a valid streamId.

You should be connected to the room before subscribing to a stream. To know how to get streams ids take a look at the following methods:

Return Value

Boolean indicating if started to signaling to subscribe the given stream.

See Also

Declared In

ECRoom.h

– unsubscribe:

Unsubscribe from a remote stream.

- (void)unsubscribe:(ECStream *)stream

Parameters

stream

The stream you want to unsubscribe.

See Also

Declared In

ECRoom.h

– leave

Leave the room.

- (void)leave

Discussion

RTC and WS connections will be closed.

Declared In

ECRoom.h