SDK Reference

Classes


MeetingSDK

Your application should provide the user interface to display a meeting with two or more participants and provide UI elements to start/end a meeting and to control audio and video, such as volume selectors, mute buttons, end call button, and participant info. The application must also provide container views to hold videos and manage their layout and control.

📘

Info

MeetingSDK is a singleton and provides static access to all methods. As such, this class does not have a public constructor, and must be initialized through initializeSDK

Audio

The audio volume is represented by a number between 0 (mute) and 100 (full volume). At start of meeting, volume defaults to 50 for all incoming audio streams.

Video

Each video in a meeting has an associated streamId. A participant can have more than one video stream at a time in the meeting, so the streamId is necessary to identify a specific video in some of the notification events as well as SDK methods.

After a meeting has been successfully joined, the application can start capturing video. The MeetingSDK provides access to front and back facing cameras using the device names:

  • MeetingSDK.ANDROID_FRONT_CAMERA
  • MeetingSDK.ANDROID_BACK_CAMERA

Public Constants

NameValueDescription
ANDROID_BACK_CAMERA"Android Back Camera"String representing the back facing camera on your device
ANDROID_FRONT_CAMERA"Android Front Camera"String representing the front facing camera on your device

Public Methods

FunctionParamsReturns
changeVideoResolutionString: resolutionBoolean
destroySDKnonevoid
disableAudioInputnoneBoolean
disableAudioOutputnoneBoolean
disableScreenCapturenonevoid
disableVideoCapturenoneBoolean
disableVideoStreamParticipant: participant
String: streamId
void
enableAudiononeBoolean
enableAudioInputString: deviceNameBoolean
enableAudioOutputString: deviceNameBoolean
enableScreenCaptureString: deviceName
String: resolution
Boolean
enableVideoCaptureString: deviceNameBoolean
enableVideoCaptureString: deviceName
String: resolution
Boolean
enableVideoStreamParticipant: participant
String: streamId
void
exitMeetingnonevoid
getAudioInputDevicesnoneArray
getAudioOutputDevicesnoneArray
getAudioVersionnoneString
getLastErrorTYPE: typeString
getParticipantsnoneArrayList<Participant>
getParticipantByStreamIdString: streamIdParticipant
getSupportedVideoResolutionsString: deviceNameArray
getTraceHistoryString: fileNamevoid
getVideoResolutionnoneString
getVideoVersionnoneString
joinMeetingString: nameint
initializeMeetingString: server
String: guid
IInitializeMeetingCompleteCallback: initDoneCallback
void
initializeSDKContext: contextvoid
setAudioStreamVolumeString: streamId
Int: volume
Boolean
setNotificationCallbackINotificationCallback: callbackvoid
switchCamerafinal String: newCamera
ISwitchCameraCallback: callback
void

 

changeVideoResolution

public static boolean changeVideoResolution(String resolution)
static fun changeVideoResolution(resolution: String): Boolean

Application can change the video resolution after video capture has started by calling this method with the desired resolution.

ParametersTypeDescription
resolutionStringNew video resolution/codec to be utilized. List of supported video resolutions for the current camera can be retrieved using getSupportedVideoResolutions()
Returns
booleanReturns true if operation successful, returns false otherwise.

 

destroySDK

public static void destroySDK()
static fun destroySDK()

Cleans up low level audio and video. Destroys MeetingSDK singleton instance.

 

disableAudioInput

public static boolean disableAudioInput()
static fun disableAudioInput(): Boolean

Disables the input microphone for the device. Useful method for implementing a mute button in your app.

Returns
booleanReturns true if operation successful, returns false otherwise.

 

disableAudioOutput

public static boolean disableAudioOutput()
static fun disableAudioOutput(): Boolean

Disables the audio output for the device, essentially muting all other participants in the meeting.

Returns
booleanReturns true if operation successful, returns false otherwise.

 

disableScreenCapture

public static void disableScreenCapture()
static fun disableScreenCapture()

