@cloudflare/realtimekit-ui 1.0.0-staging.13 → 1.0.0-staging.14
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.
- package/dist/browser.js +1 -1
- package/dist/cjs/index.cjs.js +1 -2
- package/dist/cjs/{notification-1948ed2f.js → notification-bb1a9b99.js} +2 -7
- package/dist/cjs/rtk-avatar_54.cjs.entry.js +1 -2
- package/dist/cjs/rtk-participants-audio.cjs.entry.js +3 -3
- package/dist/cjs/rtk-screen-share-toggle.cjs.entry.js +1 -2
- package/dist/collection/components/rtk-screen-share-toggle/rtk-screen-share-toggle.js +1 -2
- package/dist/collection/lib/audio.js +3 -3
- package/dist/collection/lib/notification.js +2 -7
- package/dist/components/index.js +1 -1
- package/dist/components/{p-dba3cdd1.js → p-88526f0a.js} +1 -1
- package/dist/components/{p-50ecaaf1.js → p-908e4f1b.js} +2 -7
- package/dist/components/{p-1a546cf4.js → p-bad40128.js} +1 -1
- package/dist/components/rtk-chat.js +1 -1
- package/dist/components/rtk-meeting.js +2 -2
- package/dist/components/rtk-notifications.js +1 -1
- package/dist/components/rtk-participants-audio.js +3 -3
- package/dist/components/rtk-screen-share-toggle.js +1 -2
- package/dist/docs/docs-components.json +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/loader.js +6 -11
- package/dist/esm/{notification-800f2bcd.js → notification-6b3acf5b.js} +2 -7
- package/dist/esm/rtk-avatar_54.entry.js +1 -2
- package/dist/esm/rtk-participants-audio.entry.js +3 -3
- package/dist/esm/rtk-screen-share-toggle.entry.js +1 -2
- package/dist/realtimekit-ui/index.esm.js +1 -1
- package/dist/realtimekit-ui/p-01187fe9.entry.js +1 -0
- package/dist/realtimekit-ui/p-0bf304c7.js +1 -0
- package/dist/realtimekit-ui/p-e4c7e377.entry.js +1 -0
- package/dist/realtimekit-ui/p-fe77ed92.entry.js +1 -0
- package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
- package/dist/types/lib/audio.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/logger-3df9c75d.js +0 -5
- package/dist/collection/utils/logger.js +0 -1
- package/dist/components/p-5605a420.js +0 -3
- package/dist/esm/logger-31448943.js +0 -3
- package/dist/realtimekit-ui/p-235b7aa8.entry.js +0 -1
- package/dist/realtimekit-ui/p-4f45e362.entry.js +0 -1
- package/dist/realtimekit-ui/p-5605a420.js +0 -1
- package/dist/realtimekit-ui/p-59daa5d2.entry.js +0 -1
- package/dist/realtimekit-ui/p-fc36f92c.js +0 -1
- package/dist/types/utils/logger.d.ts +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -4,12 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const uiStore = require('./ui-store-3ddce955.js');
|
|
6
6
|
const config = require('./config-dba24e25.js');
|
|
7
|
-
const notification = require('./notification-
|
|
7
|
+
const notification = require('./notification-bb1a9b99.js');
|
|
8
8
|
const chat = require('./chat-46e7e4fe.js');
|
|
9
9
|
require('./index-05554ce6.js');
|
|
10
10
|
require('./keysIn-8bdbe83d.js');
|
|
11
11
|
require('./isObjectLike-73d13a39.js');
|
|
12
|
-
require('./logger-3df9c75d.js');
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Send notification which will be displayed in the `<rtk-notifications />` component.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const uiStore = require('./ui-store-3ddce955.js');
|
|
4
|
-
const logger = require('./logger-3df9c75d.js');
|
|
5
4
|
|
|
6
5
|
const SOUNDS = {
|
|
7
6
|
joined: 'https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3',
|
|
@@ -24,9 +23,7 @@ class RTKNotificationsAudio {
|
|
|
24
23
|
this.playing = true;
|
|
25
24
|
this.audio.src = SOUNDS[sound];
|
|
26
25
|
this.audio.volume = 0.3;
|
|
27
|
-
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((
|
|
28
|
-
logger.logger.error('[rtk-notifications] play() failed\n', { sound, duration }, err);
|
|
29
|
-
});
|
|
26
|
+
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((_) => { });
|
|
30
27
|
setTimeout(() => {
|
|
31
28
|
this.playing = false;
|
|
32
29
|
}, duration);
|
|
@@ -35,9 +32,7 @@ class RTKNotificationsAudio {
|
|
|
35
32
|
var _a, _b, _c;
|
|
36
33
|
if (uiStore.disableSettingSinkId(this.meeting))
|
|
37
34
|
return;
|
|
38
|
-
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((
|
|
39
|
-
logger.logger.error('[rtk-notifications] setSinkId() error\n', err);
|
|
40
|
-
}));
|
|
35
|
+
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((_) => { }));
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
38
|
|
|
@@ -17,10 +17,9 @@ const size = require('./size-2a406e36.js');
|
|
|
17
17
|
const ResizeObserver_es = require('./ResizeObserver.es-ba961f16.js');
|
|
18
18
|
const floatingUi_dom_esm = require('./floating-ui.dom.esm-c3c35b98.js');
|
|
19
19
|
const TextMessage = require('./TextMessage-e9ca06aa.js');
|
|
20
|
-
const notification = require('./notification-
|
|
20
|
+
const notification = require('./notification-bb1a9b99.js');
|
|
21
21
|
require('./isObjectLike-73d13a39.js');
|
|
22
22
|
require('./keysIn-8bdbe83d.js');
|
|
23
|
-
require('./logger-3df9c75d.js');
|
|
24
23
|
|
|
25
24
|
const rtkAvatarCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px);align-items:center;justify-content:center;font-size:28px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));overflow:clip;border-radius:9999px;-webkit-user-select:none;-moz-user-select:none;user-select:none}rtk-icon{height:50%;width:50%}.image-ctr{display:flex;height:100%;width:100%;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}img{height:var(--rtk-space-0, 0px);width:var(--rtk-space-0, 0px);-o-object-fit:cover;object-fit:cover}img.loaded{height:100%;width:100%}.initials{display:flex;height:100%;width:100%;align-items:center;justify-content:center;text-transform:uppercase}.image{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.image img{display:none;height:100%;width:100%;-o-object-fit:cover;object-fit:cover}.image img.loaded{display:block}:host([variant='hexagon']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%)}:host([variant='square']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)}:host([size='sm']){height:var(--rtk-space-14, 56px);width:var(--rtk-space-14, 56px);font-size:12px}:host([size='md']){height:var(--rtk-space-28, 112px);width:var(--rtk-space-28, 112px)}:host([size='lg']){height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px)}";
|
|
26
25
|
const RtkAvatarStyle0 = rtkAvatarCss;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index$1 = require('./index-05554ce6.js');
|
|
6
6
|
const uiStore = require('./ui-store-3ddce955.js');
|
|
7
|
-
const logger = require('./logger-3df9c75d.js');
|
|
8
7
|
const index = require('./index-daae8cee.js');
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -15,6 +14,7 @@ class RTKAudio {
|
|
|
15
14
|
this.meeting = meeting;
|
|
16
15
|
this.audio = audio !== null && audio !== void 0 ? audio : document.createElement('audio');
|
|
17
16
|
this.audio.autoplay = true;
|
|
17
|
+
this.logger = meeting.__internals__.logger;
|
|
18
18
|
this.audioStream = new MediaStream();
|
|
19
19
|
this.audio.srcObject = this.audioStream;
|
|
20
20
|
this.audioTracks = [];
|
|
@@ -43,7 +43,7 @@ class RTKAudio {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
else if (err.name !== 'AbortError') {
|
|
46
|
-
|
|
46
|
+
this.logger.error('[rtk-audio] play() error\n', err);
|
|
47
47
|
}
|
|
48
48
|
}));
|
|
49
49
|
}
|
|
@@ -52,7 +52,7 @@ class RTKAudio {
|
|
|
52
52
|
if (uiStore.disableSettingSinkId(this.meeting))
|
|
53
53
|
return;
|
|
54
54
|
await ((_c = (_b = (_a = this.audio).setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((err) => {
|
|
55
|
-
|
|
55
|
+
this.logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
56
56
|
}));
|
|
57
57
|
}
|
|
58
58
|
onError(onError) {
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index$1 = require('./index-05554ce6.js');
|
|
6
6
|
const uiStore = require('./ui-store-3ddce955.js');
|
|
7
|
-
const logger = require('./logger-3df9c75d.js');
|
|
8
7
|
const index = require('./index-daae8cee.js');
|
|
9
8
|
|
|
10
9
|
const rtkScreenShareToggleCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";
|
|
@@ -144,7 +143,7 @@ const RtkScreenShareToggle = class {
|
|
|
144
143
|
}
|
|
145
144
|
connectedCallback() {
|
|
146
145
|
if (!deviceCanScreenShare()) {
|
|
147
|
-
|
|
146
|
+
this.meeting.__internals__.logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
148
147
|
return;
|
|
149
148
|
}
|
|
150
149
|
this.meetingChanged(this.meeting);
|
|
@@ -11,7 +11,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
11
11
|
import { defaultIconPack } from "../../lib/icons";
|
|
12
12
|
import { useLanguage } from "../../lib/lang";
|
|
13
13
|
import { Host, h } from "@stencil/core";
|
|
14
|
-
import logger from "../../utils/logger";
|
|
15
14
|
import { SyncWithStore } from "../../utils/sync-with-store";
|
|
16
15
|
const deviceCanScreenShare = () => {
|
|
17
16
|
return (typeof navigator !== 'undefined' &&
|
|
@@ -137,7 +136,7 @@ export class RtkScreenShareToggle {
|
|
|
137
136
|
}
|
|
138
137
|
connectedCallback() {
|
|
139
138
|
if (!deviceCanScreenShare()) {
|
|
140
|
-
logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
139
|
+
this.meeting.__internals__.logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
141
140
|
return;
|
|
142
141
|
}
|
|
143
142
|
this.meetingChanged(this.meeting);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { disableSettingSinkId } from "../utils/flags";
|
|
2
|
-
import logger from "../utils/logger";
|
|
3
2
|
/**
|
|
4
3
|
* Handles audio from participants in a meeting
|
|
5
4
|
*/
|
|
@@ -8,6 +7,7 @@ export default class RTKAudio {
|
|
|
8
7
|
this.meeting = meeting;
|
|
9
8
|
this.audio = audio !== null && audio !== void 0 ? audio : document.createElement('audio');
|
|
10
9
|
this.audio.autoplay = true;
|
|
10
|
+
this.logger = meeting.__internals__.logger;
|
|
11
11
|
this.audioStream = new MediaStream();
|
|
12
12
|
this.audio.srcObject = this.audioStream;
|
|
13
13
|
this.audioTracks = [];
|
|
@@ -36,7 +36,7 @@ export default class RTKAudio {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
else if (err.name !== 'AbortError') {
|
|
39
|
-
logger.error('[rtk-audio] play() error\n', err);
|
|
39
|
+
this.logger.error('[rtk-audio] play() error\n', err);
|
|
40
40
|
}
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
@@ -45,7 +45,7 @@ export default class RTKAudio {
|
|
|
45
45
|
if (disableSettingSinkId(this.meeting))
|
|
46
46
|
return;
|
|
47
47
|
await ((_c = (_b = (_a = this.audio).setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((err) => {
|
|
48
|
-
logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
48
|
+
this.logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
49
49
|
}));
|
|
50
50
|
}
|
|
51
51
|
onError(onError) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { disableSettingSinkId } from "../utils/flags";
|
|
2
|
-
import logger from "../utils/logger";
|
|
3
2
|
const SOUNDS = {
|
|
4
3
|
joined: 'https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3',
|
|
5
4
|
left: 'https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3',
|
|
@@ -21,9 +20,7 @@ export default class RTKNotificationsAudio {
|
|
|
21
20
|
this.playing = true;
|
|
22
21
|
this.audio.src = SOUNDS[sound];
|
|
23
22
|
this.audio.volume = 0.3;
|
|
24
|
-
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((
|
|
25
|
-
logger.error('[rtk-notifications] play() failed\n', { sound, duration }, err);
|
|
26
|
-
});
|
|
23
|
+
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((_) => { });
|
|
27
24
|
setTimeout(() => {
|
|
28
25
|
this.playing = false;
|
|
29
26
|
}, duration);
|
|
@@ -32,8 +29,6 @@ export default class RTKNotificationsAudio {
|
|
|
32
29
|
var _a, _b, _c;
|
|
33
30
|
if (disableSettingSinkId(this.meeting))
|
|
34
31
|
return;
|
|
35
|
-
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((
|
|
36
|
-
logger.error('[rtk-notifications] setSinkId() error\n', err);
|
|
37
|
-
}));
|
|
32
|
+
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((_) => { }));
|
|
38
33
|
}
|
|
39
34
|
}
|
package/dist/components/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { d as defaultConfig } from './p-e6d09c50.js';
|
|
|
3
3
|
export { B as BreakoutRoomsManager, d as defaultConfig, a as defaultIconPack, b as defaultLanguage, g as getInitialStates, u as uiStore, c as useLanguage } from './p-e6d09c50.js';
|
|
4
4
|
import { g as generateConfig } from './p-4a436e2d.js';
|
|
5
5
|
export { e as extendConfig, g as generateConfig, p as provideRtkDesignSystem } from './p-4a436e2d.js';
|
|
6
|
-
export { R as RtkNotificationsAudio } from './p-
|
|
6
|
+
export { R as RtkNotificationsAudio } from './p-908e4f1b.js';
|
|
7
7
|
export { g as generateChatGroupKey, a as getChatGroups, c as getParticipantUserId, b as getUnreadChatCounts } from './p-0abe4b8a.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -46,7 +46,7 @@ import { d as defineCustomElement$d } from './p-c7dcb441.js';
|
|
|
46
46
|
import { d as defineCustomElement$c } from './p-c939f92d.js';
|
|
47
47
|
import { d as defineCustomElement$b } from './p-135d5d2f.js';
|
|
48
48
|
import { d as defineCustomElement$a } from './p-ece96324.js';
|
|
49
|
-
import { d as defineCustomElement$9 } from './p-
|
|
49
|
+
import { d as defineCustomElement$9 } from './p-bad40128.js';
|
|
50
50
|
import { d as defineCustomElement$8 } from './p-71e0f6f2.js';
|
|
51
51
|
import { d as defineCustomElement$7 } from './p-9cfe5c7c.js';
|
|
52
52
|
import { d as defineCustomElement$6 } from './p-68b6f23b.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { e as disableSettingSinkId } from './p-e6d09c50.js';
|
|
2
|
-
import { l as logger } from './p-5605a420.js';
|
|
3
2
|
|
|
4
3
|
const SOUNDS = {
|
|
5
4
|
joined: 'https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3',
|
|
@@ -22,9 +21,7 @@ class RTKNotificationsAudio {
|
|
|
22
21
|
this.playing = true;
|
|
23
22
|
this.audio.src = SOUNDS[sound];
|
|
24
23
|
this.audio.volume = 0.3;
|
|
25
|
-
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((
|
|
26
|
-
logger.error('[rtk-notifications] play() failed\n', { sound, duration }, err);
|
|
27
|
-
});
|
|
24
|
+
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((_) => { });
|
|
28
25
|
setTimeout(() => {
|
|
29
26
|
this.playing = false;
|
|
30
27
|
}, duration);
|
|
@@ -33,9 +30,7 @@ class RTKNotificationsAudio {
|
|
|
33
30
|
var _a, _b, _c;
|
|
34
31
|
if (disableSettingSinkId(this.meeting))
|
|
35
32
|
return;
|
|
36
|
-
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((
|
|
37
|
-
logger.error('[rtk-notifications] setSinkId() error\n', err);
|
|
38
|
-
}));
|
|
33
|
+
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((_) => { }));
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
36
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, w as writeTask, h, e as Host } from './p-c3592601.js';
|
|
2
|
-
import { R as RTKNotificationsAudio } from './p-
|
|
2
|
+
import { R as RTKNotificationsAudio } from './p-908e4f1b.js';
|
|
3
3
|
import { f as formatName } from './p-338c7261.js';
|
|
4
4
|
import { d as defaultConfig, c as useLanguage, a as defaultIconPack, s as showLivestream } from './p-e6d09c50.js';
|
|
5
5
|
import { j as parseMessageForTarget } from './p-0abe4b8a.js';
|
|
@@ -16,7 +16,7 @@ import { d as defineCustomElement$M } from './p-9da5b9d0.js';
|
|
|
16
16
|
import { d as defineCustomElement$L } from './p-f6046472.js';
|
|
17
17
|
import { d as defineCustomElement$K } from './p-5c3d1c4f.js';
|
|
18
18
|
import { d as defineCustomElement$J } from './p-9cace38c.js';
|
|
19
|
-
import { d as defineCustomElement$I } from './p-
|
|
19
|
+
import { d as defineCustomElement$I } from './p-88526f0a.js';
|
|
20
20
|
import { d as defineCustomElement$H } from './p-0c4a1808.js';
|
|
21
21
|
import { d as defineCustomElement$G } from './p-c2723ebb.js';
|
|
22
22
|
import { d as defineCustomElement$F } from './p-898da6ae.js';
|
|
@@ -50,7 +50,7 @@ import { d as defineCustomElement$e } from './p-c7dcb441.js';
|
|
|
50
50
|
import { d as defineCustomElement$d } from './p-c939f92d.js';
|
|
51
51
|
import { d as defineCustomElement$c } from './p-135d5d2f.js';
|
|
52
52
|
import { d as defineCustomElement$b } from './p-ece96324.js';
|
|
53
|
-
import { d as defineCustomElement$a } from './p-
|
|
53
|
+
import { d as defineCustomElement$a } from './p-bad40128.js';
|
|
54
54
|
import { d as defineCustomElement$9 } from './p-71e0f6f2.js';
|
|
55
55
|
import { d as defineCustomElement$8 } from './p-9cfe5c7c.js';
|
|
56
56
|
import { d as defineCustomElement$7 } from './p-68b6f23b.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RtkNotifications$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { R as RtkNotifications$1, d as defineCustomElement$1 } from './p-bad40128.js';
|
|
2
2
|
|
|
3
3
|
const RtkNotifications = RtkNotifications$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, e as Host } from './p-c3592601.js';
|
|
2
2
|
import { e as disableSettingSinkId, a as defaultIconPack, c as useLanguage, m as isLiveStreamViewer } from './p-e6d09c50.js';
|
|
3
|
-
import { l as logger } from './p-5605a420.js';
|
|
4
3
|
import { S as SyncWithStore } from './p-d5791958.js';
|
|
5
4
|
import { d as defineCustomElement$4 } from './p-4cc0e9a5.js';
|
|
6
5
|
import { d as defineCustomElement$3 } from './p-cd50770d.js';
|
|
@@ -14,6 +13,7 @@ class RTKAudio {
|
|
|
14
13
|
this.meeting = meeting;
|
|
15
14
|
this.audio = audio !== null && audio !== void 0 ? audio : document.createElement('audio');
|
|
16
15
|
this.audio.autoplay = true;
|
|
16
|
+
this.logger = meeting.__internals__.logger;
|
|
17
17
|
this.audioStream = new MediaStream();
|
|
18
18
|
this.audio.srcObject = this.audioStream;
|
|
19
19
|
this.audioTracks = [];
|
|
@@ -42,7 +42,7 @@ class RTKAudio {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
else if (err.name !== 'AbortError') {
|
|
45
|
-
logger.error('[rtk-audio] play() error\n', err);
|
|
45
|
+
this.logger.error('[rtk-audio] play() error\n', err);
|
|
46
46
|
}
|
|
47
47
|
}));
|
|
48
48
|
}
|
|
@@ -51,7 +51,7 @@ class RTKAudio {
|
|
|
51
51
|
if (disableSettingSinkId(this.meeting))
|
|
52
52
|
return;
|
|
53
53
|
await ((_c = (_b = (_a = this.audio).setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((err) => {
|
|
54
|
-
logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
54
|
+
this.logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
57
|
onError(onError) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, e as Host } from './p-c3592601.js';
|
|
2
2
|
import { a as defaultIconPack, c as useLanguage } from './p-e6d09c50.js';
|
|
3
|
-
import { l as logger } from './p-5605a420.js';
|
|
4
3
|
import { S as SyncWithStore } from './p-d5791958.js';
|
|
5
4
|
import { d as defineCustomElement$5 } from './p-bdbaa65b.js';
|
|
6
5
|
import { d as defineCustomElement$4 } from './p-2f2fb96d.js';
|
|
@@ -146,7 +145,7 @@ const RtkScreenShareToggle$1 = /*@__PURE__*/ proxyCustomElement(class RtkScreenS
|
|
|
146
145
|
}
|
|
147
146
|
connectedCallback() {
|
|
148
147
|
if (!deviceCanScreenShare()) {
|
|
149
|
-
logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
148
|
+
this.meeting.__internals__.logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
150
149
|
return;
|
|
151
150
|
}
|
|
152
151
|
this.meetingChanged(this.meeting);
|
package/dist/esm/index.js
CHANGED
|
@@ -2,12 +2,11 @@ import { d as defaultConfig } from './ui-store-b453cdf2.js';
|
|
|
2
2
|
export { B as BreakoutRoomsManager, d as defaultConfig, a as defaultIconPack, b as defaultLanguage, g as getInitialStates, u as uiStore, c as useLanguage } from './ui-store-b453cdf2.js';
|
|
3
3
|
import { g as generateConfig } from './config-1ca1ba30.js';
|
|
4
4
|
export { e as extendConfig, g as generateConfig, p as provideRtkDesignSystem } from './config-1ca1ba30.js';
|
|
5
|
-
export { R as RtkNotificationsAudio } from './notification-
|
|
5
|
+
export { R as RtkNotificationsAudio } from './notification-6b3acf5b.js';
|
|
6
6
|
export { g as generateChatGroupKey, a as getChatGroups, c as getParticipantUserId, b as getUnreadChatCounts } from './chat-c25836b0.js';
|
|
7
7
|
import './index-c1fb98bb.js';
|
|
8
8
|
import './keysIn-310f65c1.js';
|
|
9
9
|
import './isObjectLike-773b9473.js';
|
|
10
|
-
import './logger-31448943.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Send notification which will be displayed in the `<rtk-notifications />` component.
|
package/dist/esm/loader.js
CHANGED
|
@@ -9798,8 +9798,6 @@ const TextMessageView = ({ message }) => {
|
|
|
9798
9798
|
})));
|
|
9799
9799
|
};
|
|
9800
9800
|
|
|
9801
|
-
const logger$1 = console;
|
|
9802
|
-
|
|
9803
9801
|
const SOUNDS = {
|
|
9804
9802
|
joined: 'https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3',
|
|
9805
9803
|
left: 'https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3',
|
|
@@ -9821,9 +9819,7 @@ class RTKNotificationsAudio {
|
|
|
9821
9819
|
this.playing = true;
|
|
9822
9820
|
this.audio.src = SOUNDS[sound];
|
|
9823
9821
|
this.audio.volume = 0.3;
|
|
9824
|
-
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((
|
|
9825
|
-
logger$1.error('[rtk-notifications] play() failed\n', { sound, duration }, err);
|
|
9826
|
-
});
|
|
9822
|
+
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((_) => { });
|
|
9827
9823
|
setTimeout(() => {
|
|
9828
9824
|
this.playing = false;
|
|
9829
9825
|
}, duration);
|
|
@@ -9832,9 +9828,7 @@ class RTKNotificationsAudio {
|
|
|
9832
9828
|
var _a, _b, _c;
|
|
9833
9829
|
if (disableSettingSinkId(this.meeting))
|
|
9834
9830
|
return;
|
|
9835
|
-
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((
|
|
9836
|
-
logger$1.error('[rtk-notifications] setSinkId() error\n', err);
|
|
9837
|
-
}));
|
|
9831
|
+
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((_) => { }));
|
|
9838
9832
|
}
|
|
9839
9833
|
}
|
|
9840
9834
|
|
|
@@ -21158,6 +21152,7 @@ class RTKAudio {
|
|
|
21158
21152
|
this.meeting = meeting;
|
|
21159
21153
|
this.audio = audio !== null && audio !== void 0 ? audio : document.createElement('audio');
|
|
21160
21154
|
this.audio.autoplay = true;
|
|
21155
|
+
this.logger = meeting.__internals__.logger;
|
|
21161
21156
|
this.audioStream = new MediaStream();
|
|
21162
21157
|
this.audio.srcObject = this.audioStream;
|
|
21163
21158
|
this.audioTracks = [];
|
|
@@ -21186,7 +21181,7 @@ class RTKAudio {
|
|
|
21186
21181
|
}
|
|
21187
21182
|
}
|
|
21188
21183
|
else if (err.name !== 'AbortError') {
|
|
21189
|
-
logger
|
|
21184
|
+
this.logger.error('[rtk-audio] play() error\n', err);
|
|
21190
21185
|
}
|
|
21191
21186
|
}));
|
|
21192
21187
|
}
|
|
@@ -21195,7 +21190,7 @@ class RTKAudio {
|
|
|
21195
21190
|
if (disableSettingSinkId(this.meeting))
|
|
21196
21191
|
return;
|
|
21197
21192
|
await ((_c = (_b = (_a = this.audio).setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((err) => {
|
|
21198
|
-
logger
|
|
21193
|
+
this.logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
21199
21194
|
}));
|
|
21200
21195
|
}
|
|
21201
21196
|
onError(onError) {
|
|
@@ -22155,7 +22150,7 @@ const RtkScreenShareToggle = class {
|
|
|
22155
22150
|
}
|
|
22156
22151
|
connectedCallback() {
|
|
22157
22152
|
if (!deviceCanScreenShare()) {
|
|
22158
|
-
logger
|
|
22153
|
+
this.meeting.__internals__.logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
22159
22154
|
return;
|
|
22160
22155
|
}
|
|
22161
22156
|
this.meetingChanged(this.meeting);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { e as disableSettingSinkId } from './ui-store-b453cdf2.js';
|
|
2
|
-
import { l as logger } from './logger-31448943.js';
|
|
3
2
|
|
|
4
3
|
const SOUNDS = {
|
|
5
4
|
joined: 'https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3',
|
|
@@ -22,9 +21,7 @@ class RTKNotificationsAudio {
|
|
|
22
21
|
this.playing = true;
|
|
23
22
|
this.audio.src = SOUNDS[sound];
|
|
24
23
|
this.audio.volume = 0.3;
|
|
25
|
-
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((
|
|
26
|
-
logger.error('[rtk-notifications] play() failed\n', { sound, duration }, err);
|
|
27
|
-
});
|
|
24
|
+
(_a = this.audio.play()) === null || _a === void 0 ? void 0 : _a.catch((_) => { });
|
|
28
25
|
setTimeout(() => {
|
|
29
26
|
this.playing = false;
|
|
30
27
|
}, duration);
|
|
@@ -33,9 +30,7 @@ class RTKNotificationsAudio {
|
|
|
33
30
|
var _a, _b, _c;
|
|
34
31
|
if (disableSettingSinkId(this.meeting))
|
|
35
32
|
return;
|
|
36
|
-
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((
|
|
37
|
-
logger.error('[rtk-notifications] setSinkId() error\n', err);
|
|
38
|
-
}));
|
|
33
|
+
await ((_c = (_b = (_a = this.audio) === null || _a === void 0 ? void 0 : _a.setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((_) => { }));
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
36
|
|
|
@@ -13,10 +13,9 @@ import { g as getSize } from './size-505ade24.js';
|
|
|
13
13
|
import { i as index } from './ResizeObserver.es-02979d4e.js';
|
|
14
14
|
import { c as computePosition, o as offset, f as flip, s as shift, a as arrow } from './floating-ui.dom.esm-cf1488a2.js';
|
|
15
15
|
import { T as TextMessageView } from './TextMessage-efd224db.js';
|
|
16
|
-
import { R as RTKNotificationsAudio } from './notification-
|
|
16
|
+
import { R as RTKNotificationsAudio } from './notification-6b3acf5b.js';
|
|
17
17
|
import './isObjectLike-773b9473.js';
|
|
18
18
|
import './keysIn-310f65c1.js';
|
|
19
|
-
import './logger-31448943.js';
|
|
20
19
|
|
|
21
20
|
const rtkAvatarCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px);align-items:center;justify-content:center;font-size:28px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));overflow:clip;border-radius:9999px;-webkit-user-select:none;-moz-user-select:none;user-select:none}rtk-icon{height:50%;width:50%}.image-ctr{display:flex;height:100%;width:100%;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}img{height:var(--rtk-space-0, 0px);width:var(--rtk-space-0, 0px);-o-object-fit:cover;object-fit:cover}img.loaded{height:100%;width:100%}.initials{display:flex;height:100%;width:100%;align-items:center;justify-content:center;text-transform:uppercase}.image{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.image img{display:none;height:100%;width:100%;-o-object-fit:cover;object-fit:cover}.image img.loaded{display:block}:host([variant='hexagon']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%)}:host([variant='square']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)}:host([size='sm']){height:var(--rtk-space-14, 56px);width:var(--rtk-space-14, 56px);font-size:12px}:host([size='md']){height:var(--rtk-space-28, 112px);width:var(--rtk-space-28, 112px)}:host([size='lg']){height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px)}";
|
|
22
21
|
const RtkAvatarStyle0 = rtkAvatarCss;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-c1fb98bb.js';
|
|
2
2
|
import { e as disableSettingSinkId, a as defaultIconPack, c as useLanguage, q as isLiveStreamViewer } from './ui-store-b453cdf2.js';
|
|
3
|
-
import { l as logger } from './logger-31448943.js';
|
|
4
3
|
import { S as SyncWithStore } from './index-6aaa85ca.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -11,6 +10,7 @@ class RTKAudio {
|
|
|
11
10
|
this.meeting = meeting;
|
|
12
11
|
this.audio = audio !== null && audio !== void 0 ? audio : document.createElement('audio');
|
|
13
12
|
this.audio.autoplay = true;
|
|
13
|
+
this.logger = meeting.__internals__.logger;
|
|
14
14
|
this.audioStream = new MediaStream();
|
|
15
15
|
this.audio.srcObject = this.audioStream;
|
|
16
16
|
this.audioTracks = [];
|
|
@@ -39,7 +39,7 @@ class RTKAudio {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
else if (err.name !== 'AbortError') {
|
|
42
|
-
logger.error('[rtk-audio] play() error\n', err);
|
|
42
|
+
this.logger.error('[rtk-audio] play() error\n', err);
|
|
43
43
|
}
|
|
44
44
|
}));
|
|
45
45
|
}
|
|
@@ -48,7 +48,7 @@ class RTKAudio {
|
|
|
48
48
|
if (disableSettingSinkId(this.meeting))
|
|
49
49
|
return;
|
|
50
50
|
await ((_c = (_b = (_a = this.audio).setSinkId) === null || _b === void 0 ? void 0 : _b.call(_a, id)) === null || _c === void 0 ? void 0 : _c.catch((err) => {
|
|
51
|
-
logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
51
|
+
this.logger.error('[rtk-audio] setSinkId() error\n', err);
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
54
54
|
onError(onError) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-c1fb98bb.js';
|
|
2
2
|
import { a as defaultIconPack, c as useLanguage } from './ui-store-b453cdf2.js';
|
|
3
|
-
import { l as logger } from './logger-31448943.js';
|
|
4
3
|
import { S as SyncWithStore } from './index-6aaa85ca.js';
|
|
5
4
|
|
|
6
5
|
const rtkScreenShareToggleCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";
|
|
@@ -140,7 +139,7 @@ const RtkScreenShareToggle = class {
|
|
|
140
139
|
}
|
|
141
140
|
connectedCallback() {
|
|
142
141
|
if (!deviceCanScreenShare()) {
|
|
143
|
-
logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
142
|
+
this.meeting.__internals__.logger.error('[rtk-screenshare-toggle] Device does not support screensharing.');
|
|
144
143
|
return;
|
|
145
144
|
}
|
|
146
145
|
this.meetingChanged(this.meeting);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t}from"./p-ee167b96.js";export{B as BreakoutRoomsManager,d as defaultConfig,a as defaultIconPack,b as defaultLanguage,g as getInitialStates,u as uiStore,c as useLanguage}from"./p-ee167b96.js";import{g as s}from"./p-6ededa68.js";export{e as extendConfig,g as generateConfig,p as provideRtkDesignSystem}from"./p-6ededa68.js";export{R as RtkNotificationsAudio}from"./p-
|
|
1
|
+
import{d as t}from"./p-ee167b96.js";export{B as BreakoutRoomsManager,d as defaultConfig,a as defaultIconPack,b as defaultLanguage,g as getInitialStates,u as uiStore,c as useLanguage}from"./p-ee167b96.js";import{g as s}from"./p-6ededa68.js";export{e as extendConfig,g as generateConfig,p as provideRtkDesignSystem}from"./p-6ededa68.js";export{R as RtkNotificationsAudio}from"./p-0bf304c7.js";export{g as generateChatGroupKey,a as getChatGroups,c as getParticipantUserId,b as getUnreadChatCounts}from"./p-aaba206b.js";import"./p-0ee570cd.js";import"./p-46923b34.js";import"./p-2c3cda13.js";const i=(t,s)=>{if("undefined"==typeof document)return!1;const e=new CustomEvent("rtkNotification",{detail:Object.assign(Object.assign({},t),{playSound:s}),composed:!0});return document.dispatchEvent(e)};function r(t){return s=>Array.isArray(s)?s[0]===t:s===t}function o(t){return s=>Array.isArray(s)?s[0]!==t:s!==t}function n(t){return t.replace(/([a-z])([A-Z])/g,(t=>`${t[0]}-${t[1]}`.toLowerCase()))}class h{constructor(t,s,e){this.elem=t,this.config=s,this.keyString=e}add(t,s={}){var e;let i=t=n(t);return Object.keys(s).length>0&&(i=[t,s]),Array.isArray(this.elem)?this.elem.push(i):"children"in this.elem&&Array.isArray(this.elem.children)?this.elem.children=[...this.elem.children,i]:"remove"in this.elem&&Array.isArray(this.elem.remove)&&this.elem.remove.find(r(t))?this.elem.remove=this.elem.remove.filter(o(t)):("add"in this.elem||(this.elem.add=[]),null===(e=this.elem.add)||void 0===e||e.push(i)),this}remove(t){var s;if(t=n(t),Array.isArray(this.elem)){const s=this.elem.findIndex(r(t));s>-1&&this.elem.splice(s,1)}else"children"in this.elem&&Array.isArray(this.elem.children)?this.elem.children=this.elem.children.filter(o(t)):"add"in this.elem&&Array.isArray(this.elem.add)&&this.elem.add.find((s=>s===t))?this.elem.add=this.elem.add.filter(o(t)):("remove"in this.elem||(this.elem.remove=[]),null===(s=this.elem.remove)||void 0===s||s.push(t));return this}set style(t){console.log(t)}setChildrenProps(t,s){console.log(this.keyString,t,s)}getChildrenProps(t){return console.log(this.keyString,t),{}}replace(t){console.log(this.config,t)}}class l{constructor(s){this.config=s||t}find(t,s={}){t=n(t);const e=[],i=[];Object.keys(s||{}).forEach((t=>{"boolean"==typeof s[t]?e.push(t):i.push([t,s[t]])})),e.sort();const r=this.config.root;if(void 0===r)return;let o=t,a="";e.length>0&&(a=`.${e.join(".")}`,o=`${t}${a}`,Array.isArray(r[t])&&(r[t]={states:[],children:r[t]}),void 0===r[t].states&&(r[t].states=[]),e.forEach((s=>{var e,i;-1===(null===(e=r[t].states)||void 0===e?void 0:e.indexOf(s))&&(null===(i=r[t].states)||void 0===i||i.push(s))}))),i.length>0&&i.forEach((s=>{o=`${t}[${s[0]}=${s[1]}]${a}`,Array.isArray(r[t])&&(r[t]={state:s[0],children:r[t]})}));let d=r[o];return void 0===d&&(r[o]={},d=r[o]),new h(d,this.config,o)}build(){return this.config}}function f(t,e,i){if(!i){const t=s(e.self.config,e);i=t.config}return t.map((t=>{i=t.register(i,e,(t=>new l(t)))})),i}export{l as RtkUiBuilder,f as registerAddons,i as sendNotification}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as a,H as s}from"./p-0ee570cd.js";import{e,a as r,c as o,q as h}from"./p-ee167b96.js";import{S as d}from"./p-2aa242f4.js";class n{constructor(t,i){this.meeting=t,this.audio=null!=i?i:document.createElement("audio"),this.audio.autoplay=!0,this.logger=t.__internals__.logger,this.audioStream=new MediaStream,this.audio.srcObject=this.audioStream,this.audioTracks=[]}addTrack(t,i){this.audioTracks.some((i=>i.id===t))||(this.audioTracks.push({id:t,track:i}),this.audioStream.addTrack(i),this.play())}removeTrack(t){const i=this.audioTracks.find((i=>i.id===t));null!=i&&(this.audioStream.removeTrack(i.track),this.audioTracks=this.audioTracks.filter((i=>i.id!==t)))}async play(){var t;this.audio.srcObject=this.audioStream,await(null===(t=this.audio.play())||void 0===t?void 0:t.catch((t=>{"NotAllowedError"===t.name?null!=this._onError&&this._onError():"AbortError"!==t.name&&this.logger.error("[rtk-audio] play() error\n",t)})))}async setDevice(t){var i,a,s;e(this.meeting)||await(null===(s=null===(a=(i=this.audio).setSinkId)||void 0===a?void 0:a.call(i,t))||void 0===s?void 0:s.catch((t=>{this.logger.error("[rtk-audio] setSinkId() error\n",t)})))}onError(t){this._onError=t}}var c=function(t,i,a,s){var e,r=arguments.length,o=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,a):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,a,s);else for(var h=t.length-1;h>=0;h--)(e=t[h])&&(o=(r<3?e(o):r>3?e(i,a,o):e(i,a))||o);return r>3&&o&&Object.defineProperty(i,a,o),o};const l=class{constructor(a){t(this,a),this.dialogClose=i(this,"dialogClose",7),this.iconPack=r,this.t=o(),this.preloadedAudioElem=void 0,this.showPlayDialog=!1,this.onRtkDialogClose=()=>{this.showPlayDialog=!1,this.dialogClose.emit()}}componentDidLoad(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null!=this.meeting&&(this.audioUpdateListener&&this.meeting.participants.joined.removeListener("audioUpdate",this.audioUpdateListener),this.screenShareUpdateListener&&this.meeting.participants.joined.removeListener("screenShareUpdate",this.screenShareUpdateListener),this.participantLeftListener&&this.meeting.participants.joined.removeListener("participantLeft",this.participantLeftListener),this.deviceUpdateListener&&this.meeting.self.removeListener("deviceUpdate",this.deviceUpdateListener),this.stageStatusUpdateListener&&(null===(t=this.meeting.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)))}async setupAudio(){this.audio=new n(this.meeting,this.preloadedAudioElem);const t=this.meeting.self.getCurrentDevices();null!=t.speaker&&await this.audio.setDevice(t.speaker.deviceId)}async handleAutoPlayError(){this.audio||await this.setupAudio(),this.audio.onError((()=>{this.showPlayDialog=!0})),this.audio.play()}async handleEvents(t){this.audioUpdateListener=({id:t,audioEnabled:i,audioTrack:a})=>{const s=`audio-${t}`;i&&null!=a?this.audio.addTrack(s,a):this.audio.removeTrack(s)};const i=t.participants.joined.toArray();for(const t of i)this.audioUpdateListener(t);this.participantLeftListener=({id:t})=>{this.audio.removeTrack(`audio-${t}`),this.audio.removeTrack(`screenshare-${t}`)},this.screenShareUpdateListener=({id:t,screenShareEnabled:i,screenShareTracks:a})=>{const s=`screenshare-${t}`;i&&null!=a.audio?this.audio.addTrack(s,a.audio):this.audio.removeTrack(s)},this.deviceUpdateListener=({device:t,preview:i})=>{i||"audiooutput"===t.kind&&this.audio.setDevice(t.deviceId)},t.participants.joined.addListener("audioUpdate",this.audioUpdateListener),t.participants.joined.addListener("screenShareUpdate",this.screenShareUpdateListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener),t.self.addListener("deviceUpdate",this.deviceUpdateListener)}async meetingChanged(t){var i;null!=t&&(this.setupAudio(),h(t)?(this.stageStatusUpdateListener=async t=>{"ON_STAGE"===t&&await this.handleAutoPlayError()},null===(i=t.stage)||void 0===i||i.on("stageStatusUpdate",this.stageStatusUpdateListener)):await this.handleAutoPlayError(),await this.handleEvents(t))}render(){return a(s,{key:"8f6ac797ceb5f3fa6c8633e72174e9ae91e7979a"},this.showPlayDialog&&a("rtk-dialog",{key:"d1f5723dec7d7e9e66625deb9cebce63e26520e1",open:!0,onRtkDialogClose:this.onRtkDialogClose,hideCloseButton:!0,disableEscapeKey:!0,iconPack:this.iconPack,t:this.t},a("div",{key:"cd0de80766e3f1c665666f463bf405f44ed8323d",class:"modal"},a("h3",{key:"098d978b8c3aeba86328e23104fa7e73f12f2296"},this.t("audio_playback.title")),a("p",{key:"74d242093687ab9734392a8d5357c7a2c5cce8b9"},this.t("audio_playback.description")),a("rtk-button",{key:"6382f33f9b3907989c5559c49091f2173be708e3",kind:"wide",onClick:()=>{this.audio.play(),this.onRtkDialogClose()},title:this.t("audio_playback")},this.t("audio_playback")))))}static get watchers(){return{meeting:["meetingChanged"]}}};c([d()],l.prototype,"meeting",void 0),c([d()],l.prototype,"iconPack",void 0),c([d()],l.prototype,"t",void 0),l.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;overflow-wrap:break-word;color:rgb(var(--rtk-colors-text-1000, 255 255 255));word-wrap:break-word}.modal{box-sizing:border-box;width:100%;max-width:var(--rtk-space-96, 384px);padding:var(--rtk-space-4, 16px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.modal h3{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px);font-size:24px;font-weight:500}.modal p{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-6, 24px)}.modal rtk-button{width:100%}";export{l as rtk_participants_audio}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as s}from"./p-ee167b96.js";const t={joined:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",left:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",message:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_message.mp3"};class o{constructor(s){this.meeting=s,this.audio=document.createElement("audio"),this.audio.volume=.3}play(s,o=3e3){var i;this.playing||(this.playing=!0,this.audio.src=t[s],this.audio.volume=.3,null===(i=this.audio.play())||void 0===i||i.catch((()=>{})),setTimeout((()=>{this.playing=!1}),o))}async setDevice(t){var o,i,a;s(this.meeting)||await(null===(a=null===(i=null===(o=this.audio)||void 0===o?void 0:o.setSinkId)||void 0===i?void 0:i.call(o,t))||void 0===a?void 0:a.catch((()=>{})))}}export{o as R}
|