@livedigital/client 3.31.0-decoder-issue-detector.1 → 3.31.1

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@livedigital/client",
3
3
  "author": "vlprojects",
4
4
  "license": "MIT",
5
- "version": "3.31.0-decoder-issue-detector.1",
5
+ "version": "3.31.1",
6
6
  "private": false,
7
7
  "bugs": {
8
8
  "url": "https://github.com/vlprojects/livedigital-sdk/issues"
@@ -57,7 +57,7 @@
57
57
  "reflect-metadata": "^0.2.2",
58
58
  "serialize-error": "^7.0.1",
59
59
  "socket.io-client": "^4.7.2",
60
- "webrtc-issue-detector": "1.14.0-decoder-issue-detector.2"
60
+ "webrtc-issue-detector": "^1.13.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@rollup/plugin-commonjs": "^19.0.0",
@@ -493,10 +493,10 @@ class Peer {
493
493
  });
494
494
  }
495
495
 
496
- reset() {
496
+ async reset(): Promise<void> {
497
497
  this.producers.clear();
498
498
 
499
- this.tracks.forEach((x) => x.close());
499
+ await Promise.all(Array.from(this.tracks.values()).map((track) => track.close()));
500
500
  this.tracks.clear();
501
501
 
502
502
  const eventNames = [
@@ -18,11 +18,11 @@ import PeerConsumer from './PeerConsumer';
18
18
  export interface IPeersService {
19
19
  has(id: Peer['id']): boolean;
20
20
  get(id: Peer['id']): Peer | undefined;
21
- remove(id: Peer['id']): void;
21
+ remove(id: Peer['id']): Promise<void>;
22
22
  all(): Peer[];
23
23
  hosts(): Peer[];
24
24
  audience(): Peer[];
25
- reset(): void;
25
+ reset(): Promise<void>;
26
26
  load(role?: Role): Promise<void>;
27
27
  add(peerData: PeerResponse, emit: boolean): Peer;
28
28
  isModerator(id: Peer['id'] | undefined): boolean;
@@ -82,14 +82,13 @@ export class Peers implements IPeersService {
82
82
  return this.peersStorage.delete(id);
83
83
  }
84
84
 
85
- remove(id: Peer['id']) {
85
+ async remove(id: Peer['id']): Promise<void> {
86
86
  const peer = this.get(id);
87
87
  if (!peer) {
88
88
  return;
89
89
  }
90
90
 
91
- peer.tracks.forEach((track) => track.close());
92
- peer.reset();
91
+ await peer.reset();
93
92
 
94
93
  this.delete(id);
95
94
  this.clientEventEmitter.safeEmit(CLIENT_EVENTS.peerLeft, id);
@@ -111,8 +110,8 @@ export class Peers implements IPeersService {
111
110
  .filter((peer) => peer.role === 'audience');
112
111
  }
113
112
 
114
- reset() {
115
- this.peersStorage.forEach((x) => x.reset());
113
+ async reset(): Promise<void> {
114
+ await Promise.all(Array.from(this.peersStorage.values()).map((track) => track.reset()));
116
115
  this.peersStorage.clear();
117
116
  }
118
117
 
@@ -182,7 +182,7 @@ class Engine {
182
182
  this.myPeer.delete();
183
183
  this.webRtcIssueDetector?.stopWatchingNewPeerConnections();
184
184
 
185
- this.peers.reset();
185
+ await this.peers.reset();
186
186
 
187
187
  await this.network.closeSendTransport();
188
188
  await this.network.closeReceiveTransport();
@@ -274,8 +274,8 @@ class Engine {
274
274
  return this.peers.add(peerData, emit);
275
275
  }
276
276
 
277
- public removePeer(peerId: string): void {
278
- this.peers.remove(peerId);
277
+ public async removePeer(peerId: string): Promise<void> {
278
+ return this.peers.remove(peerId);
279
279
  }
280
280
 
281
281
  public async updateAppData(appData: Record<string, unknown>): Promise<void> {
@@ -1,24 +1,17 @@
1
+ import type { Container } from 'pixi.js';
2
+
3
+ import { Options as sdkOptions } from '../Options';
4
+
1
5
  type Options = {
2
6
  [key: string]: any;
3
7
  };
4
-
5
- export interface ComponentPosition {
6
- x: number;
7
- y: number;
8
- placement: ComponentPlacement;
9
- }
10
-
11
- export type ComponentPlacement =
12
- | 'top-left'
13
- | 'bottom-left'
14
- | 'center'
15
- | 'top-right'
16
- | 'bottom-right'
17
- | 'custom';
18
-
19
8
  export declare abstract class Component {
9
+ container: Container;
10
+
20
11
  protected options: Options;
21
12
 
13
+ protected sdkOptions: sdkOptions;
14
+
22
15
  private afterShowFunction;
23
16
 
24
17
  private beforeShowFunction;
@@ -26,7 +19,7 @@ export declare abstract class Component {
26
19
  private beforeHideFunction;
27
20
 
28
21
  private afterHideFunction;
29
- constructor(options?: Options);
22
+ constructor(sdkOptions: sdkOptions, options?: Options);
30
23
  setOptions(options?: Options): void;
31
24
  show(): void;
32
25
  hide(): void;
@@ -1,10 +1,9 @@
1
- import { Component } from '../component';
1
+ import { Component } from '@/components/component';
2
+ import { Options as sdkOptions } from '@/Options';
2
3
 
3
4
  interface CountdownOptions {
4
5
  countDown: number;
5
6
  }
6
-
7
- // eslint-disable-next-line import/prefer-default-export
8
7
  export declare class CountdownComponent extends Component {
9
8
  options: CountdownOptions;
10
9
 
@@ -16,7 +15,7 @@ export declare class CountdownComponent extends Component {
16
15
 
17
16
  private showRejecter;
18
17
 
19
- constructor(options?: CountdownOptions);
18
+ constructor(sdkOptions: sdkOptions, options?: CountdownOptions);
20
19
  render(): void;
21
20
  setOptions(options?: CountdownOptions): void;
22
21
  private drawRect;
@@ -25,5 +24,4 @@ export declare class CountdownComponent extends Component {
25
24
  showCountdown(): Promise<any>;
26
25
  hideCountdown(): void;
27
26
  }
28
-
29
27
  export {};
@@ -1,10 +1,7 @@
1
1
  import type {
2
- Graphics,
3
- Text,
4
- Ticker,
5
- TickerCallback,
2
+ Graphics, Text, Ticker, TickerCallback,
6
3
  } from 'pixi.js';
7
-
4
+ import { Options as sdkOptions } from '@/Options';
8
5
  import { Component } from '../component';
9
6
 
10
7
  export interface LtOptions {
@@ -59,7 +56,7 @@ export declare abstract class LowerThird extends Component {
59
56
 
60
57
  options: Required<LtOptions>;
61
58
 
62
- constructor(options?: LtOptions);
59
+ constructor(sdkOptions: sdkOptions, options?: LtOptions);
63
60
  render(): void;
64
61
  setOptions(options?: LtOptions, render?: boolean): void;
65
62
  showLowerThird(): void;
@@ -1,9 +1,6 @@
1
- import { Component } from '../component';
1
+ import { Component } from '@/components/component';
2
+ import { Options as sdkOptions } from '@/Options';
2
3
 
3
- interface Options {
4
- url: string;
5
- promise?: PromiseContainer;
6
- }
7
4
  interface PromiseContainer {
8
5
  resolve: Function;
9
6
  reject: Function;
@@ -27,13 +24,13 @@ export declare class OverlayScreen extends Component {
27
24
 
28
25
  private processedURL;
29
26
 
30
- constructor(options?: OverlayScreenOptions);
27
+ constructor(sdkOptions: sdkOptions, options?: OverlayScreenOptions);
31
28
  render(): void;
32
29
  show(): void;
33
30
  hide(): void;
34
31
  private initOverlayFromUrl;
35
32
 
36
- setOptions(o: Options): Promise<void>;
33
+ setOptions(o: OverlayScreenOptions): Promise<void>;
37
34
  private setOverlayImage;
38
35
 
39
36
  private loadImage;
@@ -0,0 +1,10 @@
1
+ import type { Sprite, SpriteSource } from 'pixi.js';
2
+
3
+ export declare class OverlaySprite {
4
+ sprite: Sprite;
5
+
6
+ ratio: number;
7
+
8
+ constructor(source: SpriteSource, width?: number, height?: number);
9
+ destroy(): void;
10
+ }
@@ -1,5 +1,6 @@
1
1
  import Player from 'apng-js/types/library/player';
2
2
  import type { Sprite } from 'pixi.js';
3
+ import { Options as sdkOptions } from '@/Options';
3
4
 
4
5
  interface StickerSpriteOptions {
5
6
  sprite: Sprite;
@@ -10,7 +11,6 @@ interface StickerSpriteOptions {
10
11
  aminationPhase?: 'showing' | 'static' | 'hiding';
11
12
  shrink: number;
12
13
  }
13
- // eslint-disable-next-line import/prefer-default-export
14
14
  export declare class StickerSprite {
15
15
  private shrink;
16
16
 
@@ -32,7 +32,9 @@ export declare class StickerSprite {
32
32
 
33
33
  private sourceRatio;
34
34
 
35
- constructor(options: StickerSpriteOptions);
35
+ private sdkOptions;
36
+
37
+ constructor(sdkOptions: sdkOptions, options: StickerSpriteOptions);
36
38
  private isShowing;
37
39
 
38
40
  private isStatic;
@@ -1,4 +1,5 @@
1
- import { ComponentPosition, Component } from '../component';
1
+ import { Component } from '@/components/component';
2
+ import { Options as sdkOptions } from '@/Options';
2
3
 
3
4
  export interface StickerOptions {
4
5
  capacity: number;
@@ -32,7 +33,7 @@ export declare class Stickers extends Component {
32
33
 
33
34
  private loadErrorFunc?;
34
35
 
35
- constructor(options?: Partial<StickerOptions>);
36
+ constructor(sdkOptions: sdkOptions, options?: Partial<StickerOptions>);
36
37
  show(): void;
37
38
  hide(): void;
38
39
  onLoadSucccess(f?: Function): void;
@@ -1,13 +1,9 @@
1
- import { ComponentPosition } from '../component';
2
-
3
1
  interface SizeData {
4
2
  width: number;
5
3
  height: number;
6
4
  }
7
-
8
- // eslint-disable-next-line import/prefer-default-export
9
5
  export declare class PositionHelper {
10
- static calcPosition(position: ComponentPosition, size: SizeData): {
6
+ static calcPosition(_width: number, _height: number, position: ComponentPosition, size: SizeData): {
11
7
  x: number;
12
8
  y: number;
13
9
  };
@@ -1,4 +1,5 @@
1
- import { ComponentPosition, Component } from '../component';
1
+ import { Component } from '../component';
2
+ import { Options as sdkOptions } from '@/Options';
2
3
 
3
4
  export interface WatermarkOptions {
4
5
  url: string;
@@ -9,7 +10,7 @@ export declare class Watermark extends Component {
9
10
  protected options: WatermarkOptions;
10
11
 
11
12
  private sprite;
12
- constructor(options: Partial<WatermarkOptions>);
13
+ constructor(sdkOptions: sdkOptions, options: Partial<WatermarkOptions>);
13
14
  setOptions(options?: WatermarkOptions): void;
14
15
  setURL(url: string): Promise<void>;
15
16
  setSize(size: number): void;
@@ -1,8 +1,9 @@
1
1
  /* eslint-disable max-len */
2
2
  import { FrameFormat } from './renderer/renderer';
3
3
  import type { ColorFilterConfig } from './effects/color-filter/colorFilterEffect';
4
- import { LayoutMode } from './effects/virtual-background/virtual_background_effect';
4
+ import { BackgroundSource, LayoutMode } from './effects/virtual-background/virtual_background_effect';
5
5
  import type { LowLightConfig } from './effects/low-light/lowLightEffect';
6
+ import { FaceCombiner } from './effects/smart-zoom/faceCombiner';
6
7
  import { EffectProcessor } from './effects/effect_processor';
7
8
  import { OverlayScreen, OverlayScreenOptions } from './components/overlay-screen/overlayScreen';
8
9
  import { Watermark, WatermarkOptions } from './components/watermark/watermark';
@@ -15,6 +16,8 @@ import { LtDoubleSlideRect } from './components/lower-third/collection/doubleSli
15
16
  import { LtTwoSlideRects } from './components/lower-third/collection/twoSideRects/twoSlideRects';
16
17
  import { ErrorObject } from './utils/errorBus';
17
18
  import { IRecorder } from './entities/recorder';
19
+ import { Options as sdkOptions } from '@/Options';
20
+ import type { SharpnessConfig } from './effects/sharpness/sharpnessEffect';
18
21
 
19
22
  type ResizeSettings = {
20
23
  width: number;
@@ -23,6 +26,8 @@ type ResizeSettings = {
23
26
 
24
27
  // eslint-disable-next-line import/prefer-default-export, @typescript-eslint/naming-convention
25
28
  export declare class tsvb {
29
+ #private;
30
+
26
31
  private callbackStore;
27
32
 
28
33
  private streamProcessor;
@@ -47,6 +52,14 @@ export declare class tsvb {
47
52
 
48
53
  private lowLightEffect;
49
54
 
55
+ private sharpnessEffect;
56
+
57
+ private filterDrawEffect;
58
+
59
+ private mirroringEffect;
60
+
61
+ private finalDrawEffect;
62
+
50
63
  components: any;
51
64
 
52
65
  recorder: IRecorder;
@@ -56,15 +69,12 @@ export declare class tsvb {
56
69
  customer_id: string;
57
70
 
58
71
  constructor(customer_id: string, inference?: any);
59
-
60
72
  private onOptionsUpdate;
61
73
 
62
74
  cache(clear?: boolean): Promise<void>;
63
75
  preload(): Promise<void>;
64
76
  config(config: any): void;
65
-
66
77
  private init;
67
-
68
78
  getCustomerId(): string;
69
79
  useStream(stream: MediaStream, resize?: ResizeSettings): void;
70
80
  setSegmentationPreset(preset: string): Promise<boolean>;
@@ -85,7 +95,7 @@ export declare class tsvb {
85
95
  setBeautificationLevel(level: number): boolean;
86
96
  setBlur(power: number): boolean;
87
97
  clearBlur(): boolean;
88
- setBackground(url: string | MediaStream | MediaStreamTrack | HTMLVideoElement): boolean;
98
+ setBackground(url: BackgroundSource): boolean;
89
99
  clearBackground(): boolean;
90
100
  enableFrameSkipping(): boolean;
91
101
  disableFrameSkipping(): boolean;
@@ -98,16 +108,18 @@ export declare class tsvb {
98
108
  }): boolean;
99
109
  setFaceArea(value: number): boolean;
100
110
  setFaceDetectorAccuracy(value: number): boolean;
111
+ getDetectedFaces(): FaceCombiner[];
101
112
  setSmartZoomSmoothing(steps: number): boolean;
102
113
  setSmartZoomSensitivity(value: number): boolean;
103
114
  setSmartZoomPerod(value: number): boolean;
104
115
  switchDrawFaceSquare(isOn: boolean): boolean;
105
116
  switchDrawPreFaceSquare(isOn: boolean): boolean;
106
117
  enableSmartZoom(): boolean;
107
- enableSharpnessEffect(): boolean;
108
118
  disableSmartZoom(): boolean;
109
119
  enableColorCorrector(): boolean;
110
120
  disableColorCorrector(): boolean;
121
+ enableMirroring(): boolean;
122
+ disableMirroring(): boolean;
111
123
  enableColorFilter(): boolean;
112
124
  disableColorFilter(): boolean;
113
125
  setColorFilterConfig(config: Partial<ColorFilterConfig>): boolean;
@@ -118,6 +130,9 @@ export declare class tsvb {
118
130
  disableLowLightEffect(): boolean;
119
131
  setLowLightEffectConfig(config: Partial<LowLightConfig>): boolean;
120
132
  setLowLightEffectPower(value: number): boolean;
133
+ enableSharpnessEffect(): boolean;
134
+ disableSharpnessEffect(): boolean;
135
+ setSharpnessEffectConfig(config: Partial<SharpnessConfig>): boolean;
121
136
  clear(): boolean;
122
137
  run(): boolean;
123
138
  stop(): boolean;
@@ -146,8 +161,6 @@ export declare class tsvb {
146
161
  onAuthRequest(f?: (url: string, payload: Object) => Promise<string>): void;
147
162
  onColorFilterSuccess(f?: (id: string) => void): void;
148
163
  onLowLightSuccess(f?: () => void): void;
149
- setSharpnessEffectConfig(value: number): boolean;
150
- disableSharpnessEffect(): boolean;
151
164
  }
152
165
  declare const componentsMap: {
153
166
  overlay_screen: typeof OverlayScreen;
@@ -177,6 +190,6 @@ type SingleKey<K> = [K] extends (K extends Keys ? [K] : never) ? K : never;
177
190
  type ClassType<A extends Keys> = Extract<Tuples<Keys>, [A, any]>[1];
178
191
  interface ComponentArguments<K extends Keys> {
179
192
  component: SingleKey<K>;
180
- options: K extends OptionsKeys ? Partial<OptionsMap[K]> : never;
193
+ options?: K extends OptionsKeys ? Partial<OptionsMap[K]> : never;
181
194
  }
182
195
  export {};
@@ -2,6 +2,7 @@ import { Container, interfaces } from 'inversify';
2
2
  import WebRTCIssueDetector, {
3
3
  AvailableOutgoingBitrateIssueDetector,
4
4
  CompositeRTCStatsParser,
5
+ FramesDroppedIssueDetector,
5
6
  FramesEncodedSentIssueDetector,
6
7
  FrozenVideoTrackDetector,
7
8
  InboundNetworkIssueDetector,
@@ -17,7 +18,6 @@ import WebRTCIssueDetector, {
17
18
  RTCStatsParser,
18
19
  UnknownVideoDecoderImplementationDetector,
19
20
  WebRTCIssueEmitter,
20
- VideoDecoderIssueDetector,
21
21
  } from 'webrtc-issue-detector';
22
22
  import ConfigService from './config/ConfigService';
23
23
  import Engine from './engine';
@@ -236,6 +236,7 @@ container
236
236
  networkScoresCalculator: new NetworkScoresCalculator(),
237
237
  detectors: [
238
238
  new QualityLimitationsIssueDetector(),
239
+ new FramesDroppedIssueDetector(),
239
240
  new FramesEncodedSentIssueDetector(),
240
241
  new InboundNetworkIssueDetector(),
241
242
  new OutboundNetworkIssueDetector(),
@@ -243,7 +244,6 @@ container
243
244
  new AvailableOutgoingBitrateIssueDetector(),
244
245
  new UnknownVideoDecoderImplementationDetector(),
245
246
  new FrozenVideoTrackDetector(),
246
- new VideoDecoderIssueDetector(),
247
247
  ],
248
248
  statsReporter: new PeriodicWebRTCStatsReporter({
249
249
  compositeStatsParser,