Stops capturing local screen. After disabling capture, the application will receive a notification that the stream has been removed and can remove its container view. Please see the FAQ section on Screen Sharing for further instructions.

 

disableVideoCapture

public static boolean disableVideoCapture()
static fun disableVideoCapture(): Boolean

Stops capturing local video. After disabling capture, the application will receive a notification that the stream has been removed and can remove its container view.

Returns
booleanReturns true if operation successful, returns false otherwise.

 

disableVideoStream

public static void disableVideoStream(Participant participant, String streamId)
static fun disableVideoStream(participant: Participant, streamId: String)

Disables showing the participant's video stream. A disabled stream will not show up again until re-enabled.

ParametersTypeDescription
participantParticipantObject containing information about the participant.
streamIdStringID for the participant's video stream.

 

enableAudio

public static boolean enableAudio()
static fun enableAudio(): Boolean

Enables both audio input and output for your device.

Returns
booleanReturns true if operation successful, returns false otherwise.

 

enableAudioInput

public static boolean enableAudioInput(String deviceName)
static fun enableAudioInput(deviceName: String): Boolean

Enables the input microphone for the device.

ParametersTypeDescription
deviceNameStringName of the desired audio input device.
Returns
booleanReturns true if operation successful, returns false otherwise.

 

enableAudioOutput

public static boolean enableAudioOutput(String deviceName)
static fun enableAudioOutput(deviceName: String): Boolean

Enables the audio output for the device, allowing the local participant to hear other participants in the meeting.

ParametersTypeDescription
deviceNameStringName of the desired audio output device.
Returns
booleanReturns true if operation successful, returns false otherwise.

 

enableScreenCapture

public static boolean enableScreenCapture(String deviceName, String resolution)
static fun enableScreenCapture(deviceName: String, resolution: String): Boolean

Starts sharing local device screen with desired resolution. Application can call MeetingSDK.getLastError() for more details if call failed. Please see the FAQ section on Screen Sharing for further instructions.

ParametersTypeDescription
deviceNameStringName of the desired camera/device.
resolutionStringVideo resolution/codec to be utilized. List of supported video resolutions for the current camera can be retrieved using getSupportedVideoResolutions().
Returns
booleanReturns true if operation successful, returns false otherwise.

 

enableVideoCapture

public static boolean enableVideoCapture(String deviceName)
static fun enableVideoCapture(deviceName: String): Boolean

Starts capturing local video using the default resolution, which is VP8 Medium (CIF) 352x288. Application can call MeetingSDK.getLastError() for more details if call failed.

ParametersTypeDescription
deviceNameStringName of the desired camera/device.
Returns
booleanReturns true if operation successful, returns false otherwise.

 

enableVideoCapture

public static boolean enableVideoCapture(String deviceName, String resolution)
static fun enableVideoCapture(deviceName: String, resolution: String): Boolean

Starts capturing local video with desired resolution. Application can call MeetingSDK.getLastError() for more details if call failed.

ParametersTypeDescription
deviceNameStringName of the desired camera/device.
resolutionStringVideo resolution/codec to be utilized. List of supported video resolutions for the current camera can be retrieved using getSupportedVideoResolutions().
Returns
booleanReturns true if operation successful, returns false otherwise.

 

enableVideoStream

public static void enableVideoStream(Participant participant, String streamId)
static fun enableVideoStream(participant: Participant, streamId: String)

Enable showing the participant's video stream. Whenever a new video stream becomes available in the meeting, the application will receive a notification of a new participant stream. The stream must be enabled by application using this function before it can be displayed on screen.

ParametersTypeDescription
participantParticipantObject containing information about the participant.
streamIdStringID for the participant's video stream.

 

exitMeeting

public static void exitMeeting()
static fun exitMeeting()

Exit meeting and clean up any resources allocated.

 

getAudioInputDevices

public static String[] getAudioInputDevices()
static fun getAudioInputDevices(): Array<String>

