Media Preview
This section focuses on pre-call functionality, providing developers with the tools needed to prepare the media environment before joining the meeting. If you are using our UI Kits, this will be handled by dyte-setup-screen or could be built with dyte-participant-tile, dyte-settings components.
Properties
-
audioEnabled: A boolean value indicating if the audio currently enabled. -
videoEnabled: A boolean value indicating if the video currently enabled. -
audioTrack: The audio track for the local user. -
videoTrack: The video track for the local user.
Methods
Toggling Media
The same methods used by post joining meeting are also used to control media-pre meeting.
1. Mute/Unmute microphone
// Mute Audio
await meeting.self.disableAudio();
// Unmute Audio
await meeting.self.enableAudio();
Anytime there is an update in audio state you will get a audioUpdate event
meeting.self.on('audioUpdate', ({ audioEnabled, audioTrack })=> {
// if enabled show a visual(izer) preview of the audio to the user
});
2. Enable/Disable camera
// Disable Video
await meeting.self.disableVideo();
// Enable Video
await meeting.self.enableVideo();
meeting.self.on('videoUpdate', ({ videoEnabled, videoTrack })=> {
// if videoEnabled play video here to a <video> element
});