@digitalsamba/embedded-sdk 0.0.20 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,289 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
6
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
- <title>Document</title>
8
- <!-- <script src="https://unpkg.com/@digitalsamba/embedded-sdk"></script>-->
9
- <script src="./umd/index.js"></script>
10
- <style>
11
- .user-list-row {
12
- display: flex;
13
- margin: 12px 0 8px;
14
- align-items: center;
15
- }
16
-
17
- .user-list-avatar {
18
- width: 24px;
19
- height: 24px;
20
- display: block;
21
- border-radius: 50%;
22
- margin-right: 8px;
23
- }
24
-
25
- .log p {
26
- font-size: 14px;
27
- line-height: 1;
28
- margin: 0 0 4px
29
- }
30
-
31
- .buttons button, .captions-buttons button {
32
- margin: 2px;
33
- }
34
- </style>
35
- </head>
36
- <body>
37
- <div style="display: flex">
38
- <div class="ifp">
39
-
40
- </div>
41
- <div style="min-width: 300px ; padding: 0 16px">
42
- <h3>Room users:</h3>
43
- <div class="participants">
44
-
45
- </div>
46
- </div>
47
- </div>
48
- <div class="div buttons" style=" border: 1px solid yellow">
49
- <button class="c0" style="margin-right: 15px; border: 2px solid blue">LOAD</button>
50
-
51
- </div>
52
- <div class="div captions-buttons" style=" border: 1px solid yellow">
53
- <p>captions controls</p>
54
-
55
- </div>
56
-
57
- <div class="log">
58
-
59
- </div>
60
-
61
- <script async defer>
62
- const parent = document.querySelector('.ifp');
63
- const frame = document.querySelector('.if');
64
- const buttonsParent = document.querySelector('.buttons');
65
- const captionsButtonsParent = document.querySelector('.captions-buttons');
66
- const participantList = document.querySelector('.participants');
67
-
68
- const btn0 = document.querySelector('.c0');
69
-
70
-
71
- // change these values to connect to your room
72
- const TEAM = 'some-team';
73
- const ROOM = 'some-room';
74
- let ROOM_URL = 'https://localhost:3000/Public'
75
-
76
- if(window.location.search) {
77
- const params = new URLSearchParams(window.location.search);
78
- const dynamicRoomUrl = params.get('roomUrl');
79
- if(dynamicRoomUrl) {
80
- ROOM_URL = dynamicRoomUrl
81
- }
82
- }
83
-
84
- //const api = new DigitalSambaEmbedded({ root: parent, team: TEAM, room: ROOM});
85
- // const api = new DigitalSambaEmbedded({ frame});
86
- //const api = new DigitalSambaEmbedded({ url: ROOM_URL}, {reportErrors: true});
87
-
88
-
89
- var api = DigitalSambaEmbedded.createControl({ url: ROOM_URL, root: parent });
90
-
91
- const log = document.querySelector('.log');
92
-
93
- api.frame.width = 900;
94
- api.frame.height = 700;
95
-
96
- btn0.onclick = () => {api.load({ frameAttributes: {style: "border: 5px solid red"}, reportErrors: true })}
97
-
98
-
99
- const captionsControls = [
100
- {command: 'configureCaptions', label: 'set font size - small', args: [{fontSize: 'small'}] },
101
- {command: 'configureCaptions', label: 'set font size - medium', args: [{fontSize: 'medium'}] },
102
- {command: 'configureCaptions', label: 'set font size - large', args: [{fontSize: 'large'}] },
103
- {command: 'configureCaptions', label: 'set spoken language - english', args: [{spokenLanguage: 'en'}] },
104
- {command: 'configureCaptions', label: 'set spoken language - french', args: [{spokenLanguage: 'fr'}] },
105
- {command: 'configureCaptions', label: 'set spoken language - spanish', args: [{spokenLanguage: 'es'}] },
106
- ]
107
-
108
- captionsControls.forEach(control => {
109
- const button = document.createElement("button");
110
- button.innerHTML = control.label;
111
- button.onclick = () => api[control.command](...(control.args || []))
112
-
113
- captionsButtonsParent.appendChild(button);
114
- })
115
-
116
- api.on('*', (data) => {
117
- log.innerHTML += `<p>${Number(new Date)}: ev(${data?.type}): ${JSON.stringify(data)}</p>`
118
- });
119
-
120
- api.on('userJoined', (data) => {
121
- log.innerHTML += `<p>${Number(new Date)}: USER JOINED: ${JSON.stringify(data)}</p>`
122
- });
123
-
124
- api.on('userLeft', (data) => {
125
- log.innerHTML += `<p>${Number(new Date)}: USER LEFT: ${JSON.stringify(data)}</p>`
126
- });
127
-
128
- const baseControls = [
129
- {command: 'toggleVideo', label: 'toggle video', permission: "broadcast" },
130
- {command: 'enableVideo', label: 'enable video', permission: 'broadcast' },
131
- {command: 'disableVideo', label: 'disable video', permission: 'broadcast' },
132
- {command: 'toggleAudio', label: 'toggle audio', permission: 'broadcast' },
133
- {command: 'enableAudio', label: 'enable audio', permission: 'broadcast' },
134
- {command: 'disableAudio', label: 'disable audio', permission: 'broadcast' },
135
- {command: 'startScreenshare', label: 'start screenshare', permission: 'screenshare' },
136
- {command: 'stopScreenshare', label: 'stop screenshare', permission: 'screenshare' },
137
- {command: 'raiseHand', label: 'raise hand', permission: 'raise_hand' },
138
- {command: 'startRecording', label: 'start recording', permission: 'recording' },
139
- {command: 'stopRecording', label: 'stop recording', permission: 'recording' },
140
- {command: 'showToolbar', label: 'show toolbar' },
141
- {command: 'hideToolbar', label: 'hide toolbar' },
142
- {command: 'toggleToolbar', label: 'toggle toolbar' },
143
- {command: 'changeLayoutMode', label: 'auto layout', args: ['auto'] },
144
- {command: 'changeLayoutMode', label: 'tiled layout', args: ['tiled'] },
145
- {command: 'showCaptions', label: 'show captions'},
146
- {command: 'hideCaptions', label: 'hide captions'},
147
- {command: 'toggleCaptions', label: 'toggle captions'},
148
- {command: 'leaveSession', label: 'leave session' },
149
- {command: 'endSession', label: 'end session', permission: 'end_session' },
150
- ]
151
-
152
- api.on('roomJoined', () => {
153
- baseControls.forEach(control => {
154
- if(control.permission && !api.permissionManager.hasPermissions(control.permission)) {
155
- return;
156
- };
157
-
158
- const button = document.createElement("button");
159
- button.innerHTML = control.label;
160
- button.onclick = () => api[control.command](...(control.args || []))
161
-
162
- buttonsParent.appendChild(button);
163
- })
164
-
165
-
166
- buttonsParent.style.display = 'block';
167
- })
168
-
169
- api.on('permissionsChanged', ({ data }) => {
170
- if(data.broadcast !== undefined){
171
- if(data.broadcast) {
172
- alert('You were granted broadcast permission')
173
- } else {
174
- alert('Your permission to broadcast was rejected')
175
- }
176
- }
177
-
178
- if(data.screenshare !== undefined){
179
- if(data.screenshare) {
180
- alert('You were granted screenshare permission')
181
- } else {
182
- alert('Your permission to screenshare was rejected')
183
- }
184
- }
185
-
186
- buttonsParent.innerHTML = '<button class="c0" style="margin-right: 15px; border: 2px solid blue">LOAD</button>';
187
-
188
- baseControls.forEach(control => {
189
- if(control.permission && !api.permissionManager.hasPermissions(control.permission)) {
190
- return;
191
- };
192
-
193
- const button = document.createElement("button");
194
- button.innerHTML = control.label;
195
- button.onclick = () => api[control.command](...(control.args || []))
196
-
197
- buttonsParent.appendChild(button);
198
- })
199
- });
200
-
201
-
202
- api.on('usersUpdated', ({data: {users}}) => {
203
- participantList.innerHTML = '';
204
-
205
- users.forEach(user => {
206
- const row = document.createElement('div');
207
- row.className = 'user-list-row';
208
- const subButtons = document.createElement('div')
209
- row.appendChild(subButtons);
210
-
211
- const avatar = document.createElement('span');
212
- avatar.className = 'user-list-avatar';
213
- avatar.style.background = user.avatarColor;
214
- row.appendChild(avatar);
215
-
216
-
217
- const name = document.createElement('span');
218
- name.className = 'user-list-name';
219
- name.innerText = user.name;
220
- row.appendChild(name);
221
-
222
- if(user.kind === 'local') {
223
- const label = document.createElement('span');
224
- label.className = 'user-list-label';
225
- label.innerText = '(you)'
226
- label.style.color = '#777';
227
- row.appendChild(label);
228
- } else {
229
- const micControl = document.createElement('button');
230
- micControl.innerHTML = 'toggle mic'
231
- micControl.style.margin = '0 4px';
232
- micControl.onclick = () => {
233
- api.requestToggleAudio(user.id)
234
- }
235
- row.appendChild(micControl);
236
-
237
-
238
- if(api.permissionManager.hasPermissions('remove_participant', {targetRole: user.role})) {
239
- const kickControl = document.createElement('button');
240
- kickControl.innerHTML = 'kick'
241
- kickControl.style.margin = '0 4px';
242
- kickControl.onclick = () => {api.removeUser(user.id)}
243
- row.appendChild(kickControl);
244
- }
245
-
246
- if(api.permissionManager.hasPermissions('manage_broadcast', {targetRole: user.role})) {
247
- const allowBroadcastControl = document.createElement('button');
248
- allowBroadcastControl.innerHTML = 'allow broadcast'
249
- allowBroadcastControl.style.margin = '0 4px';
250
- allowBroadcastControl.onclick = () => {api.allowBroadcast(user.id)}
251
- subButtons.appendChild(allowBroadcastControl);
252
-
253
- const disallowBroadcastControl = document.createElement('button');
254
- disallowBroadcastControl.innerHTML = 'disallow broadcast'
255
- disallowBroadcastControl.style.margin = '0 4px';
256
- disallowBroadcastControl.onclick = () => {api.disallowBroadcast(user.id)}
257
- subButtons.appendChild(disallowBroadcastControl);
258
-
259
- const allowScreenshareControl = document.createElement('button');
260
- allowScreenshareControl.innerHTML = 'allow screenshare'
261
- allowScreenshareControl.style.margin = '0 4px';
262
- allowScreenshareControl.onclick = () => {api.allowScreenshare(user.id)}
263
- subButtons.appendChild(allowScreenshareControl);
264
-
265
- const disallowScreenshareControl = document.createElement('button');
266
- disallowScreenshareControl.innerHTML = 'disallow screenshare'
267
- disallowScreenshareControl.style.margin = '0 4px';
268
- disallowScreenshareControl.onclick = () => {api.disallowScreenshare(user.id)}
269
- subButtons.appendChild(disallowScreenshareControl);
270
- }
271
- }
272
-
273
- const raisedHandControl = document.createElement('button');
274
- raisedHandControl.id = 'lower-hand-'+user.id;
275
- raisedHandControl.innerHTML = 'lower hand'
276
- raisedHandControl.style.margin = '0 4px';
277
- raisedHandControl.style.display = 'none';
278
- raisedHandControl.onclick = () => {api.lowerHand(user.id)}
279
- row.appendChild(raisedHandControl);
280
-
281
- participantList.appendChild(row);
282
- participantList.appendChild(subButtons);
283
-
284
- })
285
- })
286
- </script>
287
-
288
- </body>
289
- </html>
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../src/index.ts","../node_modules/@types/eslint/helpers.d.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/eslint/index.d.ts","../node_modules/@types/eslint-scope/index.d.ts","../node_modules/@types/node/ts4.8/assert.d.ts","../node_modules/@types/node/ts4.8/assert/strict.d.ts","../node_modules/@types/node/ts4.8/globals.d.ts","../node_modules/@types/node/ts4.8/async_hooks.d.ts","../node_modules/@types/node/ts4.8/buffer.d.ts","../node_modules/@types/node/ts4.8/child_process.d.ts","../node_modules/@types/node/ts4.8/cluster.d.ts","../node_modules/@types/node/ts4.8/console.d.ts","../node_modules/@types/node/ts4.8/constants.d.ts","../node_modules/@types/node/ts4.8/crypto.d.ts","../node_modules/@types/node/ts4.8/dgram.d.ts","../node_modules/@types/node/ts4.8/diagnostics_channel.d.ts","../node_modules/@types/node/ts4.8/dns.d.ts","../node_modules/@types/node/ts4.8/dns/promises.d.ts","../node_modules/@types/node/ts4.8/domain.d.ts","../node_modules/@types/node/ts4.8/dom-events.d.ts","../node_modules/@types/node/ts4.8/events.d.ts","../node_modules/@types/node/ts4.8/fs.d.ts","../node_modules/@types/node/ts4.8/fs/promises.d.ts","../node_modules/@types/node/ts4.8/http.d.ts","../node_modules/@types/node/ts4.8/http2.d.ts","../node_modules/@types/node/ts4.8/https.d.ts","../node_modules/@types/node/ts4.8/inspector.d.ts","../node_modules/@types/node/ts4.8/module.d.ts","../node_modules/@types/node/ts4.8/net.d.ts","../node_modules/@types/node/ts4.8/os.d.ts","../node_modules/@types/node/ts4.8/path.d.ts","../node_modules/@types/node/ts4.8/perf_hooks.d.ts","../node_modules/@types/node/ts4.8/process.d.ts","../node_modules/@types/node/ts4.8/punycode.d.ts","../node_modules/@types/node/ts4.8/querystring.d.ts","../node_modules/@types/node/ts4.8/readline.d.ts","../node_modules/@types/node/ts4.8/readline/promises.d.ts","../node_modules/@types/node/ts4.8/repl.d.ts","../node_modules/@types/node/ts4.8/stream.d.ts","../node_modules/@types/node/ts4.8/stream/promises.d.ts","../node_modules/@types/node/ts4.8/stream/consumers.d.ts","../node_modules/@types/node/ts4.8/stream/web.d.ts","../node_modules/@types/node/ts4.8/string_decoder.d.ts","../node_modules/@types/node/ts4.8/test.d.ts","../node_modules/@types/node/ts4.8/timers.d.ts","../node_modules/@types/node/ts4.8/timers/promises.d.ts","../node_modules/@types/node/ts4.8/tls.d.ts","../node_modules/@types/node/ts4.8/trace_events.d.ts","../node_modules/@types/node/ts4.8/tty.d.ts","../node_modules/@types/node/ts4.8/url.d.ts","../node_modules/@types/node/ts4.8/util.d.ts","../node_modules/@types/node/ts4.8/v8.d.ts","../node_modules/@types/node/ts4.8/vm.d.ts","../node_modules/@types/node/ts4.8/wasi.d.ts","../node_modules/@types/node/ts4.8/worker_threads.d.ts","../node_modules/@types/node/ts4.8/zlib.d.ts","../node_modules/@types/node/ts4.8/globals.global.d.ts","../node_modules/@types/node/ts4.8/index.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/hoist-non-react-statics/index.d.ts","../../node_modules/redux/index.d.ts","../../node_modules/@types/react-redux/index.d.ts","../../node_modules/@types/scheduler/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},{"version":"f837d0faf7d02e895c2ed634b632ef8d65f18f1d1b2568f50bc63da2688c956f","signature":"e2368d85b7c32a993e714d8ddd4f6a61bd9f94d7268caf9c60e9b381ce9e8021","affectsGlobalScope":true},{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"946bd1737d9412395a8f24414c70f18660b84a75a12b0b448e6eb1a2161d06dd","f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","c84d0f714fe122193c21c0f0917e873beb3a03fa3422ceb2fbd1ebc0558790a0","e050a0afcdbb269720a900c85076d18e0c1ab73e580202a2bf6964978181222a","9122ed7070e054b73ebab37c2373a196def2d90e7d1a9a7fcd9d46b0e51fae78","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"02873d070f9cb79f50833fbf4a9a27ac578a2edf8ddb8421eba1b37faba83bfb","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"e9d541cf4452ff2a5543c2d8a220f645b094b5e2b6cf7c5dd2a8cb54e8731f31","affectsGlobalScope":true},"0c0cee62cb619aed81133b904f644515ba3064487002a7da83fd8aa07b1b4abd","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","93a195fae9f7275e1a0631acffdfae49bb285d96fc8f7f606cb6eb7516dd03f5","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","75ecef44f126e2ae018b4abbd85b6e8a2e2ba1638ebec56cc64274643ce3567b","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"9b4e8e95e480a6ef470e0b0e1eaea9d986011d4dc05267dcc9edfaa6d22e7cd1","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","fa68e523cb5d3c2f1f02a94ea8ba2a61a9d1c88dc3c163e411311a826be1f9f3","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","dbe5aa5a5dd8bd1c6a8d11b1310c3f0cdabaacc78a37b394a8c7b14faeb5fb84","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"d4ac44f01d42f541631c5fc88d0ed8efac29a3a3ad9a745d9fd58f8b61ed132e","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","d1a78a3c5708807e8de3e399f91df4797c62e44b02195eefc2209b2e713e54ee","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","3163f47436da41706c6e2b3c1511f3b7cce9f9f3905b2f3e01246c48b4ba7d14","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","24ad30a03d6c9266b63540956868dd70fa2dc523d60d780d6586eb0c281946bc",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"f7db71191aa7aac5d6bc927ed6e7075c2763d22c7238227ec0c63c8cf5cb6a8b","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"652ee9c5103e89102d87bc20d167a02a0e3e5e53665674466c8cfea8a9e418c7",{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"5b1d4ebd62d975c7d3826202f8fac290bac0bae6e04d9e84d1707d7047e108df","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"b0e7534cd480e87b0976a4454e81d93ae31564f78a7068a7356408fe0c86f93e","affectsGlobalScope":true},"bfe1b52cf71aea9bf8815810cc5d9490fa9617313e3d3c2ee3809a28b80d0bb4",{"version":"d530250769a14518ebd6edda5b5f94abaaf3b9f612363c0da32082fa6acd0da8","affectsGlobalScope":true},"4370c91e46f6992a89e3979c50434cf932088e1b5ae6e3a5214d778634dea768","74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57"],"options":{"declaration":true,"downlevelIteration":true,"esModuleInterop":true,"jsx":4,"module":1,"noImplicitAny":true,"outDir":"./","strict":true,"target":1},"fileIdsList":[[57,59,107],[107],[56,57,58,107],[61,107],[64,107],[65,70,98,107],[66,77,78,85,95,106,107],[66,67,77,85,107],[68,107],[69,70,78,86,107],[70,95,103,107],[71,73,77,85,107],[72,107],[73,74,107],[77,107],[75,77,107],[77,78,79,95,106,107],[77,78,79,92,95,98,107],[107,111],[80,85,95,106,107],[77,78,80,81,85,95,103,106,107],[80,82,95,103,106,107],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113],[77,83,107],[84,106,107],[73,77,85,95,107],[86,107],[87,107],[64,88,107],[89,105,107,111],[90,107],[91,107],[77,92,93,107],[92,94,107,109],[65,77,95,96,97,98,107],[65,95,97,107],[95,96,107],[98,107],[99,107],[77,101,102,107],[101,102,107],[70,85,95,103,107],[104,107],[85,105,107],[65,80,91,106,107],[70,107],[95,107,108],[107,109],[107,110],[65,70,77,79,88,95,106,107,109,111],[95,107,112],[107,119],[107,119,120,121],[107,115,116,117,118],[119],[119,120,121],[115,116,117,118]],"referencedMap":[[60,1],[56,2],[59,3],[57,2],[58,2],[61,4],[62,4],[64,5],[65,6],[66,7],[67,8],[68,9],[69,10],[70,11],[71,12],[72,13],[73,14],[74,14],[76,15],[75,16],[77,15],[78,17],[79,18],[63,19],[113,2],[80,20],[81,21],[82,22],[114,23],[83,24],[84,25],[85,26],[86,27],[87,28],[88,29],[89,30],[90,31],[91,32],[92,33],[93,33],[94,34],[95,35],[97,36],[96,37],[98,38],[99,39],[100,2],[101,40],[102,41],[103,42],[104,43],[105,44],[106,45],[107,46],[108,47],[109,48],[110,49],[111,50],[112,51],[11,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[33,2],[34,2],[35,2],[36,2],[7,2],[37,2],[42,2],[43,2],[38,2],[39,2],[40,2],[41,2],[8,2],[47,2],[44,2],[45,2],[46,2],[48,2],[9,2],[49,2],[50,2],[51,2],[52,2],[53,2],[1,2],[10,2],[54,2],[55,2],[120,52],[117,2],[122,53],[115,2],[119,54],[123,2],[118,2],[116,2],[121,2]],"exportedModulesMap":[[60,1],[56,2],[59,3],[57,2],[58,2],[61,4],[62,4],[64,5],[65,6],[66,7],[67,8],[68,9],[69,10],[70,11],[71,12],[72,13],[73,14],[74,14],[76,15],[75,16],[77,15],[78,17],[79,18],[63,19],[113,2],[80,20],[81,21],[82,22],[114,23],[83,24],[84,25],[85,26],[86,27],[87,28],[88,29],[89,30],[90,31],[91,32],[92,33],[93,33],[94,34],[95,35],[97,36],[96,37],[98,38],[99,39],[100,2],[101,40],[102,41],[103,42],[104,43],[105,44],[106,45],[107,46],[108,47],[109,48],[110,49],[111,50],[112,51],[120,55],[122,56],[119,57]],"semanticDiagnosticsPerFile":[60,56,59,57,58,61,62,64,65,66,67,68,69,70,71,72,73,74,76,75,77,78,79,63,113,80,81,82,114,83,84,85,86,87,88,89,90,91,92,93,94,95,97,96,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,11,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,33,34,35,36,7,37,42,43,38,39,40,41,8,47,44,45,46,48,9,49,50,51,52,53,1,10,54,55,120,117,122,115,119,123,118,116,121]},"version":"4.8.3"}
@@ -1,290 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
6
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
- <title>Document</title>
8
- <!-- <script src="https://unpkg.com/@digitalsamba/embedded-sdk"></script>-->
9
- <script src="./umd/index.js"></script>
10
- <style>
11
- .user-list-row {
12
- display: flex;
13
- margin-bottom: 8px;
14
- align-items: center;
15
- }
16
-
17
- .user-list-avatar {
18
- width: 24px;
19
- height: 24px;
20
- display: block;
21
- border-radius: 50%;
22
- margin-right: 8px;
23
- }
24
-
25
- .log p {
26
- font-size: 14px;
27
- line-height: 1;
28
- margin: 0 0 4px
29
- }
30
-
31
- .buttons button, .captions-buttons button {
32
- margin: 2px;
33
- }
34
- </style>
35
- <script>
36
- const initialRoomState = {
37
- username: "",
38
- audioEnabled: false,
39
- videoEnabled: false,
40
- showToolbar: false,
41
- showCaptions: false,
42
- layoutMode: 'auto',
43
- virtualBackground: undefined
44
- }
45
- const VBstate = {
46
- type: 'blur',
47
- value: 'balanced',
48
- enforce: false,
49
- }
50
- const updateVBEnabled = () => {
51
- const vbOptions = document.querySelector('.vb-prep-options');
52
-
53
- if(initialRoomState.virtualBackground) {
54
- initialRoomState.virtualBackground = undefined
55
- vbOptions.style.opacity = '0.5'
56
- vbOptions.style.pointerEvents = 'none'
57
- } else {
58
- initialRoomState.virtualBackground = VBstate;
59
- vbOptions.style.opacity = '1'
60
- vbOptions.style.pointerEvents = 'all'
61
- }
62
- }
63
- </script>
64
- </head>
65
- <body>
66
- <div>
67
- <p>allowed blur options: "balanced", "strong"</p>
68
- <p>allowed image options: "office","office2","beach","fireworks","bookshelf","forest","mountain","savannah"
69
- </p>
70
- </div>
71
- <div class="sdk-prep">
72
- <h3>Initial settings</h3>
73
-
74
- <label for="prep-username-input">
75
- <p>Username:</p>
76
- <input type="text" id="prep-username-input">
77
- </label>
78
- <div class="prep-checkboxes"></div>
79
- <fieldset>
80
- <legend>Layout mode:</legend>
81
- <div>
82
- <input type="radio" id="prep-layout-mode1" checked name="contact" value="auto" onchange="initialRoomState.layoutMode = 'auto'" />
83
- <label for="prep-layout-mode1">Auto</label>
84
-
85
- <input type="radio" id="contactChoice2" name="contact" value="tiled" onchange="initialRoomState.layoutMode = 'tiled'"/>
86
- <label for="contactChoice2">Tiled</label>
87
- </div>
88
- </fieldset>
89
- <fieldset>
90
- <legend>Virtual background:</legend>
91
- <input type="checkbox" id="prep-vb-enabled" name="vb-enabled" value="auto" onchange="updateVBEnabled()" />
92
- <label for="prep-vb-enabled">VB enabled</label>
93
- <div class="vb-prep-options" style="opacity: 0.5; pointer-events: none;">
94
- <div>
95
- <label for="vb-type">VB type</label>
96
- <select name="vb-type" id="vb-type" onchange="VBstate.type = this.value">
97
- <option value="blur">blur</option>
98
- <option value="image">image</option>
99
- <option value="imageUrl">imageUrl</option>
100
- </select>
101
- </div>
102
- <div>
103
- <label for="prep-vb-value"></label>
104
- <input type="text" name="prep-vb-value" id="prep-vb-value" value="balanced" onchange="VBstate.value = this.value">
105
- </div>
106
- <div>
107
- <input type="checkbox" id="prep-vb-enforced" name="vb-enforced" value="auto" onchange="VBstate.enforce = !VBstate.enforce" />
108
- <label for="prep-vb-enforced">enforce VB</label>
109
- </div>
110
- </div>
111
- </fieldset>
112
- <div style="margin-top: 20px">
113
- <button type="button" class="sdk-prep-submit">load</button>
114
- </div>
115
- </div>
116
- <div class="sdk-ready" style="display: none">
117
- <div style="display: flex">
118
- <div class="ifp">
119
-
120
- </div>
121
- <div style="min-width: 300px ; padding: 0 16px">
122
- <h3>Room state</h3>
123
- <div class="state">
124
-
125
- </div>
126
- </div>
127
- </div>
128
- <div class="div buttons" style=" border: 1px solid yellow">
129
- <button class="c0" style="margin-right: 15px; border: 2px solid blue">LOAD</button>
130
-
131
- <fieldset class="room-vb-fields" style="display: none">
132
- <legend>Virtual background:</legend>
133
- <div class="vb-room-options">
134
- <div>
135
- <label for="room-vb-type">VB type</label>
136
- <select name="room-vb-type" id="room-vb-type" onchange="VBstate.type = this.value">
137
- <option value="blur">blur</option>
138
- <option value="image">image</option>
139
- <option value="imageUrl">imageUrl</option>
140
- </select>
141
- </div>
142
- <div>
143
- <label for="room-vb-value"></label>
144
- <input type="text" name="room-vb-value" id="room-vb-value" value="balanced" onchange="VBstate.value = this.value">
145
- </div>
146
- <div>
147
- <input type="checkbox" id="room-vb-enforced" name="room-vb-enforced" value="auto" onchange="VBstate.enforce = !VBstate.enforce" />
148
- <label for="room-vb-enforced">enforce VB</label>
149
- </div>
150
- </div>
151
- </fieldset>
152
- <button class="enable-vb-button">apply settings</button>
153
- <button class="disable-vb-button">disable-vb</button>
154
- </div>
155
-
156
- <div class="log">
157
-
158
- </div>
159
- </div>
160
-
161
- <script async defer>
162
- const parent = document.querySelector('.ifp');
163
- const frame = document.querySelector('.if');
164
- const buttonsParent = document.querySelector('.buttons');
165
- const captionsButtonsParent = document.querySelector('.captions-buttons');
166
- const participantList = document.querySelector('.participants');
167
- const btn0 = document.querySelector('.c0');
168
- const prepButton = document.querySelector('.sdk-prep-submit');
169
- const prepBlock = document.querySelector('.sdk-prep')
170
- const controlsBlock = document.querySelector('.sdk-ready')
171
- const prepUsernameInput = document.getElementById('prep-username-input')
172
- const prepCheckboxesParent = document.querySelector('.prep-checkboxes')
173
-
174
- const enableVBButton = document.querySelector('.enable-vb-button')
175
- const disableVBButton = document.querySelector('.disable-vb-button')
176
-
177
- // change these values to connect to your room
178
- const TEAM = 'some-team';
179
- const ROOM = 'some-room';
180
- let ROOM_URL = 'https://localhost:3000/Public'
181
-
182
- if(window.location.search) {
183
- const params = new URLSearchParams(window.location.search);
184
- const dynamicRoomUrl = params.get('roomUrl');
185
- if(dynamicRoomUrl) {
186
- ROOM_URL = dynamicRoomUrl
187
- }
188
- }
189
-
190
- //const api = new DigitalSambaEmbedded({ root: parent, team: TEAM, room: ROOM});
191
- // const api = new DigitalSambaEmbedded({ frame});
192
- //const api = new DigitalSambaEmbedded({ url: ROOM_URL}, {reportErrors: true});
193
-
194
- const prepCheckboxes = [
195
- {control: 'audioEnabled', label: 'Microphone enabled by default'},
196
- {control: 'videoEnabled', label: 'Camera enabled by default'},
197
- {control: 'showToolbar', label: 'Show toolbar'},
198
- {control: 'showCaptions', label: 'Show captions'},
199
- ];
200
-
201
- prepCheckboxes.forEach(control => {
202
- const label = document.createElement('label');
203
- label.style.display = 'block'
204
- label.htmlFor = 'prep-' + control.control;
205
- label.innerHTML = '<span>' + control.label + '</span>'
206
-
207
-
208
- const field = document.createElement('input');
209
- field.type = 'checkbox';
210
- field.id = 'prep-' + control.control;
211
-
212
- field.onchange = (e) => {
213
- initialRoomState[control.control] = e.target.checked
214
- }
215
-
216
- label.appendChild(field);
217
- prepCheckboxesParent.appendChild(label)
218
-
219
- })
220
-
221
- prepButton.onclick = () => {
222
- prepBlock.style.display = 'none'
223
- controlsBlock.style.display = 'block'
224
-
225
- const roomVBType = document.getElementById('room-vb-type');
226
- roomVBType.value = VBstate.type;
227
-
228
- const roomVBValue= document.getElementById('room-vb-value');
229
- roomVBValue.value = VBstate.value;
230
-
231
- const roomVBEnforce = document.getElementById('room-vb-enforced');
232
- roomVBEnforce.checked = VBstate.enforce;
233
-
234
- createControl()
235
- }
236
-
237
- prepUsernameInput.onchange = (e) => {
238
- initialRoomState.username = e.target.value
239
- }
240
-
241
- const vbStateToInitState = (originalConfig) => {
242
- if(!originalConfig) return undefined;
243
-
244
- return {
245
- [originalConfig.type]: originalConfig.value,
246
- enforce: originalConfig.enforce
247
- }
248
- }
249
-
250
- const createControl = () => {
251
- initialRoomState.virtualBackground = vbStateToInitState(initialRoomState.virtualBackground)
252
-
253
- const api = DigitalSambaEmbedded.createControl({ url: ROOM_URL, root: parent, roomSettings: initialRoomState });
254
-
255
- const log = document.querySelector('.log');
256
-
257
- api.frame.width = 900;
258
- api.frame.height = 700;
259
-
260
- btn0.onclick = () => {api.load({ frameAttributes: {style: "border: 5px solid red"}, reportErrors: true })}
261
-
262
- api.on('*', (data) => {
263
- log.innerHTML += `<p>${Number(new Date)}: ev(${data?.type}): ${JSON.stringify(data)}</p>`
264
- });
265
-
266
- api.on('frameLoaded', () => {
267
- document.querySelector('.room-vb-fields').style.display = 'block'
268
- })
269
-
270
- const stateBlock = document.querySelector('.state');
271
-
272
- api.on('roomStateUpdated', ({data}) => {
273
- stateBlock.innerHTML = JSON.stringify(data);
274
- })
275
-
276
- enableVBButton.onclick = () => {
277
- console.warn(vbStateToInitState(VBstate),'---')
278
- api.configureVirtualBackground(vbStateToInitState(VBstate));
279
- }
280
-
281
- disableVBButton.onclick = () => {
282
- api.disableVirtualBackground()
283
- }
284
-
285
- }
286
-
287
- </script>
288
-
289
- </body>
290
- </html>