Returns a list of the available local audio input devices.

Returns
String[ ]List of local audio input devices.

 

getAudioOutputDevices

public static String[] getAudioOutputDevices()
static fun getAudioOutputDevices(): Array<String>

Returns a list of the available local audio output devices.

Returns
String[ ]List of local audio output devices.

 

getAudioVersion

public static String getAudioVersion()
static fun getAudioVersion(): String
Returns
StringVersion string of the MeetingSDK's audio library

 

getLastError

public static String getLastError(TYPE type)
static fun getLastError(type: TYPE): String

Returns last error encountered by SDK or native libraries.

ParametersTypeDescription
typeTYPEEnum class to determine what type of error to return, possible values are TYPE.AUDIO and TYPE.VIDEO
Returns
StringString containing last error of specified type

 

getParticipants

public static ArrayList<Participant> getParticipants()
static fun getParticipants(): ArrayList<Participant>
Returns
ArrayList<Participant>List of participants in the meeting.

 

getParticipantByStreamId

public static Participant getParticipantByStreamId(String streamId)
static fun getParticipantByStreamId(streamId: String): Participant
ParametersTypeDescription
streamIdStringID for a participant's video stream.
Returns
ParticipantObject containing information about the participant with the matching streamId

 

getSupportedVideoResolutions

public static String[] getSupportedVideoResolutions(String deviceName)
static fun getSupportedVideoResolutions(deviceName: String): Array<String>

If supported by the camera, the function may return any of the following codec values:

  • H.261 Standard (CIF)
  • VP8 Small (QCIF)
  • VP8 Medium (CIF)
  • VP8 Large (VGA)
  • VP8 HD1 (720p)
  • VP8 HD2 (960p)
  • VP8 HD3 (1080p)
  • VP8 4K (30FPS)
ParametersTypeDescription
deviceNameStringName of the desired camera.
Returns
String[ ]Array of supported codec values for that camera.

 

getTraceHistory

public static void getTraceHistory(String fileName)
static fun getTraceHistory(fileName: String)

Write trace log messages to the specified file.

ParametersTypeDescription
fileNameStringFull path name of a file in writable area of device.

 

getVideoResolution

public static String getVideoResolution()
static fun getVideoResolution(): String

Gets the codec currently in use by locally captured video

Returns
StringName of currently selected codec

 

getVideoVersion

public static String getVideoVersion()
static fun getVideoVersion(): String
Returns
StringVersion string of the MeetingSDK's video library.

 

joinMeeting

public static int joinMeeting(String name)
static fun joinMeeting(name: String): Int

Adds you as a participant in the meeting and set up your device to connect with audio and video services.
If method succeeds your application will begin to receive notifications when new participants are added to the meeting, when participant's audio and video streams are available, and when the participants leave the meeting. To receive these audio and video events from the SDK the application must implement the INotificationCallback interface.

ParametersTypeDescription
nameStringParticipant name to be displayed in the meeting
Returns
intReturns 1 when the meeting is joined successfully, returns 0 on failure

 

initializeMeeting

public static void initializeMeeting(String server, String guid, IInitializeMeetingCompleteCallback initDoneCallback)
static fun initializeMeeting(server: String, guid: String, initDoneCallback: IInitializeMeetingCompleteCallback)
ParametersTypeDescription
serverStringName/URL of server where the meeting is being hosted.
guidStringUUID string referencing meeting to initialize.
initDoneCallbackIInitializeMeetingCompleteCallbackCallback to be notified of the result of the init call once it is complete. If this callback is not successful, application will not be able to join meeting.

 

initializeSDK

public static void initializeSDK(Context context)
static fun initializeSDK(context: Context)
ParametersTypeDescription
contextContextContext which will be used to initialize MeetingSDK singleton and determine lifecycle. Implementation should use activity context.

 

setAudioStreamVolume

public static boolean setAudioStreamVolume(String streamId, int volume)
static fun setAudioStreamVolume(streamId: String, volume: Int): Boolean

