@snapcall/stream-ui 1.6.0 → 1.8.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.
@@ -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;
@@ -316,6 +327,9 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
316
327
  isVideoZoomAvailable(): boolean;
317
328
  handleGetUserMediaError(deviceType: DeviceType, getUserMediaPromise: Promise<MediaStream>): Promise<MediaStream>;
318
329
  restartIce(transport: Transport): Promise<void>;
330
+ setVideoBackground(options: MediapipeOptions): void;
331
+ initVideoBackground(): Promise<void>;
332
+ stopVideoBackground(): Promise<void>;
319
333
  switchWebcam({ device, resolution, rotate, }: {
320
334
  device?: MediaDeviceInfo;
321
335
  resolution?: VideoResolution;
@@ -410,8 +424,14 @@ interface SendNotificationOptions extends Omit<NotificationOptions, 'button'> {
410
424
  duration?: number;
411
425
  }
412
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;
413
432
  interface StreamUIMethods {
414
433
  init: (options: StreamUIInitOptions) => void;
434
+ initGreeting: (e: HTMLElement, onGreetingDone: OnGreetingDoneSignature) => void;
415
435
  setExtraSettingsOptions: (extraOptions: SettingsCategory[]) => void;
416
436
  sendNotification: typeof sendNotification;
417
437
  joinRoom: typeof streamerClient.init;
@@ -432,7 +452,7 @@ interface ControlSettings {
432
452
  interface StreamUIBaseOptions {
433
453
  sharedURL?: string;
434
454
  audioTiles?: boolean;
435
- settingsShortcuts?: string[];
455
+ settingsShortcuts?: Array<SettingShortcut>;
436
456
  extraSettingsOptions?: SettingsCategory[];
437
457
  controls?: {
438
458
  microphone?: ControlSettings;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcall/stream-ui",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/stream-ui.js",
@@ -69,6 +69,7 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@hotjar/browser": "^1.0.6",
72
+ "@mediapipe/selfie_segmentation": "^0.1.1632777926",
72
73
  "@sentry/browser": "^7.0.0",
73
74
  "@types/youtube": "^0.0.47",
74
75
  "bowser": "^2.11.0",