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
Name | Value | Description |
---|---|---|
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
Function | Params | Returns |
---|---|---|
changeVideoResolution | String: resolution | Boolean |
destroySDK | none | void |
disableAudioInput | none | Boolean |
disableAudioOutput | none | Boolean |
disableScreenCapture | none | void |
disableVideoCapture | none | Boolean |
disableVideoStream | Participant: participant String: streamId | void |
enableAudio | none | Boolean |
enableAudioInput | String: deviceName | Boolean |
enableAudioOutput | String: deviceName | Boolean |
enableScreenCapture | String: deviceName String: resolution | Boolean |
enableVideoCapture | String: deviceName | Boolean |
enableVideoCapture | String: deviceName String: resolution | Boolean |
enableVideoStream | Participant: participant String: streamId | void |
exitMeeting | none | void |
getAudioInputDevices | none | Array |
getAudioOutputDevices | none | Array |
getAudioVersion | none | String |
getLastError | TYPE: type | String |
getParticipants | none | ArrayList<Participant> |
getParticipantByStreamId | String: streamId | Participant |
getSupportedVideoResolutions | String: deviceName | Array |
getTraceHistory | String: fileName | void |
getVideoResolution | none | String |
getVideoVersion | none | String |
joinMeeting | String: name | int |
initializeMeeting | String: server String: guid IInitializeMeetingCompleteCallback: initDoneCallback | void |
initializeSDK | Context: context | void |
setAudioStreamVolume | String: streamId Int: volume | Boolean |
setNotificationCallback | INotificationCallback: callback | void |
switchCamera | final 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.
Parameters | Type | Description |
---|---|---|
resolution | String | New video resolution/codec to be utilized. List of supported video resolutions for the current camera can be retrieved using getSupportedVideoResolutions() |
Returns | |
---|---|
boolean | Returns 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 | |
---|---|
boolean | Returns 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 | |
---|---|
boolean | Returns 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 | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object containing information about the participant. |
streamId | String | ID 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 | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
deviceName | String | Name of the desired audio input device. |
Returns | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
deviceName | String | Name of the desired audio output device. |
Returns | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
deviceName | String | Name of the desired camera/device. |
resolution | String | Video resolution/codec to be utilized. List of supported video resolutions for the current camera can be retrieved using getSupportedVideoResolutions() . |
Returns | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
deviceName | String | Name of the desired camera/device. |
Returns | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
deviceName | String | Name of the desired camera/device. |
resolution | String | Video resolution/codec to be utilized. List of supported video resolutions for the current camera can be retrieved using getSupportedVideoResolutions() . |
Returns | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object containing information about the participant. |
streamId | String | ID 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 | |
---|---|
String | Version 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.
Parameters | Type | Description |
---|---|---|
type | TYPE | Enum class to determine what type of error to return, possible values are TYPE.AUDIO and TYPE.VIDEO |
Returns | |
---|---|
String | String 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
Parameters | Type | Description |
---|---|---|
streamId | String | ID for a participant's video stream. |
Returns | |
---|---|
Participant | Object 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)
Parameters | Type | Description |
---|---|---|
deviceName | String | Name 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.
Parameters | Type | Description |
---|---|---|
fileName | String | Full 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 | |
---|---|
String | Name of currently selected codec |
getVideoVersion
public static String getVideoVersion()
static fun getVideoVersion(): String
Returns | |
---|---|
String | Version 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.
Parameters | Type | Description |
---|---|---|
name | String | Participant name to be displayed in the meeting |
Returns | |
---|---|
int | Returns 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)
Parameters | Type | Description |
---|---|---|
server | String | Name/URL of server where the meeting is being hosted. |
guid | String | UUID string referencing meeting to initialize. |
initDoneCallback | IInitializeMeetingCompleteCallback | Callback 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)
Parameters | Type | Description |
---|---|---|
context | Context | Context 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
Parameters | Type | Description |
---|---|---|
streamId | String | ID for a participant's audio stream. |
volume | int | Value between 0 and 100 that sets the new volume for that audio stream |
Returns | |
---|---|
boolean | Returns 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.
Parameters | Type | Description |
---|---|---|
callback | INotificationCallback | Callback 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)
Parameters | Type | Description |
---|---|---|
newCamera | final String | Name of new camera. Value will be either MeetingSDK.ANDROID_FRONT_CAMERA or MeetingSDK.ANDROID_BACK_CAMERA . |
callback | ISwitchCameraCallback | Callback 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
Function | Params | Returns |
---|---|---|
getSiteName | none | String |
getSiteName | String: streamId | String |
getAudioStreamId | none | String |
isLocal | none | Boolean |
setVolume | Int: newVolume | void |
getVolume | none | String |
isMuted | none | Boolean |
getWidth | Int: streamId | Int |
getHeight | Int: streamId | Int |
getVideoStreamIds | none | String[] |
isActive | String: streamId | Boolean |
getSiteName
public String getSiteName()
fun getSiteName(): String
Returns | |
---|---|
String | Name of a remote participant. Local participant name requires getSiteName(String streamId) function. |
getSiteName
public String getSiteName(String streamId)
fun getSiteName(streamId: String): String
Parameters | Type | Description |
---|---|---|
streamId | String | ID for a participant's video stream |
Returns | |
---|---|
String | Name of the participant associated with the passed streamId. |
getAudioStreamId
public String getAudioStreamId()
fun getAudioStreamId(): String
Returns | |
---|---|
String | Audio stream ID of participant. |
isLocal
public boolean isLocal()
fun isLocal(): Boolean
Returns | |
---|---|
boolean | Returns 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
Parameters | Type | Description |
---|---|---|
newVolume | Int | new value used to set the participant's incoming volume |
getVolume
public String getVolume()
fun getVolume(): String
Returns | |
---|---|
String | Currrent volume for this participant. |
isMuted
public boolean isMuted()
fun isMuted(): Boolean
Returns | |
---|---|
boolean | Returns true if this participant is muted. Returns false if participant is not muted. |
getWidth
public int getWidth(int streamId)
fun getWidth(streamId: Int): Int
Parameters | Type | Description |
---|---|---|
streamId | String | ID for a participant's video stream |
Returns | |
---|---|
int | Width of participant's video view with provided streamId |
getHeight
public int getHeight(int streamId)
fun getHeight(streamId: Int): Int
Parameters | Type | Description |
---|---|---|
streamId | String | ID for a participant's video stream |
Returns | |
---|---|
int | Height 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
Parameters | Type | Description |
---|---|---|
streamId | String | ID for a participant's video stream |
Returns | |
---|---|
int | Returns 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)
Parameters | Type | Description |
---|---|---|
success | Boolean | If 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object 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
.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object containing information about the participant. |
streamId | String | ID 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
.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object containing information about the participant. |
videoView | View | View 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object containing information about the participant. |
streamId | String | ID 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object containing information about the participant. |
inputMeterChanged
public void inputMeterChanged(int level)
fun inputMeterChanged(level: Int)
Parameters | Type | Description |
---|---|---|
level | int | Value between 0 and 100 that represents the new local input volume. |
outputMeterChanged
public void outputMeterChanged(int level)
fun outputMeterChanged(level: Int)
Parameters | Type | Description |
---|---|---|
level | int | Value 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.
Parameters | Type | Description |
---|---|---|
participant | Participant | Object containing information about the participant. |
amplitude | int | Value 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.
Parameters | Type | Description |
---|---|---|
newCamera | String | String 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.
Updated over 1 year ago