Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zaxebo1
Forked from atfornes/timeEnabledJitsi.js
Created August 27, 2021 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaxebo1/fb4a3e94af857c67f27abe6b60a4fce0 to your computer and use it in GitHub Desktop.
Save zaxebo1/fb4a3e94af857c67f27abe6b60a4fce0 to your computer and use it in GitHub Desktop.
Jitsi : enable videoconference at a specific time
// using jitsi API: https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe
<script src='https://meet.jit.si/external_api.js'></script>
<script>
const domain = 'meet.jit.si';
const options = {
roomName: 'JitsiMeetAPIExample',
width: '1200px',
height: '800px',
parentNode: document.querySelector('#conference')
};
console.log(domain);
console.log(options);
var target = new Date(Date.UTC(2020,4,29,14,59,00));
timeOffset = target.getTimezoneOffset() * 60000;
targetTime = target.getTime();
targetUTC = targetTime + timeOffset;
var today = new Date();
todayTime = today.getTime();
todayUTC = todayTime + timeOffset;
refreshTime = (targetUTC - todayUTC);
if (refreshTime > 1) {
setTimeout(function() { const api = new JitsiMeetExternalAPI(domain, options); }, refreshTime);
} else {
const api = new JitsiMeetExternalAPI(domain, options);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment