...
To get started, you need to prepare data and work on the integration
Prepare data
Use case: Create a visit in VSee Clinic and embed the video into your page
Step 1:
...
<script src='https://browser-call.vsee.me/meet/libs/external_api.min.js?_=10'></script>
Step 2: Define container
<div id="vseeBrowserCall"></div>
Step 3: Initialize browser call on iframe
Code Block |
---|
const domain = $('#domain').val() + "/meet";
const options = {
roomName: $('#roomName').val(),
noSsl: false,
parentNode: window.document.querySelector("#vseeBrowserCall"),
userName: $('#userName').val(),
authToken: $('#authToken').val(),
onload: function () {
$('#vsee-container').hide();
$('#vseeBrowserCall').show();
}
};
const conferenceObject = new JitsiMeetExternalAPI(domain, options); |
Step 4: Listening to events
You can add event listeners to the embedded Jitsi Meet using the addListener
method:
Code Block |
---|
conferenceObject.addListener(event, listener); |
If you want to remove a listener you can use the removeListener
method:
Code Block |
---|
conferenceObject.removeListener(event, listener); |
The event
parameter is a string object with the name of the event.
The listener
parameter is a function object with one argument that creates a notification when the event occurs along with related event data.
More detail list of events can be found here https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe
Step 5: Sending commands
You can control the embedded Jitsi Meet conference by calling executeCommand
on the JitsiMeetExternalAPI
object:
Code Block |
---|
conferenceObject.executeCommand(command, ...arguments); |
The command parameter is a string which contains the command name.
You can also execute multiple commands using the executeCommands
method:
Code Block |
---|
conferenceObject.executeCommands(commands); |
The commands
parameter is an object with the names of the commands as keys and the arguments for the commands as values:
Code Block |
---|
conferenceObject.executeCommands({
displayName: [ 'nickname' ],
toggleAudio: []
}); |
More detail list of commands can be found here https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe
...
Obtain patient access credentials from POST /users/sso?fields=vsee API call
Important fields in the response are:
Field name / path | Type | Example Data | Field Description |
---|---|---|---|
|
|
| Patient's ID |
|
|
| The SSO token that should be used for further creating Intake (Step 2) and Visit (Step 3) |
|
|
| Use as Username in the SDK tool above |
|
|
| Use as Auth token in the SDK tool above |
Step 2: Create intake object via POST /intakes API
Use the SSO token from Step 1 in the X-ApiToken
header field. You will get an intake ID in the response (data.id
), e.g. 61165a8e-d8cc-47da-bd8e-597d64457b1f
Step 3: Create either a walkin visit via POST /visits/add_walkin API or a scheduled appointment visit via POST /visits API
Use SSO token from Step 1 in the X-ApiToken
header field and intake_id from Step 2.
Important fields in the response are:
Field name / path | Type | Example Data | Field Description |
---|---|---|---|
|
|
| Visit ID |
|
|
| This can be used as Conference ID in the SDK test tool above. https://jsfiddle.net/vseelab/8tz3bq5e/ |
Integration
Working example can be viewed here https://jsfiddle.net |
...
Step 1: Embed | HTML
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
CSS |
...
|
...
|
...
| ||||||||
Step 3: Initialize browser call on iframe
If you are using Step 4: Listening to eventsYou can add event listeners to the embedded Jitsi Meet using the
If you want to remove a listener you can use the
The The More detail list of events can be found here https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe Step 5: Sending commandsYou can control the embedded Jitsi Meet conference by calling
|
...
The command parameter is a string which contains the command name. You can also execute multiple commands using the
The
More detail list of commands can be found here https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe | Javascript
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
Example code
Working example can be viewed here https://jsfiddle.net/vseelab/8tz3bq5e/
To test call, please open the example in 2 different tabs / browsers or best 2 different computers.
Enter the username and token for each of the session and click Join
...
You should see 2 ways call
...