Skip to main content
Version: 0.1.x

Meeting Class Methods

join()

  • It is used to join a meeting.
  • After meeting initialization by initMeeting() it returns a new instance of Meeting. However by default, it will not automatically join the meeting. Hence, to join the meeting you should call join().

Events associated with join():

Participant having ask_join permission inside token

  • If a token contains the permission ask_join, then the participant will not join the meeting directly after calling join(), but an event will be emitted to the participant having the permission allow_join called onEntryRequested.

  • After the decision from the remote participant, an event will be emitted to participant called onEntryResponded. This event will contain the decision made by the remote participant.

Participant having allow_join permission inside token

  • If a token containing the permission allow_join, then the participant will join the meeting directly after calling join().

Returns

  • void

leave()

  • It is used to leave the current meeting.

Events associated with leave():

Returns

  • void

end()

  • It is used to end the current running session.
  • By calling end(), all joined participants including localParticipant of that session will leave the meeting.

Events associated with end():

Returns

  • void

enableWebcam()

  • It is used to enable self camera.
  • onStreamEnabled event of ParticipantEventListener will be emitted with stream object from the event callback.

Returns

  • void

disableWebcam()

  • It is used to disable self camera.
  • onStreamDisabled event of ParticipantEventListener will be emitted with stream object from the event callback.

Returns

  • void

unmuteMic()

  • It is used to enable self microphone.
  • onStreamEnabled event of ParticipantEventListener will be emitted with stream object from the event callback.

Returns

  • void

muteMic()

  • It is used to disable self microphone.
  • onStreamDisabled event of ParticipantEventListener will be emitted with stream object from the event callback.

Returns

  • void

enableScreenShare()

  • it is used to enable screen-sharing.

  • onStreamEnabled event of ParticipantEventListener will be emitted with stream object from the event callback.

  • onPresenterChanged() event will be trigget to all participant with participantId.

Parameters

  • data: Intent

Returns

  • void

disableScreenShare()

  • It is used to disable screen-sharing.

  • onStreamDisabled event of ParticipantEventListener will be emitted with stream object from the event callback.

  • onPresenterChanged() event will be trigget to all participant with null.

Returns

  • void

startRecording()

  • startRecording is used to start meeting recording.

  • webhookUrl will be triggered when the recording is completed and stored into server. Read more about webhooks here.

  • awsDirPath will be the path for the your S3 bucket where you want to store recordings to. To allow us to store recording in your S3 bucket, you will need to fill this form by providing the required values. VideoSDK AWS S3 Integration

  • config: mode is used to either record video-and-audio both or only audio. And by default it will be video-and-audio.

  • config: quality is only applicable to video-and-audio.

Parameters

  • webhookUrl: String
  • awsDirPath: String
  • config:
    • layout:
      • type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
      • priority: "SPEAKER" | "PIN"
      • gridSize: Number max 4
    • theme: "DARK" | "LIGHT" | "DEFAULT"
    • mode: "video-and-audio" | "audio"
    • quality: "low" | "med" | "high"
    • orientation: "landscape" | "portrait"

Returns

  • void

Events associated with startRecording():

Example

val webhookUrl = "https://webhook.your-api-server.com"
var config = JSONObject()
var layout = JSONObject()
JsonUtils.jsonPut(layout, "type", "SPOTLIGHT")
JsonUtils.jsonPut(layout, "priority", "PIN")
JsonUtils.jsonPut(layout, "gridSize", 9)
JsonUtils.jsonPut(config, "layout", layout)
JsonUtils.jsonPut(config, "theme", "DARK")
meeting!!.startRecording(webhookUrl,null,config)

stopRecording()

  • It is used to stop meeting recording.

Returns

  • void

Events associated with stopRecording():

Example

meeting!!.stopRecording()

startLivestream()

  • startLiveStream() is used to start meeting livestreaming.

  • You will be able to start live stream meetings to other platforms such as Youtube, Facebook, etc. that support RTMP streaming.

Parameters

  • outputs: List<LivestreamOutput>
  • config:
    • layout:
      • type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
      • priority: "SPEAKER" | "PIN"
      • gridSize: Number max 25
    • theme: "DARK" | "LIGHT" | "DEFAULT"

Returns

  • void

Events associated with startLiveStream():

Example

val YOUTUBE_RTMP_URL = "rtmp://a.rtmp.youtube.com/live2"
val YOUTUBE_RTMP_STREAM_KEY = "<STREAM_KEY>"

val outputs: MutableList<LivestreamOutput> = ArrayList()
outputs.add(LivestreamOutput(YOUTUBE_RTMP_URL, YOUTUBE_RTMP_STREAM_KEY))

