Meeting Class Methods - Javascript
join()
- It is used to join a meeting.
- After meeting initialization by
initMeeting()
it returns a new instance of Meeting. However, by default, it will not automatically join the meeting. Hence, to join the meeting you should calljoin()
.
Events associated with join()
:
- Local Participant will receive a
meeting-joined
event when successfully joined. - Remote Participant will receive a
participant-joined
event with the newly joinedParticipant
object from the event callback.
Participant having ask_join
permission inside token
-
If a token contains the permission
ask_join
, then the participant will not join the meeting directly after callingjoin()
, but an event will be emitted to the participant having the permissionallow_join
calledentry-requested
. -
After the decision from the remote participant, an event will be emitted to the participant called
entry-responded
. This event will contain the decision made by the remote participant.
Participant having allow_join
permission inside token
- If a token containing the permission
allow_join
, then the participant will join the meeting derectly after callingjoin()
.
Returns
void
leave()
- It is used to leave the current meeting.
Events associated with leave()
:
- Local participant will receive a
meeting-left
event. - All remote participants will receive a
participant-left
event withparticipantId
.
Returns
void
end()
- It is used to end the current running session.
- By calling
end()
, all joined participants including localParticipant of that session will leave the meeting.
Events associated with end()
:
- All participants and localParticipant, will be emitted
meeting-left
event.
Returns
void
enableWebcam()
- It is used to enable self camera.
stream-enabled
event will be emitted withstream
object from the event callback, inside that participant object.
Returns
void
disableWebcam()
- It is used to disable self camera.
stream-disabled
event will be emitted withstream
object from the event callback, inside that participant object.
Returns
void
unmuteMic()
- It is used to enable self microphone.
stream-enabled
event will be emitted withstream
object from the event callback, inside that participant object.
Returns
void
muteMic()
- It is used to disable self microphone.
stream-disabled
event will be emitted withstream
object from the event callback, inside that participant object.
Returns
void
enableScreenShare()
-
it is used to enable screen-sharing.
-
stream-enabled
event will be emitted withstream
object from the event callback, inside that participant object. -
presenter-changed
will also receive a callback with thepresenterId
.
Returns
void
disableScreenShare()
-
It is used to disable screen-sharing.
-
stream-disabled
event will be emitted withstream
object from the event callback, inside that participant object. -
presenter-changed
will also receive a callback with thenull
.
Returns
void
uploadBase64File()
-
It is used to upload your file to Videosdk's Temporary storage
-
base64Data
convert your file to base64 and pass here. -
token
pass your videosdk token. Read more about token here -
fileName
provide your fileName with extension -
The method will return the corresponding fileUrl, which will use to retrieve the file from the VideoSDK's storage system.
Parameters
- base64Data: String
- token: String
- fileName: String
Returns
fileUrl
- It will use to retrieve the file from the VideoSDK's storage system.
Example
const fileUrl = await meeting.uploadBase64File({
base64Data: "<Your File's base64>", // Convert your file to base64 and pass here
token: "<VIDEOSDK_TOKEN>",
fileName: "myImage.jpeg", // Provide name with extension here,
});
console.log("fileUrl", fileUrl);
fetchBase64File()
-
It is used to retrieve your file from the Videosdk's Temporary storage
-
url
pass fileUrl which is returned by uploadBase64File() -
token
pass your videosdk token. Read more about token here -
The method will return image in form of base64 string.
Parameters
- url: String
- token: String
Returns
base64
- image in form of base64 string.
Example
let base64 = await meeting.fetchBase64File({
url: "<Your FileUrl>"; // Provide fileUrl which is returned by uploadBase64File(),
token :"<VIDEOSDK_TOKEN>",
});
console.log("base64", base64);
startRecording()
-
It is used to start meeting recording.
-
All participants and localParticipant, will receive
recording-started
event. -
webhookUrl
will be triggered when the recording is completed and stored in the server. Read more about webhooks here. -
awsDirPath
will be the path for your S3 bucket to which you want to store recordings. To allow us to store the recording in your S3 bucket, you will need to fill out this form by providing the required values. VideoSDK AWS S3 Integration -
config: mode
is used to either record video-and-audio both or only audio. And by default it will be video-and-audio. -
config: quality
is only applicable to video-and-audio. -
transcription: enabled
indicates whether post transcription is enabled. -
transcription: summary: enabled
Indicates whether post transcription summary generation is enabled. Only applicable when post transcription is enabled. -
transcription: summary: prompt
provides guidelines or instructions for generating a custom summary based on the post transcription content.
Parameters
- webhookUrl: String
- awsDirPath: String
- config:
- layout:
- type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
- priority: "SPEAKER" | "PIN"
- gridSize: Number
max 4
- theme: "DARK" | "LIGHT" | "DEFAULT"
- mode: "video-and-audio" | "audio"
- quality: "low" | "med" | "high"
- orientation: "landscape" | "portrait"
- layout:
- transcription:
- enabled: Boolean
- summary:
- enabled: Boolean
- prompt: String
Returns
void
Example
const webhookUrl = "https://webhook.your-api-server.com";
const awsDirPath = "/meeting-recordings/";
const config = {
layout: {
type: "SPOTLIGHT",
priority: "PIN",
gridSize: 9,
},
theme: "DEFAULT",
};
const transcription = {
enabled: true,
summary: {
enabled: true,
},
};
startRecording(webhookUrl, awsDirPath, config, transcription);
stopRecording()
- It is used to stop meeting recording.
- All participants and localParticipant, will receive
recording-stopped
event.
Returns
void
startLivestream()
-
It is used to start meeting live streaming.
-
You will be able to start live stream meetings to other platforms such as Youtube, Facebook, etc. that support
RTMP
streaming. -
All participants and localParticipant will receive the
livestream-started
event. -
transcription: enabled
indicates whether post transcription is enabled. -
transcription: summary: enabled
Indicates whether post transcription summary generation is enabled. Only applicable when post transcription is enabled. -
transcription: summary: prompt
provides guidelines or instructions for generating a custom summary based on the post transcription content.
Parameters
- outputs: Array<{ url: String, streamKey: String }>
- config:
- layout:
- type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
- priority: "SPEAKER" | "PIN"
- gridSize: Number
max 25
- theme: "DARK" | "LIGHT" | "DEFAULT"
- recording:
- enabled: Boolean
- layout:
- transcription:
- enabled: Boolean
- summary:
- enabled: Boolean
- prompt: String
Returns
void
Example
const outputs = [
{
url: "rtmp://a.rtmp.youtube.com/live2",
streamKey: "<STREAM_KEY>",
},
{
url: "rtmps://",
streamKey: "<STREAM_KEY>",
},
];
const config = {
layout: {
type: "SPOTLIGHT",
priority: "PIN",
gridSize: 9,
},
theme: "DEFAULT",
recording = {
enabled: true,
};
};
const transcription = {
enabled: true,
summary: {
enabled: true,
},
};
startLivestream(outputs, config, transcription);
stopLivestream()
- It is used to stop meeting livestreaming.
- All participants and localParticipant, will receive
livestream-stopped
event.
Returns
void