-
Notifications
You must be signed in to change notification settings - Fork 32
/
simple.html
82 lines (72 loc) · 2.66 KB
/
simple.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<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>