var config = JSONObject()
var layout = JSONObject()
JsonUtils.jsonPut(layout, "type", "SPOTLIGHT")
JsonUtils.jsonPut(layout, "priority", "PIN")
JsonUtils.jsonPut(layout, "gridSize", 9)
JsonUtils.jsonPut(config, "layout", layout)
JsonUtils.jsonPut(config, "theme", "DARK")

meeting!!.startLivestream(outputs,config)

stopLivestream()

  • It is used to stop meeting livestreaming.

Returns

  • void

Events associated with stopLivestream():

Example

meeting!!.stopLivestream()

startHls()

  • startHls() will start HLS streaming of your meeting.

  • You will be able to start HLS and watch the live stream of meeting over HLS.

  • mode is used to either start hls streaming of video-and-audio both or only audio. And by default it will be video-and-audio.

  • quality is only applicable to video-and-audio.

Parameters

  • config:
    • layout:
      • type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
      • priority: "SPEAKER" | "PIN"
      • gridSize: Number max 25
    • theme: "DARK" | "LIGHT" | "DEFAULT"
    • mode: "video-and-audio" | "audio"
    • quality: "low" | "med" | "high"

Returns

  • void

Events associated with startHls():

Example

var config = JSONObject()
var layout = JSONObject()
JsonUtils.jsonPut(layout, "type", "SPOTLIGHT")
JsonUtils.jsonPut(layout, "priority", "PIN")
JsonUtils.jsonPut(layout, "gridSize", 9)
JsonUtils.jsonPut(config, "layout", layout)
JsonUtils.jsonPut(config, "orientation", "portrait")
JsonUtils.jsonPut(config, "theme", "DARK")
meeting!!.startHls(config)

stopHls()

  • stopHls() is used to stop the HLS streaming.

Returns

  • void

Events associated with stopHls():

Example

meeting!!.stopHls()

changeMode()

  • It is used to change the mode.
  • You can toggle between the CONFERENCE and VIEWERmode .
    • CONFERENCE: Both audio and video streams will be produced and consumed in this mode.
    • VIEWER: Audio and video streams will not be produced or consumed in this mode.

Parameters

  • mode: String

Returns

  • void

Events associated with changeMode():

Example

meeting!!.changeMode("VIEWER")

getMics()

  • It will return all connected mic devices.

Returns

  • Set<AppRTCAudioManager.AudioDevice>

Example

val mics = meeting!!.mics
var mic: String
for (i in mics.indices) {
mic = mics.toTypedArray()[i].toString()
Toast.makeText(this, "Mic : $mic", Toast.LENGTH_SHORT).show()
}

changeMic()

  • It is used to change the mic device.
  • If multiple mic devices are connected, by using changeMic() one can change the mic device.

Parameters

  • device: AppRTCAudioManager.AudioDevice

Returns

  • void

Example

meeting!!.changeMic(AppRTCAudioManager.AudioDevice.BLUETOOTH)

changeWebcam()

  • It is used to change the camera mode.

Returns

  • void

Example

meeting!!.changeWebcam()

setAudioDeviceChangeListener()

  • When a Local participant changes the Mic, AppRTCAudioManager.AudioManagerEvents() is triggered which can be set by using setAudioDeviceChangeListener() method.

Parameters

  • audioManagerEvents: AppRTCAudioManager.AudioManagerEvents

Returns

  • void

Example

    meeting!!.setAudioDeviceChangeListener(object : AudioManagerEvents {
override fun onAudioDeviceChanged(
selectedAudioDevice: AppRTCAudioManager.AudioDevice,
availableAudioDevices: Set<AppRTCAudioManager.AudioDevice>
) {
when (selectedAudioDevice) {
AppRTCAudioManager.AudioDevice.BLUETOOTH ->
Toast.makeText(this@MainActivity, "Selected AudioDevice: BLUETOOTH", Toast.LENGTH_SHORT).show()

AppRTCAudioManager.AudioDevice.WIRED_HEADSET ->
Toast.makeText(this@MainActivity, "Selected AudioDevice: WIRED_HEADSET", Toast.LENGTH_SHORT).show()

AppRTCAudioManager.AudioDevice.SPEAKER_PHONE ->
Toast.makeText(this@MainActivity, "Selected AudioDevice: SPEAKER_PHONE", Toast.LENGTH_SHORT).show()

AppRTCAudioManager.AudioDevice.EARPIECE ->
Toast.makeText(this@MainActivity, "Selected AudioDevice: EARPIECE", Toast.LENGTH_SHORT).show()
}
}
})

addEventListener()

Parameters

  • listener: MeetingEventListener

Returns

  • void

removeEventListener()

Parameters

  • listener: MeetingEventListener

Returns

  • void

removeAllListeners()

Returns

  • void