Introduction - Local User
The local user in a meeting is represented by RtkSelfParticipant
and can be accessed as meeting.localUser
. It has a set of methods and properties related to local user's state and media controls.
Properties
Here is a list of properties that local user provides:
id
: ID of the local user participant. (akapeerId
)name
: Name of the local user.userId
: TheuserId
of the participant.picture
: URL to the picture of the local user (optional).customParticipantId
: User provided participant ID (optional).audioEnabled
: A boolean value indicating whether the audio is currently enabled for the local user.videoEnabled
: A boolean value indicating whether the video is currently enabled for the local user.flags
: TypeParticipantFlags
and it contains two boolean valuesrecorder
: if the participant is recorderhidden
: if the participant is hidden
Change default audio / video settings
By default as soon as you join the meeting, RealtimeKit SDK will produce your video and
audio streams. To change this behaviour, use the audioEnabled
& videoEnabled
parameters while configuring the meeting.
final meetingInfo = RtkMeetingInfo(
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 RealtimekitClient
initialization process. You can setup the audio and video tracks by simply
calling enableAudio()
and enableVideo()
like below:
meeting.localUser.enableAudio();
meeting.localUser.enableVideo();
Change the name of the local user
You can change the user's name by using the setDisplayName
method.
However, the name change will reflect across all participants ONLY if it occurs before joinRoom()
and after the init()
process. This is only possible when the local user has the preset permission to change the name.
if(meeting.permissions.miscellaneous.canEditDisplayName)
{
meeting.localUser.setDisplayName("New Name");
}
Mute/Unmute microphone
Mute/unmute your microphone in the meeting using disableAudio()
and enableAudio()
methods, and check the current status with audioEnabled
.
// Get current status
final isAudioEnabled = meeting.localUser.audioEnabled;
// Mute Audio
meeting.localUser.disableAudio();
// Unmute Audio
meeting.localUser.enableAudio();
Enable/Disable camera
Enable/disable your camera in the meeting using disableVideo()
and enableVideo()
methods, and check the current status with videoEnabled
.
// Get current status
final isVideoEnabled = meeting.localUser.videoEnabled;
// Disable Video
meeting.localUser.disableVideo();
// Enable Video
meeting.localUser.enableVideo();
Switch camera between sources
// switch camera
meeting.localUser.switchCamera();
Enable / Disable Screen share
Enable/disable screenshare in the meeting using disableScreenShare()
and enableScreenShare()
methods.
Android
To use screenshare on Android devices running Android API 14 and above, you will need to declare the following permission in your app's AndroidManifest.xml.
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
Adding above permission will require you to do extra steps on Google Play Console while submitting the app. For more information please refer to Google's documentation.
iOS
Refer to screenshare setup for iOS here
// Enable Screenshare
meeting.localUser.enableScreenShare();
// Disable Screenshare
meeting.localUser.disableScreenShare();