Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (72 sloc) 2.66 KB
<html>
<head>
<title>basic video call events/control demo</title>
<!-- this library, bundled and minimized -->
<script src="https://unpkg.com/@daily-co/daily-js"></script>
<!-- helper script to create a demo room under the api-demo.daily.co
domain. replace this in your production code with a function
that creates rooms within your own domain. -->
<script src="create-demo-room.js"></script>
</head>
<body>
<p> Open your js console, then ... </p>
<p> <button onclick="run()">Click here to start call</button> </p>
<script>
function showEvent(e) { console.log('video call event -->', e); }
async function run() {
// create a short-lived demo room. if you just want to
// hard-code a meeting link for testing you could do something like
// this:
//
// room = { url: 'https://your-domain.daily.co/hello' }
//
room = await createMtgRoom();
// create a video call iframe and add it to document.body
// defaults to floating window in the lower right-hand corner
//
window.callFrame = window.DailyIframe.createFrame();
// callFrame = window.DailyIframe.createFrame({
// iframeStyle: {
// position: 'fixed',
// border: 0,
// top: 0, left: 0,
// width: '100%',
// height: '100%'
// }
// });
// callFrame.join({ url: 'https://your-team.daily.co/hello' });
// install event handlers that just print out event information
// to the console
//
callFrame.on('loading', showEvent)
.on('loaded', showEvent)
.on('started-camera', showEvent)
.on('camera-error', showEvent)
.on('joining-meeting', showEvent)
.on('joined-meeting', showEvent)
.on('left-meeting', showEvent)
.on('participant-joined', showEvent)
.on('participant-updated', showEvent)
.on('participant-left', showEvent)
.on('recording-started', showEvent)
.on('recording-stopped', showEvent)
.on('recording-stats', showEvent)
.on('recording-error', showEvent)
.on('recording-upload-completed', showEvent)
.on('app-message', showEvent)
.on('input-event', showEvent)
.on('error', showEvent);
// join the room
//
await callFrame.join({ url: room.url });
console.log(' You are connected to', callFrame.properties.url, '\n',
'Use the window.callFrame object to experiment with', '\n',
'controlling this call. For example, in the console', '\n',
'try', '\n',
' callFrame.participants()', '\n',
' callFrame.setLocalVideo(false)', '\n',
' callFrame.startScreenShare()');
}
</script>
</body>
</html>
You can’t perform that action at this time.