Suggestions

close search

StringeeRoom

@interface StringeeRoom : NSObject

This class provides methods to make or join a room chat as a video conference.

roomId

The room's id generated by Stringee server.

@property (assign, nonatomic, readonly) long long roomId;
stringeeClient

The StringeeClient instance. For more information, see StringeeClient

@property (weak, nonatomic, readonly) StringeeClient *stringeeClient;
delegate

A delegate to monitor the room's events such as: other clients join/leave the room, publishes the local stream or subscribes remote streams. For more information, see StringeeRoomDelegate

@property (weak, nonatomic) id delegate;
- initWithStringeeClient:

Creates a new StringeeRoom instance with a StringeeClient instance.

- (instancetype)initWithStringeeClient:(StringeeClient *)stringeeClient;
- makeRoomWithCompletionHandler:

Makes a room with a callback:
- status = YES, code = 0, message = "Make room successfully"
- status = NO, code = 1, message = "Make room failed. The number of rooms exceeds the limit"
- status = NO, code = 2, message = "Make room failed. The client is not connected to Stringee Server"
- status = NO, code = 3, message = "Make room failed. Generic error"

- (void)makeRoomWithCompletionHandler:(void(^)(BOOL status, int code, NSString * message))completionHandler;
- joinRoomWithRoomId:completionHandler:

Joins a room with a callback:
- roomId: The room's id.
- status = YES, code = 0, message = "Join room successfully"
- status = NO, code = 1, message = "Join room failed. Room is not exist"
- status = NO, code = 2, message = "Join room failed. The client is not connected to Stringee Server"
- status = NO, code = 3, message = "Join room failed. Generic error"

- (void)joinRoomWithRoomId:(long long)roomId completionHandler:(void(^)(BOOL status, int code, NSString * message))completionHandler;
- publish:

Publishes a stream to the room:
- stream: The stream which will be published.

- (void)publish:(StringeeRoomStream *)stream;
- unPublish:

UnPublishes a stream:
- stream: The stream which will be unpublished.

- (void)unPublish:(StringeeRoomStream *)stream;
- subscribe:

Subscibes a stream:
- stream: The stream which will be subscribed.

- (void)subscribe:(StringeeRoomStream *)stream;
- unSubscribe:

UnSubscribes a stream:
- stream: The stream which will be unsubscribed.

- (void)unSubscribe:(StringeeRoomStream *)stream;
- destroy:

Destroys a room and release resources.

- (void)destroy;
- statsReportForStream:useVideoTrack:withCompletionHandler:

Gets the room's statistics to caculate network quality:
- useVideoTrack = YES, video track's statistics are returned.
- useVideoTrack = NO, the audio track's statistics are returned.
- stats: statistics.

- (void)statsReportForStream:(StringeeRoomStream *)stream useVideoTrack:(BOOL)useVideoTrack withCompletionHandler:(nullable void (^)( NSDictionary *stats ))completionHandler;