DyteSelf
The DyteSelf module represents the current user, and allows to modify the state of the user in the meeting. The audio and video streams of the user can be retrieved from this module.
DyteSelf extends DyteSelfMedia therefore all the methods & variables exposed by DyteSelfMedia are also available on DyteSelf.
Few examples:
meeting.self.rawAudioTrack;
meeting.self.rawVideoTrack;
meeting.self.audioEnabled;
meeting.self.videoEnabled;
await meeting.self.getAudioDevices();
await meeting.self.getVideoDevices();
- DyteSelf
- .roomState
- .permissions
- .config
- .roomJoined
- .isPinned
- .setName(name)
- .setupTracks(options)
- .enableAudio()
- .enableVideo()
- .updateVideoConstraints()
- .enableScreenShare()
- .updateScreenshareConstraints()
- .disableAudio()
- .disableVideo()
- .disableScreenShare()
- .getAllDevices()
- .setIsPinned()
- .pin()
- .unpin()
self.roomState
Returns the current state of room
- init - Inital State
- joined - User is in the meeting
- waitlisted - User is in the waitlist state
- rejected - User's was in the waiting room, but the entry was rejected
- kicked - A priveleged user removed the user from the meeting
- left - User left the meeting
- ended - The meeting was ended
self.permissions
Returns the current permission given to the user for the meeting.
self.config
Returns configuration for the meeting.
self.roomJoined
Returns true if the local participant has joined the meeting.
self.isPinned
Returns true if the current user is pinned.
self.setName(name)
The name of the user can be set by calling this method. This will get reflected to other participants ONLY if this method is called before the room is joined.
Param | Description |
---|---|
name | Name of the user. |
self.setupTracks(options)
Sets up the local media tracks.
Param | Description |
---|---|
options | The audio and video options. |
options.video | If true, the video stream is fetched. |
options.audio | If true, the audio stream is fetched. |
self.enableAudio()
This method is used to unmute the local participant's audio.
self.enableVideo()
This method is used to start streaming the local participant's video to the meeting.
self.updateVideoConstraints()
This method is used to apply constraints to the current video stream.
self.enableScreenShare()
This method is used to start sharing the local participant's screen to the meeting.
self.updateScreenshareConstraints()
This method is used to apply constraints to the current screenshare stream.
self.disableAudio()
This method is used to mute the local participant's audio.
self.disableVideo()
This participant is used to disable the local participant's video.
self.disableScreenShare()
This method is used to stop sharing the local participant's screen.
self.getAllDevices()
Returns all media devices accessible by the local participant.
self.setIsPinned()
self.pin()
Returns self.id
if user has permission
to pin participants.
self.unpin()
Returns self.id
if user has permission
to unpin participants.
self.setDevice(device)
Change the current media device that is being used by the local participant.
Param | Description |
---|---|
device | The device that is to be used. A device of the same kind will be replaced. the primary stream. |