Skip to main content

Introduction - Local User

DyteSelfUser object contain all the methods and properties about the self user including their media controls for the current room.

Properties

Here is a list of properties that local user provides:

  • id: ID of the participant pertaining to local user. (aka peerId)
  • userId: The userId of the participant.
  • name: Contains Name of the local user.
  • picture: Link to the url of the participant
  • isHost: Boolean value indicating whether this user is host of current meeting or not.
  • clientSpecificId: Identifier provided by the developer while adding the participant.
  • flags: Type ParticipantFlags and it contains two boolean values
    • recorder: if the participant is recorder
    • hidden: if the participant is hidden
  • audioEnabled: Boolean value indicating if the audio currently enabled.
  • videoEnabled: Boolean value indicating if the video currently enabled.
  • stageStatus : Stage status of the local participant.

Local user properties can be fetched via localUser getter on the dyteClient.

final selfUser = dyteClient.localUser;

Change default audio / video settings

By default as soon as you join the meeting, Dyte SDK will produce your video and audio streams. To change this behaviour, use the audioEnabled & videoEnabled parameter

final meetingInfo = DyteMeetingInfoV2(
roomName = MEETING_ROOM_NAME,
authToken = AUTH_TOKEN,
audioEnabled = false,
videoEnabled = true
);

Turn on audio/video tracks after initializing the client

If audio and video tracks are disabled during the DyteMobileClient initialization process. You can setup the audio and video tracks by simply calling enableAudio() and enableVideo() like below:

dyteClient.localUser.enableAudio();
dyteClient.localUser.enableVideo();

Change the name of the local user

Change the user's name by calling setDisplayName method. The changed name will reflect across all participants ONLY if the change happens before joining the meeting. This is only possible when the user has the permission to change the name.

if(dyteClient.permissions.miscellaneous.canEditDisplayName)
{
dyteClient.localUser.setDisplayName("New Name");
}

Mute/Unmute microphone

// Mute Audio
dyteClient.localUser.disableAudio();

// Unmute Audio
dyteClient.localUser.enableAudio();

// Get current status
final isAudioEnabled = dyteClient.localUser.audioEnabled;

Enable/Disable camera

// Disable Video
dyteClient.localUser.disableVideo();

// Enable Video
dyteClient.localUser.enableVideo();

// Get current status
final isVideoEnabled = dyteClient.localUser.videoEnabled;

Switch camera between sources

// switch camera
dyteClient.localUser.switchCamera();

Enable / Disable Screen share

// Enable Screenshare
dyteClient.localUser.enableScreenshare();

// Disable Screenshare
dyteClient.localUser.disableScreenshare();