Adjusts the volume for the provided audio stream. Cannot be used for the local participant

ParametersTypeDescription
streamIdStringID for a participant's audio stream.
volumeintValue between 0 and 100 that sets the new volume for that audio stream
Returns
booleanReturns true if operation successful, returns false otherwise.

 

setNotificationCallback

public static void setNotificationCallback(INotificationCallback callback)
static fun setNotificationCallback(callback: INotificationCallback)

Set application callback to receive events from SDK. Must be called before [JoinMeeting] I (#joinmeeting) or else the application will crash.

ParametersTypeDescription
callbackINotificationCallbackCallback interface that will be called upon different meeting events.

 

switchCamera

public static void switchCamera(final String newCamera, ISwitchCameraCallback callback)
static fun switchCamera(newCamera: String, callback: ISwitchCameraCallback)
ParametersTypeDescription
newCamerafinal StringName of new camera. Value will be either MeetingSDK.ANDROID_FRONT_CAMERA or MeetingSDK.ANDROID_BACK_CAMERA.
callbackISwitchCameraCallbackCallback to receive a notification whether the MeetingSDK was able to switch cameras.

 

Participant

The Participant class contains methods to retrieve information on a participant that has joined the meeting. It is used to share data between the MeetingSDK and your application.

Public Methods

FunctionParamsReturns
getSiteNamenoneString
getSiteNameString: streamIdString
getAudioStreamIdnoneString
isLocalnoneBoolean
setVolumeInt: newVolumevoid
getVolumenoneString
isMutednoneBoolean
getWidthInt: streamIdInt
getHeightInt: streamIdInt
getVideoStreamIdsnoneString[]
isActiveString: streamIdBoolean

 

getSiteName

public String getSiteName()
fun getSiteName(): String
Returns
StringName of a remote participant. Local participant name requires getSiteName(String streamId) function.

 

getSiteName

public String getSiteName(String streamId)
fun getSiteName(streamId: String): String
ParametersTypeDescription
streamIdStringID for a participant's video stream
Returns
StringName of the participant associated with the passed streamId.

 

getAudioStreamId

public String getAudioStreamId()
fun getAudioStreamId(): String
Returns
StringAudio stream ID of participant.

 

isLocal

public boolean isLocal()
fun isLocal(): Boolean
Returns
booleanReturns true if this participant is local to current device. Returns false is participant is remote.

 

setVolume

public void setVolume(int newVolume)
fun setVolume(newVolume: Int): void
ParametersTypeDescription
newVolumeIntnew value used to set the participant's incoming volume

 

getVolume

public String getVolume()
fun getVolume(): String
Returns
StringCurrrent volume for this participant.

 

isMuted

public boolean isMuted()
fun isMuted(): Boolean
Returns
booleanReturns true if this participant is muted. Returns false if participant is not muted.

 

getWidth

public int getWidth(int streamId)
fun getWidth(streamId: Int): Int
ParametersTypeDescription
streamIdStringID for a participant's video stream
Returns
intWidth of participant's video view with provided streamId

 

getHeight

public int getHeight(int streamId)
fun getHeight(streamId: Int): Int
ParametersTypeDescription
streamIdStringID for a participant's video stream
Returns
intHeight of participant's video view with provided streamId

 

getVideoStreamIds

public String[] getVideoStreamIds()
fun getVideoStreamIds(): Array<String>
Returns
String[ ]Array of streamId's tied to the participant.

 

isActive

public boolean isActive(String streamId)
fun isActive(streamId: String): Boolean
ParametersTypeDescription
streamIdStringID for a participant's video stream
Returns
intReturns true if this stream is active. Returns false if participant is not muted.

 

Interfaces

 

IInitializeMeetingCompleteCallback

Callback interface notifying application that meeting initialization is complete.

public interface IInitializeMeetingCompleteCallback
interface IInitializeMeetingCompleteCallback

onInitDone

public void onInitDone(boolean success);
fun onInitDone(success: Boolean)
ParametersTypeDescription
successBooleanIf success is true, application may join meeting. Otherwise meeting cannot be joined. If false, application can call getLastError() for more information.

 

INotificationCallback

Receives notification events from the library.

participantAdded

public void participantAdded(Participant participant)
fun participantAdded(participant: Participant)

Notification sent when a new participant, including yourself, has joined the call.

ParametersTypeDescription
participantParticipantObject containing information about the new participant.

 

participantVideoAdded

public void participantVideoAdded(Participant participant, String streamId)
fun participantVideoAdded(participant: Participant, streamId: String)

Notification sent when participant has started sending video. An app can access the video width/height and participant name using these two parameters. To start viewing this video, your app must call EnableVideoStream with this streamId.

ParametersTypeDescription
participantParticipantObject containing information about the participant.
streamIdStringID for a participant's video stream

 

participantVideoViewCreated

public void participantVideoViewCreated(Participant participant, View videoView)
fun participantVideoViewCreated(participant: Participant, videoView: View)

Notification sent when participant has started sending video. An app can access the video width/height and participant name using these two parameters. To start viewing this video, your app must call EnableVideoStream with this streamId.

ParametersTypeDescription
participantParticipantObject containing information about the participant.
videoViewViewView object containing the participant's video.

 

participantVideoRemoved

public void participantVideoRemoved(Participant participant, String streamId)
fun participantVideoRemoved(participant: Participant, streamId: String)

Notification sent when the participant has stopped sending the video with this streamId. App should remove the VideoView from its container view.

ParametersTypeDescription
participantParticipantObject containing information about the participant.
streamIdStringID for a participant's video stream

 

participantRemoved

public void participantRemoved(Participant participant)
fun participantRemoved(participant: Participant)

Notification sent when the participant has left the meeting.

ParametersTypeDescription
participantParticipantObject containing information about the participant.

 

participantDidMute

public void participantDidMute(Participant participant)
fun participantDidMute(participant: Participant)

Notification sent when a remote participant mutes their audio input. Would be used by apps to show each participant's mute status.

ParametersTypeDescription
participantParticipantObject containing information about the participant.

 

participantDidUnmute

public void participantDidUnmute(Participant participant)
fun participantDidUnmute(participant: Participant)

Notification sent when a remote participant unmutes their audio input. Would be used by apps to show each participant's mute status.

ParametersTypeDescription
participantParticipantObject containing information about the participant.

 

inputMeterChanged

public void inputMeterChanged(int level)
fun inputMeterChanged(level: Int)
ParametersTypeDescription
levelintValue between 0 and 100 that represents the new local input volume.

 

outputMeterChanged

public void outputMeterChanged(int level)
fun outputMeterChanged(level: Int)
ParametersTypeDescription
levelintValue between 0 and 100 that represents the new local output volume.

 

participantAmplitudeChanged

public void participantAmplitudeChanged(Participant participant, int level)
fun participantAmplitudeChanged(participant: Participant, level: Int)

Callback notifying application whenever a participant's audio level changes. Useful for implementing visual representations of participant's audio.

ParametersTypeDescription
participantParticipantObject containing information about the participant.
amplitudeintValue between 0 and 100 referring to the participant's audio level

 

ISwitchCameraCallback

Callback notifying application of the result of request to switch cameras.

public interface ISwitchCameraCallback
interface ISwitchCameraCallback

onCameraSwitched

public void onCameraSwitched(String newCamera);
fun onCameraSwitched(newCamera: String)

If switch was succesful, app will receive onCameraSwitched with the name of the currently active camera.

ParametersTypeDescription
newCameraStringString representing the name of the new camera as recognized by the SDK.

 

onCameraSwitchFailed

public void onCameraSwitchFailed();
fun onCameraSwitchFailed()

If switch failed, app will receive onCameraSwitchFailed and can call getLastError() for decription of failure.