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 *)factoryParameters
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 *)factoryParameters
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.
See Also
Declared In
ECRoom.h
Properties
delegate
ECRoomDelegate were this room will invoke methods as events.
@property (weak, nonatomic, readonly) id<ECRoomDelegate> delegateDeclared In
ECRoom.h
statsDelegate
ECRoomStatsDelegate delegate to receive stats. Notice that you should also set publishingStats to YES.
@property (weak, nonatomic) id<ECRoomStatsDelegate> statsDelegateDeclared In
ECRoom.h
signalingChannel
ECSignalingChannel signaling delegate instance associtated with this room. Is not required for you to set this property manually.
@property ECSignalingChannel *signalingChannelDeclared In
ECRoom.h
status
The status of this Room.
@property (nonatomic, readonly) ECRoomStatus statusDeclared In
ECRoom.h
roomMetadata
Full response after signalling channel connect the server.
@property NSDictionary *roomMetadataDeclared In
ECRoom.h
publishStreamId
NSString stream id of the stream being published
@property (readonly) NSString *publishStreamIdDeclared In
ECRoom.h
publishStream
ECStream referencing the stream being published.
@property (weak, readonly) ECStream *publishStreamDeclared In
ECRoom.h
streamsByStreamId
ECStream streams in the room.
@property (readonly) NSMutableDictionary *streamsByStreamIdDeclared In
ECRoom.h
remoteStreams
List of remote ECStream streams available in this room. They might be subscribed or not.
@property (readonly) NSArray *remoteStreamsDeclared In
ECRoom.h
recordEnabled
BOOL set/get enable recording of the stream being published.
@property BOOL recordEnabledDeclared In
ECRoom.h
peerToPeerRoom
BOOL is P2P kind of room.
@property (readonly) BOOL peerToPeerRoomDeclared In
ECRoom.h
peerFactory
RTC Factory shared by streams of this room.
@property RTCPeerConnectionFactory *peerFactoryDeclared 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 publishingStatsDeclared In
ECRoom.h
defaultSubscribingStreamOptions
Represent a dictionary with the default values that will be sent at the moment of subscribe an ECStream.
@property NSMutableDictionary *defaultSubscribingStreamOptionsDeclared In
ECRoom.h
Public Methods
– connectWithEncodedToken:
Creates a ECSignalingChannel instance using the given token.
- (void)connectWithEncodedToken:(NSString *)encodedTokenParameters
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 *)streamParameters
stream |
The stream from where we will be publishing. |
|---|
See Also
ECRoomDelegate:room:didPublishStream:
Declared In
ECRoom.h
– subscribe:
Subscribe to a remote stream.
- (BOOL)subscribe:(ECStream *)streamParameters
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
ECRoomDelegate:room:didAddedStream:
Declared In
ECRoom.h
– unsubscribe:
Unsubscribe from a remote stream.
- (void)unsubscribe:(ECStream *)streamParameters
stream |
The stream you want to unsubscribe. |
|---|
See Also
ECRoomDelegate:room:didUnSubscribeStream:
Declared In
ECRoom.h
– leave
Leave the room.
- (void)leaveDiscussion
RTC and WS connections will be closed.
Declared In
ECRoom.h