ECRoomDelegate Protocol Reference

Conforms to NSObject
Declared in ECRoom.h

Overview

ECRoomDelegate

Will fire events related with ECRoom state change.

– room:didSubscribeStream: required method

Fired when server sent the streamId of the subscribed stream.

- (void)room:(ECRoom *)room didSubscribeStream:(ECStream *)stream

Parameters

room

Instance of the room where event happen.

stream

The subscribed Stream object.

Declared In

ECRoom.h

– room:didUnSubscribeStream: required method

Fired when server has succesfully unsubscribed a stream.

- (void)room:(ECRoom *)room didUnSubscribeStream:(ECStream *)stream

Parameters

room

Instance of the room where event happen.

stream

The unSubscribed Stream object.

Declared In

ECRoom.h

– room:didPublishStream: required method

Fired when server sent the streamId of the published stream.

- (void)room:(ECRoom *)room didPublishStream:(ECStream *)stream

Parameters

room

Instance of the room where event happen.

stream

ECStream being published.

Declared In

ECRoom.h

– room:didUnpublishStream: required method

Fired when server ACK to unpublish the requested stream by ECRoom:unpublish. After this method is called the Room will close and nilify the publishing client. You need to unreference the publishing stream from your side to let the object be deallocated.

- (void)room:(ECRoom *)room didUnpublishStream:(ECStream *)stream

Parameters

stream

The stream being unpublished.

Declared In

ECRoom.h

– room:didStartRecordingStream:withRecordingId:recordingDate: required method

Fired when server sent the recordingId of a stream being published and recorded.

- (void)room:(ECRoom *)room didStartRecordingStream:(ECStream *)stream withRecordingId:(NSString *)recordingId recordingDate:(NSDate *)recordingDate

Parameters

room

Instance of the room where event happen.

stream

String representing the Id of the stream being recorded.

recordingId

String representing the Id of the recording of the stream.

recordingDate

moment when the server started to record the stream.

Declared In

ECRoom.h

– room:didFailStartRecordingStream:withErrorMsg: required method

Fired when server failed to start recording the stream.

- (void)room:(ECRoom *)room didFailStartRecordingStream:(ECStream *)stream withErrorMsg:(NSString *)errorMsg

Parameters

room

Instance of the room where event happen.

stream

String representing the Id of the stream being recorded.

errorMsg

The error message sent by the server.

Declared In

ECRoom.h

– room:didConnect: required method

Fired when signaling channel connected with Erizo Room.

- (void)room:(ECRoom *)room didConnect:(NSDictionary *)roomMetadata

Parameters

room

Instance of the room where event happen.

roomMetadata sample: { defaultVideoBW = 300; iceServers = ( { url = “stun:stun.l.google.com:19302”; }, { credential = secret; url = “turn:xxx.xxx.xxx.xxx:443”; username = me; } ); id = 591df649e29e562067143117; maxAudioBW = 64; maxVideoBW = 300; streams =( { audio = 1; id = 208339986973492030; video = 1; } ); }

Declared In

ECRoom.h

– room:didError:reason: required method

Fired each time there is an error with the room. It doesn’t mean the room has been disconnected. For example you could receive this message when one of the streams subscribed did fail for some reason.

- (void)room:(ECRoom *)room didError:(ECRoomErrorStatus)status reason:(NSString *)reason

Parameters

room

Instance of the room where event happen.

status

Status constant

reason

Text explaining the error. (Not always available)

Declared In

ECRoom.h

– room:didChangeStatus: required method

Fired each time the room changed his state.

- (void)room:(ECRoom *)room didChangeStatus:(ECRoomStatus)status

Parameters

room

Instance of the room where event happen.

status

ECRoomStatus value.

Declared In

ECRoom.h

– room:didAddedStream: required method

Event fired once a new stream has been added to the room.

- (void)room:(ECRoom *)room didAddedStream:(ECStream *)stream

Parameters

room

Instance of the room where event happen.

stream

ECStream object (not subscribed yet), that were just added to the room.

Discussion

It is up to you to subscribe that stream or not. It is worth to notice that your published stream will not be notified by this method, use ECRoomDelegate:didPublishStream: instead.

Declared In

ECRoom.h

– room:didRemovedStream: required method

Fired when a stream in a room has been removed, not necessary the stream was being consumed/subscribed.

- (void)room:(ECRoom *)room didRemovedStream:(ECStream *)stream

Parameters

room

Instance of the room where event happen.

stream

The removed stream.

@discusion After this method return the stream will be destroyed.

Declared In

ECRoom.h

– room:didReceiveData:fromStream: required method

Fired when a data stream is received.

- (void)room:(ECRoom *)room didReceiveData:(NSDictionary *)data fromStream:(ECStream *)stream

Parameters

room

Instance of the room where event happen.

data

stream message received.

stream

The ECStream received from.

Declared In

ECRoom.h

– room:didUpdateAttributesOfStream: required method

Fired when stream attribute updated.

- (void)room:(ECRoom *)room didUpdateAttributesOfStream:(ECStream *)stream

Parameters

room

Instance of the room where event happen.

stream

The stream that updated his attributes.

@discusion Look ECStream:streamAttributes to know which.

Declared In

ECRoom.h