Skip to main content
Version: 2.x.x

Meeting Class Methods - Unity


GetMeetingObject()​

Initializes and returns an instance of the Meeting class.

Parameters​

  • None

Returns​

  • Meeting: An instance of the Meeting 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.
  • CustomVideoStream: object

    • Custom configuration for the stream settings. This parameter is optional.

      • Default : videoEncoder = h240p_w320p for Android & iOS.
    • Parameters:

      • videoEncoder: VideoEncoderConfig (Optional)
        • Default : h144p_w176p for Android, h90p_w160p for iOS
      • isMultiStream: bool (Optional)
        • Default: true
      • videoDevice: VideoDevice (Optional)
        • Default: Front camera
  • 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​

  private void SetCustomVideoStream()
{
Debug.Log($"Set Custom stream => {videoEncoder}");
CustomVideoStream customVideoStream = new CustomVideoStream(videoEncoder, false, selectedVideoDevice);
//CustomVideoStream customVideoStream = new CustomVideoStream(videoEncoder, false);
//CustomVideoStream customVideoStream = new CustomVideoStream(videoEncoder);
//CustomVideoStream customVideoStream = new CustomVideoStream(isMultiStream : true);
//CustomVideoStream customVideoStream = new CustomVideoStream(videoDevice: selectedVideoDevice);
this.customVideoStream = customVideoStream;
}

// Join the meeting with custom stream configuration
meeting.Join("YOUR_TOKEN", "MEETING_ID", "John Doe", true, true, this.customVideoStream);
// 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 or xxxx-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 or StreamKind.VIDEO.

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 or StreamKind.VIDEO.

Returns​

  • void

Callbacks:​

  • The participant will receive an OnResumedAllStreamsCallback event containing the StreamKind representing kind of stream that was resumed.

Example​

meeting.ResumeAllStreams();

GetAudioDevices()​

  • The GetAudioDevices() method returns a list of currently available audio devices. The method returns a list of AudioDeviceInfo objects describing the audio devices.

  • AudioDeviceInfo class has three properties :

    1. AudioDeviceInfo.deviceId

      • Returns a string that is an identifier for the represented device, persisted across sessions.
    2. AudioDeviceInfo.label

      • Returns a string describing this device (for example BLUETOOTH).
    3. AudioDeviceInfo.kind

      • Returns an enumerated value that is audio.

Parameters​

  • None

Returns​

  • AudioDeviceInfo[]

Example​

Meeting meeting = Meeting.GetMeetingObject();
AudioDeviceInfo[] audioDevices = meeting.GetAudioDevices();

// Display available audio devices
if (audioDevices != null && audioDevices.Length > 0)
{
Debug.Log($"Found {audioDevices.Length} audio devices:");
foreach (AudioDeviceInfo device in audioDevices)
{
Debug.Log($"Device ID: {device.deviceId}, Label: {device.label}");
}
}
else
{
Debug.Log("No audio devices found.");
}

GetVideoDevices()​

  • The GetVideoDevices() method returns a list of currently available video devices. The method returns a list of VideoDeviceInfo objects describing the video devices.

  • VideoDeviceInfo class has four properties :

    1. VideoDeviceInfo.deviceId

      • Returns a string that is an identifier for the represented device, persisted across sessions.
    2. VideoDeviceInfo.label

      • Returns a string describing this device (for example BLUETOOTH).
    3. VideoDeviceInfo.kind

      • Returns an enumerated value that is video .
    4. VideoDeviceInfo.FacingMode

      • Returns a value of type FacingMode indicating which camera device is in use (front or back).

Parameters​

  • None

Returns​

  • VideoDeviceInfo[]

Example​

Meeting meeting = Meeting.GetMeetingObject();
VideoDeviceInfo[] videoDevices = meeting.GetVideoDevices();

// Display available video devices
if (videoDevices != null && videoDevices.Length > 0)
{
Debug.Log($"Found {videoDevices.Length} video devices:");
foreach (VideoDeviceInfo device in videoDevices)
{
Debug.Log($"Device ID: {device.deviceId}, Label: {device.label}, Facing: {device.FacingMode}");
}
}
else
{
Debug.Log("No video devices found.");
}

ChangeAudioDevice()​

  • The ChangeAudioDevice() method sets the desired audio device, enabling users to choose which device to use in the meeting.

Parameters​

  • obj: AudioDeviceInfo

Returns​

  • void

Example​

Meeting meeting = Meeting.GetMeetingObject();

// First, get available audio devices
AudioDeviceInfo[] audioDevices = meeting.GetAudioDevices();

// Check if there are any devices available
if (audioDevices != null && audioDevices.Length > 0)
{
// Find a specific device (e.g., a Bluetooth headset)
AudioDeviceInfo audioDevice = null;
foreach (AudioDeviceInfo device in audioDevices)
{
if (device.label.Contains("Bluetooth"))
{
audioDevice = device;
break;
}
}

// Change to the selected device if found
if (audioDevice != null)
{
Debug.Log($"Changing audio device to: {audioDevice.label}");
meeting.ChangeAudioDevice(audioDevice);
}
}

ChangeVideoDevices()​

  • The ChangeVideoDevices() method sets the desired video device, enabling users to choose which device to use in the meeting.

Parameters​

  • obj: VideoDeviceInfo

Returns​

  • void

Example​

Meeting meeting = Meeting.GetMeetingObject();

// First, get available video devices
VideoDeviceInfo[] videoDevices = meeting.GetVideoDevices();

// Check if there are any devices available
if (videoDevices != null && videoDevices.Length > 0)
{
// Find a specific device (e.g., back camera)
VideoDeviceInfo videoDevice = null;
foreach (VideoDeviceInfo device in videoDevices)
{
if (device.FacingMode == FacingMode.back) // Back camera
{
videoDevice = device;
break;
}
}

// Change to the selected device if found
if (videoDevice != null)
{
Debug.Log($"Changing video device to: {videoDevice.label}");
meeting.ChangeVideoDevice(videoDevice);
}
}

GetSelectedAudioDevice()​

  • The GetSelectedAudioDevice() method returns the AudioDeviceInfo object representing the audio device currently in use.

Parameters​

  • None

Returns​

  • AudioDeviceInfo : An object containing information about the currently selected audio device.

Example​

Meeting meeting = Meeting.GetMeetingObject();
AudioDeviceInfo selectedDevice = meeting.GetSelectedAudioDevice();

if (selectedDevice != null)
{
Debug.Log($"Currently using audio device: {selectedDevice.label} (ID: {selectedDevice.deviceId})");
}
else
{
Debug.Log("No audio device is currently selected.");
}

GetSelectedVideoDevice()​

  • The GetSelectedVideoDevice() method returns the VideoDeviceInfo object representing the video device currently in use.

Parameters​

  • None

Returns​

  • VideoDeviceInfo : An object containing information about the currently selected video device.

Example​

Meeting meeting = Meeting.GetMeetingObject();
VideoDeviceInfo selectedDevice = meeting.GetSelectedVideoDevice();

if (selectedDevice != null)
{
Debug.Log($"Currently using camera: {selectedDevice.label} (ID: {selectedDevice.deviceId})");
Debug.Log($"Camera facing mode: {selectedDevice.FacingMode}");
}
else
{
Debug.Log("No camera is currently selected.");
}

Got a Question? Ask us on discord