Skip to main content

Advanced usage

Audio/Video config options while joining meeting.

val meetingInfo = DyteMeetingInfoV2(
authToken = state.authToken,
enableAudio = true,
enableVideo = true
)
val config = DyteUIKitConfig(
activity = this,
dyteMeetingInfo = meetingInfo,
)
val dyteUIKit = DyteUIKitBuilder.build(config)

Control the meeting, and take meeting & participant actions

The Meeting instance (referenced as meeting below) helps you interact with the meeting. You can get access to meeting object as follows.

val meeting = dyteUIKit.meeting
Note

Once you have access to meeting object you can listen to all events triggered in core-sdk. Please read core docs

You can get the UI configuration of the meeting in progress using the designTokens property of Meeting.

val designTokens = dyteUIKit.designTokens

You can take actions on the meeting as well as the participants. You can also setup custom controls to that interact with the meeting in certain ways that help you send events and messages across to other participants in the meeting.

Get info about the meeting's UI configuration

val colors = designTokens.colors
val textColors = designTokens.colors.text
val brandColors = designTokens.colors.brand
val backgroundColors = designTokens.colors.background
val videoBackgroundColor = designTokens.colors.videoBackground
val statusColors = designTokens.colors.status

Get info about the plugins configured for the meeting

You can get info about the plugins configured for the meeting in progress using the plugins property of Meeting.

val activePlugins = meeting.plugins.active
val allPlugins = meeting.plugins.all

Self controls inside meeting

Mic control

To turn off the mic

meeting.localUser.disableAudio()

To turn on the mic

meeting.localUser.enableAudio()

Camera control

To turn off the camera

meeting.localUser.disableVideo()

To turn on the camera

meeting.localUser.enableVideo()

Leave meeting

To leave the meeting

meeting.leaveRoom()

Get list of all participants in the meeting

You can get a list of all participants in the meeting using the participants property of meeting.

val participants = meeting.participants
val active = participants.active
val joined = participants.joined

For active speaker and pinned participant in the meeting use as follows

val screenshares = participants.screenshares
val activeSpeaker = participants.activeSpeaker
val pinned = participants.pinned

Controlling individual participants and actions

Dyte client SDK provide methods and properties to help you control participant actions and certain UI elements. This could include actions that affect the participant themselves as well as other participants (like a host with privileged permissions may want to control the video of other participants). This section defines all the possible properties and actions that can be taken.

To get hold of participant you want to manage, do as follows

val participant = meeting.participants.joined.find { it.id = "my_participant_id" }

Disable participant's audio stream

To remotely turn the participant's mic off, you can do

participant.disableAudio()

Check if participant's video is on

To check whether a participant's video is on (camera is turned on), you can use

val video = participant.videoEnabled;

which sets the value of video to a boolean specifying if the camera is on or not.

Get participant video stream

If the participant's video is on, you can get the associated video stream using

val videoStream = participant.getVideoView()

Disable participant's audio stream

To remotely turn the participant's camera off, you can do

participant.disableVideo()

Check if the participant is pinned to the grid

To check whether a participant's video is pinned to the meeting grid; by the host, by the user, by the preset, or by any other mechanism; you can use

val pinned = participant.isPinned;

which sets the value of pinned to a boolean specifying whether the video is pinned or not.

Pin a participant video to the grid

You can pin a participant's video to the grid using

participant.pin();

Unpin a participant video from the grid

You can unpin a participant's video from the grid using

participant.unpin();