Skip to content

Instantly share code, notes, and snippets.

@nfreear
Created June 27, 2020 10:22
Show Gist options
  • Save nfreear/3a0fbaf0566e8a332dd3e7e7d4699794 to your computer and use it in GitHub Desktop.
Save nfreear/3a0fbaf0566e8a332dd3e7e7d4699794 to your computer and use it in GitHub Desktop.
Embed a Jitsi meeting
<!doctype html> <title> Jitsi Meeting test </title>
<script type="application/json" id="config">
{
"roomName": "nick-X",
"userInfo": {
"email": "nfreear@yahoo.XXX",
"displayName": "Nick X."
}
}
</script>
<style>
iframe { border-radius: .5rem; }
.jitsi-loaded .loading { display: none; }
</style>
<div id="meet">
<p class="loading">Loading ...
</div>
<script src="https://meet.jit.si/external_api.js" X-crossorigin="anonymous"></script>
<script X-type="module">
const CFG = JSON.parse(document.querySelector('script#config').textContent);
const domain = 'meet.jit.si';
const options = {
roomName: CFG.roomName, // 'PickAnAppropriateMeetingNameHere',
width: '100%', // 700,
height: 700,
parentNode: document.querySelector('#meet'),
userInfo: CFG.userInfo,
invitees_X: [ /* {
email: 'nick.freear@open.ac.uk',
name: 'Nick 2'
} */ ],
onload: ev => {
const URL = ev.target.src;
console.warn('> Jitsi loaded:', URL, ev);
document.body.classList.add('jitsi-loaded');
}
};
const jitsi = new JitsiMeetExternalAPI(domain, options);
jitsi.addEventListener('incomingMessage', ev => console.warn('> Incoming:', ev));
jitsi.addEventListener('outgoingMessage', ev => console.warn('> Outgoing:', ev));
</script>
<pre>
NDF / 26-Jun-2020.
* https://jitsi.org/api/
* https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe#api
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment