@snapcall/stream-ui 1.5.0 → 1.7.0
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/README.md +3 -2
- package/dist/stream-ui.esm.js +1655 -211
- package/dist/stream-ui.js +1664 -220
- package/dist/stream-ui.umd.js +705 -249
- package/dist/timer.2f4f9ac0.js +1 -0
- package/dist/timer.370d0e5a.js +13 -0
- package/dist/timer.7690fc0b.js +12 -0
- package/dist/types.d.ts +27 -2
- package/package.json +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{let e;self.onmessage=s=>{const{action:a,params:t}=s.data;"start"===a&&(e&&clearInterval(e),e=self.setInterval((()=>{self.postMessage("time")}),1e3/t))}})();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
let $7df5a1066adc9830$var$interval;
|
|
3
|
+
self.onmessage = (event)=>{
|
|
4
|
+
const { action: action , params: params } = event.data;
|
|
5
|
+
if (action === "start") {
|
|
6
|
+
if ($7df5a1066adc9830$var$interval) clearInterval($7df5a1066adc9830$var$interval);
|
|
7
|
+
$7df5a1066adc9830$var$interval = self.setInterval(()=>{
|
|
8
|
+
self.postMessage("time");
|
|
9
|
+
}, 1000 / params);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
})();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
let $febe13af234b7734$var$interval;
|
|
2
|
+
self.onmessage = (event)=>{
|
|
3
|
+
const { action: action , params: params } = event.data;
|
|
4
|
+
if (action === "start") {
|
|
5
|
+
if ($febe13af234b7734$var$interval) clearInterval($febe13af234b7734$var$interval);
|
|
6
|
+
$febe13af234b7734$var$interval = self.setInterval(()=>{
|
|
7
|
+
self.postMessage("time");
|
|
8
|
+
}, 1000 / params);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
|
package/dist/types.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ interface MenuCategory {
|
|
|
17
17
|
title?: string;
|
|
18
18
|
items: MenuItem[];
|
|
19
19
|
}
|
|
20
|
+
type DisplayType = 'icon' | 'full';
|
|
21
|
+
interface SettingShortcut {
|
|
22
|
+
id: string;
|
|
23
|
+
displayType: DisplayType;
|
|
24
|
+
}
|
|
20
25
|
interface SettingsCategory extends MenuCategory {
|
|
21
26
|
position?: number;
|
|
22
27
|
items: SettingsItem[];
|
|
@@ -131,6 +136,12 @@ declare class AudioRenderer {
|
|
|
131
136
|
getSink(): string | undefined;
|
|
132
137
|
play(): Promise<void>;
|
|
133
138
|
}
|
|
139
|
+
interface MediapipeOptions {
|
|
140
|
+
type: 'blur' | 'background';
|
|
141
|
+
fillColor?: string;
|
|
142
|
+
background?: CanvasImageSource;
|
|
143
|
+
blurLevel?: number;
|
|
144
|
+
}
|
|
134
145
|
interface DeviceRequest {
|
|
135
146
|
requestId: string;
|
|
136
147
|
deviceType: DeviceType;
|
|
@@ -204,6 +215,10 @@ declare global {
|
|
|
204
215
|
resolution: VideoResolution;
|
|
205
216
|
};
|
|
206
217
|
}>;
|
|
218
|
+
type AgentIdentityEvent = SnapcallEvent<{
|
|
219
|
+
success: boolean;
|
|
220
|
+
email?: string;
|
|
221
|
+
}>;
|
|
207
222
|
}
|
|
208
223
|
}
|
|
209
224
|
interface StreamerEventMap {
|
|
@@ -215,7 +230,7 @@ interface StreamerEventMap {
|
|
|
215
230
|
localVideoUnavailable: SnapCall.BaseEvent['detail'];
|
|
216
231
|
localVideoAvailable: SnapCall.BaseEvent['detail'];
|
|
217
232
|
microphoneEnabled: SnapCall.BaseEvent['detail'];
|
|
218
|
-
agentIdentity: SnapCall.
|
|
233
|
+
agentIdentity: SnapCall.AgentIdentityEvent['detail'];
|
|
219
234
|
peerClosed: SnapCall.StreamEvent['detail'];
|
|
220
235
|
newPeer: SnapCall.PeerInfoEvent['detail'];
|
|
221
236
|
selfDisplayName: SnapCall.PeerInfoEvent['detail'];
|
|
@@ -312,6 +327,9 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
|
|
|
312
327
|
isVideoZoomAvailable(): boolean;
|
|
313
328
|
handleGetUserMediaError(deviceType: DeviceType, getUserMediaPromise: Promise<MediaStream>): Promise<MediaStream>;
|
|
314
329
|
restartIce(transport: Transport): Promise<void>;
|
|
330
|
+
setVideoBackground(options: MediapipeOptions): void;
|
|
331
|
+
initVideoBackground(): Promise<void>;
|
|
332
|
+
stopVideoBackground(): Promise<void>;
|
|
315
333
|
switchWebcam({ device, resolution, rotate, }: {
|
|
316
334
|
device?: MediaDeviceInfo;
|
|
317
335
|
resolution?: VideoResolution;
|
|
@@ -406,8 +424,14 @@ interface SendNotificationOptions extends Omit<NotificationOptions, 'button'> {
|
|
|
406
424
|
duration?: number;
|
|
407
425
|
}
|
|
408
426
|
declare const sendNotification: (message: string, options?: SendNotificationOptions) => void;
|
|
427
|
+
type OnGreetingDoneSignature = ({ cameraEnabled, micEnabled, displayName, }: {
|
|
428
|
+
cameraEnabled?: boolean;
|
|
429
|
+
micEnabled?: boolean;
|
|
430
|
+
displayName?: string;
|
|
431
|
+
}) => void;
|
|
409
432
|
interface StreamUIMethods {
|
|
410
433
|
init: (options: StreamUIInitOptions) => void;
|
|
434
|
+
initGreeting: (e: HTMLElement, onGreetingDone: OnGreetingDoneSignature) => void;
|
|
411
435
|
setExtraSettingsOptions: (extraOptions: SettingsCategory[]) => void;
|
|
412
436
|
sendNotification: typeof sendNotification;
|
|
413
437
|
joinRoom: typeof streamerClient.init;
|
|
@@ -428,7 +452,7 @@ interface ControlSettings {
|
|
|
428
452
|
interface StreamUIBaseOptions {
|
|
429
453
|
sharedURL?: string;
|
|
430
454
|
audioTiles?: boolean;
|
|
431
|
-
settingsShortcuts?:
|
|
455
|
+
settingsShortcuts?: Array<SettingShortcut>;
|
|
432
456
|
extraSettingsOptions?: SettingsCategory[];
|
|
433
457
|
controls?: {
|
|
434
458
|
microphone?: ControlSettings;
|
|
@@ -442,6 +466,7 @@ interface StreamUIBaseOptions {
|
|
|
442
466
|
showMenuButton?: boolean;
|
|
443
467
|
GDPRDisclaimer?: boolean;
|
|
444
468
|
streamApiURL?: string;
|
|
469
|
+
tracking?: boolean;
|
|
445
470
|
language?: string;
|
|
446
471
|
}
|
|
447
472
|
interface StreamUIInitOptions extends StreamUIBaseOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snapcall/stream-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"main": "dist/stream-ui.js",
|
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
"typescript": "^4.7.2"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
+
"@mediapipe/selfie_segmentation": "^0.1.1632777926",
|
|
72
|
+
"@hotjar/browser": "^1.0.6",
|
|
71
73
|
"@sentry/browser": "^7.0.0",
|
|
72
74
|
"@types/youtube": "^0.0.47",
|
|
73
75
|
"bowser": "^2.11.0",
|