Skip to main content
Version: 1.0.x

Room Class Methods

join()

  • After creating the instance of VideoSDK Room, you can join VideoSDK Room by calling join() method.

Events associated with join():

  • Local Participant will receive a roomJoined event, when successfully joined.
  • Remote Participant will receive a participantJoined event with the newly joined Participant object from the event handler.

Participant having ask_join permission inside token

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

  • After the decision from the remote participant, an event will be emitted to participant called entryResponded. 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 room directly after calling join().

Returns

  • void

leave()

  • It is used to leave the current running room session.

Events associated with leave():

  • Local participant will receive a roomLeft event.
  • All remote participants will receive a participantLeft event with participantId string from the event handler.

Returns

  • void

end()

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

Events associated with end():

Returns

  • void

enableCam()

Returns

  • void

disableCam()

Returns

  • void

unmuteMic()

Returns

  • void

muteMic()

Returns

  • void

enableScreenShare()

Returns

  • void

disableScreenShare()

Returns

  • void

startRecording()

Parameters

  • webhookUrl: String

Returns

  • void

Example

const webhookUrl = "https://webhook.your-api-server.com";

room.startRecording(webhookUrl);

stopRecording()

Returns

  • void

Example

room.stopRecording();

startLivestream()

Parameters

  • outputs: List<Map<String, String>> [{ url: String, streamKey: String }]

Returns

  • void

Example

var outputs = [
{
url: "rtmp://a.rtmp.youtube.com/live2",
streamKey: "<STREAM_KEY>",
},
{
url: "rtmps://",
streamKey: "<STREAM_KEY>",
},
];

room.startLivestream(outputs);

stopLivestream()

Returns

  • void

Example

room.stopLivestream();

getCameras()

  • It will return all connected camera devices.

Returns

Example

List<MediaDeviceInfo> cams = room.getCameras();
print(cams);

changeCam()

  • It is used to change the camera device.
  • If multiple camera devices are connected, by using changeCam(), one can change the camera device with camera device id.
  • You can get list of connected video devices using VideoSDK.mediaDevices

Parameters

  • deviceId: String

Returns

  • void

Example

room.changeCam(deviceId);

on()

  • It is used to listen Room related events.

Parameters

  • event

    • type: Events
    • This will specify the event to be listened.
  • eventHandler

    • type: Function
    • This will be invoked whenever, specified event occurred.

Returns

  • void

Example

room.on(Events.roomJoined, () {
// do something
});