Super room

12.1 Get XHSuperRoomManage instance and add the XHSuperRoomManagerDelegate event protocol function.


[[XHClient sharedClient].superRoomManager addDelegate:self];


/**
Someone has joined the super room
@param uid user ID
@param liveID live room ID
@return view for displaying the video of the joiner
*/
- (UIView *)onActorJoined:(NSString *)uid live:(NSString *)liveID
{
}


/**
Someone has left the super room

@param uid user ID
@param liveID live room ID
*/
- (void)onActorLeft:(NSString *)uid live:(NSString *)liveID
{
}


/**
Some abnormal conditions may cause the live to go wrong. Please leave the live broadcast after receiving the callback.
@param error error information
@param liveID super room ID
*/
- (void)onSuperRoomError:(NSError *)error live:(NSString *)liveID
{
}


/**
The number of members has changed

@param membersNumber Number of members
*/
- (void)liveMembersNumberUpdated:(NSInteger)membersNumber
{
}


/**
You are kicked
*/
- (void)liveUserKicked
{
}

/**
* you are being muted
* @param seconds the mute time
*/
- (void)onSelfMuted:(NSInteger) seconds
{
}

/**
*You are forced to stop live.
@param liveID super room ID
*/
- (void)onCommandToStopPlay:(NSString *)liveID
{
}

/**
receive a message

@param message message
*/
- (void)liveMessageReceived:(NSString *)message fromID:(NSString *)fromID
{
}
/**
receive a private message

@param message message
@param fromID message sender
*/
- (void)livePrivateMessageReceived:(NSString *)message fromID:(NSString *)fromID
{
}


/**
* Receive real-time data
* @param data data
* @param upId user ID
*/
- (void)onReceiveRealtimeData:(NSString *)data
upId:(NSString *)upId
{
}

12.2 XHSuperRoomManager API Description


/**
Set video parameters

@param config parameters
*/
- (void)setVideoConfig:(XHVideoConfig *)config;

/**
Set callback delegate

@param delegate delegate
*/
- (void)addDelegate:(id<XHSuperRoomManagerDelegate>)delegate;


/**
* set media type
* @param mediaType type
*/
- (void)setRtcMediaType:(XHRtcMediaTypeEnum) mediaType;

/**
Create a super room

@param liveItem the super room information
@param completion callback
*/
- (void)createSuperRoom:(XHSuperRoomItem *) superRoomItem completion:(void(^)(NSString *liveID, NSError *error))completion;

/**
* Join the super room
* @param roomID super room ID
* @param completion callback
*/
- (void)joinSuperRoom:(NSString *)liveID completion:(void(^)(NSError *error))completion;

/**
* Stop speaking
* @param completion callback
*/
- (void)layDownMic:(void(^)(NSError *error))completion;

/**
* Apply for a speech
* @param completion callback
*/
- (void)pickUpMic:(void(^)(NSError *error))completion;

/**
* Leave the super room
* @param completion callback
*/
- (void)leaveSuperRoom:(void(^)(NSError *error))completion;

/**
stop to be an anchor

@param toID the user ID who is being stopped to be an anchor
@param completion callback
*/
- (void)commandToAudience:(NSString *)toID
completion:(void(^)(NSError *error))completion;

/**
Switch camera direction

@return Camera orientation after switching
*/
- (XHCameraDirection)switchCamera;

/**
Switch to the big video preview

@param view the preview which will be switched
*/
- (void)changeToBig:(UIView *)view;


/**
Switch to the small video preview
@param view the preview which will be switched
*/
- (void)changeToSmall:(UIView *)view;



/**
发送消息

@param message 消息
@param completion 回调
*/
- (void)sendMessage:(NSString *)message completion:(void(^)(NSError *error))completion;

/**
send a message

@param message message
@param completion callback
*/
- (void)sendMessage:(NSString *)message completion:(void(^)(NSError *error))completion;

/**
send a private message

@param message message
@param toID receiver ID
@param completion callback
*/
- (void)sendMessage:(NSString *)message toID:(NSString *)toID completion:(void(^)(NSError *error))completion;

/**
mute somebody in the live room

@param member the member who is mute
@param seconds mute time
@param liveId live room id
@param completion callback
*/
- (void)muteMember:(NSString *)member
muteSeconds:(NSInteger)seconds
fromLive:(NSString *)liveId
completion:(void(^)(NSError *error))completion;

/**
unmute somebody in the chatroom

@param member the member who is unmute
@param liveId live room id
@param completion callback
*/
- (void)unMuteMember:(NSString *)member
fromLive:(NSString *)liveId
completion:(void(^)(NSError *error))completion;

/**
kick a member

@param member the member who is kicked
@param liveId live room id
@param completion callback
*/
- (void)kickMember:(NSString *)member
fromLive:(NSString *)liveId
completion:(void(^)(NSError *error))completion;


/**
* Switch audio
@param enable switch
*/
- (void)setAudioEnable:(BOOL) enable;

/**
* Switch video
@param enable switch
*/
- (void)setVideoEnable:(BOOL) enable;

/**
* Save the super room to the list
* @param userId user ID
* @param type type
* @param liveId super room ID
* @param info super room information
* @param completion callback
*/
-(void)saveToList:(NSString *)userId
type:(NSInteger) type
liveId:(NSString *) liveId
info:(NSString *)info
completion:(void(^)(NSError *error))completion;



/**
* Query the super room list
* @param userId user ID
* @param type type
* @param completion callback
*
*/
- (void)querySuperRoomList:(NSString *)userId
type:(NSString *)type
completion:(void(^)(NSString *listInfo, NSError *error))completion;

/**
* delete from the super room list
* @param liveId super room ID
* @param listType list type
* @param completion callback
*/
- (void)deleteFromSuperRoomList:(NSString *)liveId
listType:(NSInteger)listType
completion:(void(^)(NSError *error))completion;