RongRTCRoom Class Reference
Inherits from | NSObject |
---|---|
Declared in | RongRTCRoom.h |
delegate
房间 Delegate
@property (nonatomic, weak) id<RongRTCRoomDelegate> delegate
Discussion
房间 Delegate
Declared In
RongRTCRoom.h
roomId
房间ID
@property (nonatomic, copy, readonly) NSString *roomId
Discussion
房间ID
Declared In
RongRTCRoom.h
localUser
当前用户
@property (nonatomic, strong, readonly) RongRTCLocalUser *localUser
Discussion
当前用户
Declared In
RongRTCRoom.h
remoteUsers
参与用户
@property (nonatomic, strong, readonly) NSArray<RongRTCRemoteUser*> *remoteUsers
Discussion
参与用户
Declared In
RongRTCRoom.h
– publishDefaultAVStream:
发布默认音视频流,非直播模式使用
- (void)publishDefaultAVStream:(RongRTCOperationCallback)completion
Parameters
completion |
发布完成回调 |
---|
Discussion
发布默认音视频流,非直播模式使用
Declared In
RongRTCRoom.h
– publishDefaultLiveAVStream:
发布主播默认音视频流,此接口仅直播模式的主播可用,即 RongRTCRoomType 为 RongRTCRoomTypeLive 可用。
- (void)publishDefaultLiveAVStream:(RongRTCLiveOperationCallback)completion
Parameters
completion |
发布完成回调 |
---|
Discussion
发布主播默认音视频流,此接口仅直播模式的主播可用,即 RongRTCRoomType 为 RongRTCRoomTypeLive 可用。
Declared In
RongRTCRoom.h
– unpublishDefaultAVStream:
取消发布默认音视频流
- (void)unpublishDefaultAVStream:(RongRTCOperationCallback)comletion
Parameters
comletion |
取消发布完成回调 |
---|
Discussion
取消发布默认音视频流
Declared In
RongRTCRoom.h
– sendRTCMessage:success:error:
发送消息
- (RCMessage *)sendRTCMessage:(RCMessageContent *)content success:(void ( ^ ) ( long messageId ))successBlock error:(void ( ^ ) ( RCErrorCode nErrorCode , long messageId ))errorBlock
Parameters
content |
消息的内容 |
---|---|
successBlock |
消息发送成功的回调 [messageId:消息的ID] |
errorBlock |
消息发送失败的回调 [nErrorCode:发送失败的错误码,messageId:消息的ID] |
Return Value
发送的消息实体
Discussion
发送消息
注意: 该接口只能发送 persistentFlag 为 MessagePersistent_STATUS 的状态消息,远端用户如果不在线则消息丢失,自定义消息时下面标识一定要给出,否则会导致消息发送失败 + (RCMessagePersistent)persistentFlag { return MessagePersistent_STATUS; }
Declared In
RongRTCRoom.h
– setRoomAttributeValue:forKey:message:completion:
设置房间属性
- (void)setRoomAttributeValue:(NSString *)attributeValue forKey:(NSString *)key message:(RCMessageContent *)message completion:(RongRTCOperationCallback)completion
Parameters
attributeValue |
属性值 |
---|---|
key |
属性名称 |
message |
是否在设置属性的时候携带消息内容,传空则不往房间中发送消息 |
completion |
设置完成回调 |
Discussion
设置房间属性
Declared In
RongRTCRoom.h
– deleteRoomAttributes:message:completion:
删除房间属性
- (void)deleteRoomAttributes:(NSArray<NSString*> *)attributeKeys message:(RCMessageContent *)message completion:(RongRTCOperationCallback)completion
Parameters
attributeKeys |
属性名称数组 |
---|---|
message |
是否在设置属性的时候携带消息内容,传空则不往房间中发送消息 |
completion |
删除完成回调 |
Discussion
删除房间属性
Declared In
RongRTCRoom.h
– getRoomAttributes:completion:
获取房间属性
- (void)getRoomAttributes:(NSArray<NSString*> *)attributeKeys completion:(RongRTCAttributeOperationCallback)completion
Parameters
attributeKeys |
属性名称 |
---|---|
completion |
获取结果回调 |
Discussion
获取房间属性
Declared In
RongRTCRoom.h
– publishAVStream:extra:completion:
发布音视频流.
- (void)publishAVStream:(RongRTCAVOutputStream *)stream extra:(NSString *)extra completion:(RongRTCOperationCallback)completion
Parameters
stream |
发布的音视频流 |
---|---|
extra |
扩展信息 |
completion |
发布的音视频流结果 |
Discussion
发布音视频流.
Declared In
RongRTCRoom.h
– publishLiveAVStream:extra:completion:
- 发布音视频流,此接口仅直播模式的主播可用,即 RongRTCRoomType 为 RongRTCRoomTypeLive 可用。 *
- (void)publishLiveAVStream:(RongRTCAVOutputStream *)stream extra:(nonnull NSString *)extra completion:(nonnull RongRTCLiveOperationCallback)completion
Parameters
stream |
发布的音视频流 |
---|---|
extra |
扩展信息 |
completion |
发布的音视频流结果,包括此主播的推流 url |
Discussion
- 发布音视频流,此接口仅直播模式的主播可用,即 RongRTCRoomType 为 RongRTCRoomTypeLive 可用。 *
Declared In
RongRTCRoom.h
– publishDataStream:completion:
发布数据流.
- (void)publishDataStream:(RongRTCDataOutputStream *)stream completion:(RongRTCOperationCallback)completion
Parameters
stream |
发布的数据流 |
---|---|
completion |
发布的音视频流结果 |
Discussion
发布数据流.
Declared In
RongRTCRoom.h
– unpublishAVStream:extra:completion:
取消发布音视频流.
- (void)unpublishAVStream:(RongRTCAVOutputStream *)stream extra:(NSString *)extra completion:(RongRTCOperationCallback)completion
Parameters
stream |
取消发布的音视频流 |
---|---|
extra |
扩展信息 |
completion |
发布的音视频流结果 |
Discussion
取消发布音视频流.
Declared In
RongRTCRoom.h
– unpublishDataStream:completion:
取消发布数据流.
- (void)unpublishDataStream:(RongRTCDataOutputStream *)stream completion:(RongRTCOperationCallback)completion
Parameters
stream |
取消发布的数据流 |
---|---|
completion |
发布的音视频流结果 |
Discussion
取消发布数据流.
Declared In
RongRTCRoom.h
– subscribeAVStream:tinyStreams:completion:
订阅流,avStreams 表示正常大流,tinyStreams 需要订阅的小流,两个数组至少有一个不为空,如果全为空,SDK 将断言,如果小流数组中包含大流z数组中的流,则 SDK 认为为订阅小流。
- (void)subscribeAVStream:(nullable NSArray<RongRTCAVInputStream*> *)avStreams tinyStreams:(nullable NSArray<RongRTCAVInputStream*> *)tinyStreams completion:(nullable RongRTCOperationCallback)completion
Parameters
avStreams |
普通流 |
---|---|
tinyStreams |
需要携带小流的流数组 |
completion |
完成的回调 |
Discussion
订阅流,avStreams 表示正常大流,tinyStreams 需要订阅的小流,两个数组至少有一个不为空,如果全为空,SDK 将断言,如果小流数组中包含大流z数组中的流,则 SDK 认为为订阅小流。
Declared In
RongRTCRoom.h
– subscribeDataStream:completion:
接收数据流.
- (void)subscribeDataStream:(NSArray<RongRTCAVInputStream*> *)streams completion:(RongRTCOperationCallback)completion
Parameters
streams |
要接收的数据流 |
---|---|
completion |
结果 |
Discussion
接收数据流.
Declared In
RongRTCRoom.h
– unsubscribeAVStream:completion:
取消订阅音视频流,streams 不能为空,否则 SDK 将断言。
- (void)unsubscribeAVStream:(NSArray<RongRTCAVInputStream*> *)streams completion:(nonnull RongRTCOperationCallback)completion
Parameters
streams |
发布的音视频流 |
---|---|
completion |
发布的音视频流结果 |
Discussion
取消订阅音视频流,streams 不能为空,否则 SDK 将断言。
Declared In
RongRTCRoom.h
– unsubscribeDataStream:completion:
取消接收数据流.
- (void)unsubscribeDataStream:(NSArray<RongRTCAVInputStream*> *)streams completion:(RongRTCOperationCallback)completion
Parameters
streams |
要接收的数据流 |
---|---|
completion |
结果 |
Discussion
取消接收数据流.
Declared In
RongRTCRoom.h