The Methods below are available for Video Broadcast:
Method | Description |
---|---|
sendAVBroadcastRequest | Allows logged-in user to initiate a video Broadcast |
startAVBroadcastWithInitiator | Starts the Video Broadcast in a provided UI container |
inviteUser | Invite Other users to view a video Broadcast |
endAVBroadcastWithUser | Ends the Video Broadcast |
muteAudio | Allows logged in user to mute/unmute his audio |
switchSpeakers | Allows logged-in user to switch the speaker |
pauseVideo | Allows logged in user to turn off/on his video |
toggleCamera | Allows logged-in user to switch the camera |
SendAVBroadcastRequest
Allows logged-in user to initiate an Video Broadcast Method Signature:
public virtual void SendAVBroadcastRequest(
string userId,
bool isGroup,
Action < NSDictionary > response,
Action < NSError> failure
)
Example:
cometchat.SendAVBroadcastRequest("15",false
(dict) => { this.response(dict); /* Code Block */ },
(err) => { this.failure(err); /* Code Block */ }
);
Arguments:
Argument | Description |
---|---|
userID | userId of a viewer |
isGroup | set isGroup to yes if AV Broadcast is initiated in groups |
callback | success and failure callbacks |
Response for successCallback:
{
"id": "15",
"callid": "bf1e7055f8e15d6f8662c7c4b6f8adb9"
}
Description:
Response Property | Description |
---|---|
id | userId of a viewer |
callid | id of the call session |
StartAVBroadCast
Starts the AV Broadcast in the provided UI container
Method Signature:
public virtual void StartAVBroadCast(
string callId,
bool iamBroadcaster
NSObject container,
Action < NSDictionary > response,
Action < NSError> failure
)
Example:
cometchat.StartAVBroadCast("474a3e0baf0e3db251a2bc2a6a5b31a5",true,this,
(dict) => { this.response(dict); /* Code Block */ },
(err) => { this.failure(err); /* Code Block */ }
);
Arguments:
Argument | Description |
---|---|
callID | id of a call received in onAvchatMessageReceived() callback |
initiator | set to true if you initiate the broadcast, else set to false |
container | UI container to hold AV Broadcast UI |
callback | failure callbacks |
InviteUsersInBroadcast
Invite Other users to view a video Broadcast Method Signature:
public virtual void InviteUsersInBroadcast(
string userId,
string callId,
Action < NSDictionary > response,
Action < NSError> failure
)
Example:
cometchat.InviteUsersInBroadcast("15","474a3e0baf0e3db251a2bc2a6a5b31a5",
(dict) => { this.response(dict); /* code block */ },
(err) => { this.failure(err); /* code block */ }
);
Arguments:
Argument | Description |
---|---|
userID | String containg userId of the users |
callID | id of a call received in onAVBroadcastMessageReceived() callback |
callback | success and failure callbacks |
Response for successCallback:
{
"message": "users invited successfully"
}
Description:
Response Property | Description |
---|---|
message | a success message |
endAVBroadcastCall
Ends the Video Broadcast Method Signature:
public virtual void endAVBroadcastCall(
Bool iamBroadcaster,
string userId,
string callId,
Bool isGroup,
Action < NSDictionary > response,
Action < NSError> failure
)
Example:
cometchat.endAVBroadcastCall(true,"15","474a3e0baf0e3db251a2bc2a6a5b31a5",false
(dict) => { this.response(dict); /* code block */ },
(err) => { this.failure(err); /* code block */ }
);
Arguments:
Argument | Description |
---|---|
initiator | Set Yes if you were the initiator of Broadcast else set to No |
userID | userId of other chat participant |
callID | id of a call received in onAVBroadcastMessageReceived() callback |
callback | success and failure callbacks |
Response for successCallback:
{
"id": "15"
}
Description:
Response Property | Description |
---|---|
id | userId of other chat participant |
muteAudio
Allows logged in user to mute/unmute the audio
Method Signature:
public virtual void muteAudio( bool audioControlFlag );
Example:
cometChat.muteAudio(YES);
Arguments:
Argument | Description |
---|---|
audioControlFlag | turn audio on/off |
switchSpeakers
Allows logged-in user to switch the speaker
Method Signature:
public virtual void SwitchSpeakers()
Example:
cometchat.SwitchSpeakers();
pauseVideo
Allows logged in user to pause/unpause the video
Method Signature:
public virtual void pauseVideo( bool videoControlFlag );
Example:
cometChat.pauseVideo(true);
Arguments:
Argument | Description |
---|---|
videoControlFlag | turn video on/off |
toggleCamera
Allows logged-in user to switch the camera
Method Signature:
public virtual void toggleCamera();
Example:
cometChat.toggleCamera();