Meeting Class Methods - Unity
GetMeetingObject()​
Initializes and returns an instance of the Meeting
class.
Parameters​
- None
Returns​
Meeting
: An instance of theMeeting
class.
Example​
Meeting meeting = Meeting.GetMeetingObject();
CreateMeetingId()​
The CreateMeetingId()
method is used to create a new meetingId using the provided authentication token. It triggers the appropriate callback with the generated meeting ID or an error message if the creation fails.
Parameters​
- token:
string
- A valid authentication token required to authorize the request for creating a meeting.
Returns​
void
Callbacks​
-
OnCreateMeetingIdCallback:
String
- Invoked with the newly created meeting ID on success.
-
OnCreateMeetingIdFailedCallback:
String
- Invoked with the error message if the meeting ID creation fails.
Example​
Meeting meeting = Meeting.GetMeetingObject();
meeting.OnCreateMeetingIdCallback += (meetingId) =>
{
Debug.Log("Meeting ID created: " + meetingId);
};
meeting.OnCreateMeetingIdFailedCallback += (error) =>
{
Debug.LogError("Failed to create meeting ID: " + error);
};
meeting.CreateMeetingId("YOUR_TOKEN");
Join()​
- The
Join()
method is used to join a meeting with the provided meeting ID, token, and participant details.
Parameters​
-
token:
string
- A valid authentication token required to join the meeting.
-
meetingId:
string
- The unique identifier of the meeting to join.
-
name:
string
- The display name of the participant.
-
micEnabled:
bool
- Specifies whether the microphone should be enabled when joining.
-
camEnabled:
bool
- Specifies whether the camera should be enabled when joining.
-
participantId:
string
(Optional)- A unique identifier for the participant. If not provided, it will be auto-generated.
Returns​
void
Callbacks:​
- OnParticipantJoinedCallback: IParticipant
- Triggered when a participant (local or remote) joins the meeting, along with the IParticipant object representing the participant who joined.
Example​
Meeting meeting = Meeting.GetMeetingObject();
meeting.OnParticipantJoinedCallback += (iParticipant) =>
{
Debug.Log("Participant joined: " + iParticipant.Name);
};
meeting.Join("YOUR_TOKEN", "MEETING_ID", "John Doe", true, true);
Customizing Meeting and Participant IDs
The Join
method allows developers to define custom values for meetingId
and participantId
:
meetingId
can be structured in any preferred format by the developer, e.g.,aaaa-bbbb
orxxxx-yyyy
, instead of following a predefined pattern.participantId
can also be set by the developer, but it must be unique for each participant in a meeting.
Leave()​
- The
Leave()
method is used to leave the current ongoing meeting. It triggers relevant callbacks to notify other participants.
Returns​
void
Callbacks:​
- OnParticipantLeftCallback: IParticipant
- Triggered for all participants (local or remote) when a participant leaves the meeting, along with the IParticipant object representing the participant who left.
Example​
Meeting meeting = Meeting.GetMeetingObject();
meeting.OnParticipantLeftCallback += (iParticipant) =>
{
Debug.Log("Participant left: " + iParticipant.Name);
};
meeting.Leave();
PauseAllStreams()​
- The
PauseAllStreams()
method pauses active media streams within the meeting. This method affects only the remote participant's streams.
Parameters​
- kind:
StreamKind
- Specifies the type of media stream to be paused. It can be
StreamKind.AUDIO
orStreamKind.VIDEO
.
- Specifies the type of media stream to be paused. It can be
Returns​
void
Callbacks:​
- The participant will receive an OnPausedAllStreamsCallback event containing the
StreamKind
representing kind of stream that was paused.
Example​
meeting.PauseAllStreams();
ResumeAllStreams()​
- The
ResumeAllStreams()
method resumes media streams that have been paused.
Parameters​
- kind:
StreamKind
- Specifies the type of media stream to be resumed. It can be
StreamKind.AUDIO
orStreamKind.VIDEO
.
- Specifies the type of media stream to be resumed. It can be
Returns​
void
Callbacks:​
- The participant will receive an OnResumedAllStreamsCallback event containing the
StreamKind
representing kind of stream that was resumed.
Example​
meeting.ResumeAllStreams();
Got a Question? Ask us on discord