Meeting Class Methods - React Native
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 calljoin()
.
Events associated with join()
:​
- Local Participant will receive a
onMeetingJoined
event, when successfully joined. - Remote Participant will receive a
onParticipantJoined
event with the newly joinedParticipant
object from the event callback.
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 callingjoin()
, but an event will be emitted to the participant having the permissionallow_join
calledonEntryRequested
. -
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 callingjoin()
.
Returns​
void
leave()​
- It is used to leave the current meeting.
Events associated with leave()
:​
- Local participant will receive a
onMeetingLeft
event. - All remote participants will receive a
onParticipantLeft
event withparticipantId
.
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()
:​
- All participants and localParticipant, will be emitted
onMeetingLeft
event.
Returns​
void
enableWebcam()​
- It is used to enable self camera.
onStreamEnabled
event ofParticipantEventListener
will be emitted withstream
object from the event callback.
Returns​
void
disableWebcam()​
- It is used to disable self camera.
onStreamDisabled
event ofParticipantEventListener
will be emitted withstream
object from the event callback.
Returns​
void
unmuteMic()​
- It is used to enable self microphone.
onStreamEnabled
event ofParticipantEventListener
will be emitted withstream
object from the event callback.
Returns​
void
muteMic()​
- It is used to disable self microphone.
onStreamDisabled
event ofParticipantEventListener
will be emitted withstream
object from the event callback.
Returns​
void
enableScreenShare()​
-
it is used to enable screen-sharing.
-
onStreamEnabled
event ofParticipantEventListener
will be emitted withstream
object from the event callback. -
onPresenterChanged()
event will be trigget to all participant withparticipantId
.
Parameters​
- data: Intent
Returns​
void
disableScreenShare()​
-
It is used to disable screen-sharing.
-
onStreamDisabled
event ofParticipantEventListener
will be emitted withstream
object from the event callback. -
onPresenterChanged()
event will be trigget to all participant withnull
.
Returns​
void
startRecording()​
-
It is used to start meeting recording.
-
All participants and localParticipant, will receive
onRecordingStarted
event. -
webhookUrl
will be triggered when the recording is completed and stored into server. Read more about webhooks here.
Parameters​
- webhookUrl: String
Returns​
void
Example​
- Kotlin
- Java
val webhookUrl = "https://webhook.your-api-server.com"
meeting!!.startRecording(webhookUrl)
String webhookUrl = "https://webhook.your-api-server.com";
meeting.startRecording(webhookUrl);
stopRecording()​
- It is used to stop meeting recording.
- All participants and localParticipant, will receive
onRecordingStopped
event.
Returns​
void
Example​
- Kotlin
- Java
meeting!!.stopRecording()
meeting.stopRecording();
startLivestream()​
- It 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. - All participants and localParticipant, will receive
onLivestreamStarted
event.
Parameters​
- outputs:
List<LivestreamOutput>
Returns​
void
Example​
- Kotlin
- Java
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))
meeting!!.startLivestream(outputs)
final String YOUTUBE_RTMP_URL = "rtmp://a.rtmp.youtube.com/live2";
final String YOUTUBE_RTMP_STREAM_KEY = "<STREAM_KEY>";
List<LivestreamOutput> outputs = new ArrayList<>();
outputs.add(new LivestreamOutput(YOUTUBE_RTMP_URL, YOUTUBE_RTMP_STREAM_KEY));
meeting.startLivestream(outputs);
stopLivestream()​
- It is used to stop meeting livestreaming.
- All participants and localParticipant, will receive
onLivestreamStopped
event.
Returns​
void
Example​
- Kotlin
- Java
meeting!!.stopLivestream()
meeting.stopLivestream();
getMics()​
- It will return all connected mic devices.
Returns​
Set<AppRTCAudioManager.AudioDevice>
Example​
- Kotlin
- Java
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()
}
Set<AppRTCAudioManager.AudioDevice> mics = meeting.getMics();
String mic;
for (int i = 0; i < mics.size(); i++) {
mic=mics.toArray()[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​
- Kotlin
- Java
meeting!!.changeMic(AppRTCAudioManager.AudioDevice.BLUETOOTH)
meeting.changeMic(AppRTCAudioManager.AudioDevice.BLUETOOTH);
changeWebcam()​
- It is used to change the camera mode.
Returns​
void
Example​
- Kotlin
- Java
meeting!!.changeWebcam()
meeting.changeWebcam();
setAudioDeviceChangeListener()​
- When a Local participant changes the Mic,
AppRTCAudioManager.AudioManagerEvents()
is triggered which can be set by usingsetAudioDeviceChangeListener()
method.
Parameters​
- audioManagerEvents: AppRTCAudioManager.AudioManagerEvents
Returns​
void
Example​
- Kotlin
- Java
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()
}
}
})
meeting.setAudioDeviceChangeListener(new AppRTCAudioManager.AudioManagerEvents() {
@Override
public void onAudioDeviceChanged(AppRTCAudioManager.AudioDevice selectedAudioDevice, Set<AppRTCAudioManager.AudioDevice> availableAudioDevices) {
switch (selectedAudioDevice) {
case BLUETOOTH:
Toast.makeText(MainActivity.this, "Selected AudioDevice: BLUETOOTH", Toast.LENGTH_SHORT).show();
break;
case WIRED_HEADSET:
Toast.makeText(MainActivity.this, "Selected AudioDevice: WIRED_HEADSET", Toast.LENGTH_SHORT).show();
break;
case SPEAKER_PHONE:
Toast.makeText(MainActivity.this, "Selected AudioDevice: SPEAKER_PHONE", Toast.LENGTH_SHORT).show();
break;
case EARPIECE:
Toast.makeText(MainActivity.this, "Selected AudioDevice: EARPIECE", Toast.LENGTH_SHORT).show();
break;
}
}
});
addEventListener()​
Parameters​
- listener: MeetingEventListener
Returns​
void
removeEventListener()​
Parameters​
- listener: MeetingEventListener
Returns​
void
removeAllListeners()​
Returns​
void
Got a Question? Ask us on discord