@stream-io/video-react-sdk 1.26.1 → 1.27.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.
@@ -1,5 +1,35 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { BackgroundBlurLevel, BackgroundFilter, PlatformSupportFlags } from '@stream-io/video-filters-web';
3
+ /**
4
+ * Configuration for performance metric thresholds.
5
+ */
6
+ export type BackgroundFiltersPerformanceThresholds = {
7
+ /**
8
+ * The lower FPS threshold for triggering a performance warning.
9
+ * When the EMA FPS falls below this value, a warning is shown.
10
+ * @default 23
11
+ */
12
+ fpsWarningThresholdLower?: number;
13
+ /**
14
+ * The upper FPS threshold for clearing a performance warning.
15
+ * When the EMA FPS rises above this value, the warning is cleared.
16
+ * @default 25
17
+ */
18
+ fpsWarningThresholdUpper?: number;
19
+ /**
20
+ * The default FPS value used as the initial value for the EMA (Exponential Moving Average)
21
+ * calculation and when stats are unavailable or when resetting the filter.
22
+ * @default 30
23
+ */
24
+ defaultFps?: number;
25
+ };
26
+ /**
27
+ * Represents the possible reasons for background filter performance degradation.
28
+ */
29
+ export declare enum PerformanceDegradationReason {
30
+ FRAME_DROP = "frame-drop",
31
+ CPU_THROTTLING = "cpu-throttling"
32
+ }
3
33
  export type BackgroundFiltersProps = PlatformSupportFlags & {
4
34
  /**
5
35
  * A list of URLs to use as background images.
@@ -21,7 +51,7 @@ export type BackgroundFiltersProps = PlatformSupportFlags & {
21
51
  backgroundBlurLevel?: BackgroundBlurLevel;
22
52
  /**
23
53
  * The base path for the TensorFlow Lite files.
24
- * @default 'https://unpkg.com/@stream-io/video-filters-web/tf'.
54
+ * @default 'https://unpkg.com/@stream-io/video-filters-web/mediapipe'.
25
55
  */
26
56
  basePath?: string;
27
57
  /**
@@ -32,18 +62,46 @@ export type BackgroundFiltersProps = PlatformSupportFlags & {
32
62
  */
33
63
  tfFilePath?: string;
34
64
  /**
35
- * The path to the TensorFlow Lite model file.
36
- * Override this prop to use a custom path to the TensorFlow Lite model file
65
+ * The path to the MediaPipe model file.
66
+ * Override this prop to use a custom path to the MediaPipe model file
37
67
  * (e.g., if you choose to host it yourself).
38
68
  */
39
69
  modelFilePath?: string;
70
+ /**
71
+ * When true, the filter uses the legacy TensorFlow-based segmentation model.
72
+ * When false, it uses the default MediaPipe Tasks Vision model.
73
+ *
74
+ * Only enable this if you need to mimic the behavior of older SDK versions.
75
+ */
76
+ useLegacyFilter?: boolean;
40
77
  /**
41
78
  * When a started filter encounters an error, this callback will be executed.
42
79
  * The default behavior (not overridable) is unregistering a failed filter.
43
- * Use this callback to display UI error message, disable the corresponsing stream,
80
+ * Use this callback to display UI error message, disable the corresponding stream,
44
81
  * or to try registering the filter again.
45
82
  */
46
83
  onError?: (error: any) => void;
84
+ /**
85
+ * Configuration for performance metric thresholds.
86
+ * Use this to customize when performance warnings are triggered.
87
+ */
88
+ performanceThresholds?: BackgroundFiltersPerformanceThresholds;
89
+ };
90
+ /**
91
+ * Performance degradation information for background filters.
92
+ *
93
+ * Performance is calculated using an Exponential Moving Average (EMA) of FPS values
94
+ * to smooth out quick spikes and provide stable performance warnings.
95
+ */
96
+ export type BackgroundFiltersPerformance = {
97
+ /**
98
+ * Whether performance is currently degraded.
99
+ */
100
+ degraded: boolean;
101
+ /**
102
+ * Reasons for performance degradation.
103
+ */
104
+ reason?: Array<PerformanceDegradationReason>;
47
105
  };
48
106
  export type BackgroundFiltersAPI = {
49
107
  /**
@@ -54,6 +112,10 @@ export type BackgroundFiltersAPI = {
54
112
  * Indicates whether the background filters engine is loaded and ready.
55
113
  */
56
114
  isReady: boolean;
115
+ /**
116
+ * Performance information for background filters.
117
+ */
118
+ performance: BackgroundFiltersPerformance;
57
119
  /**
58
120
  * Disables all background filters applied to the video.
59
121
  */
@@ -7,5 +7,7 @@ export declare const DeviceSelectorAudioInput: ({ title, visualType, volumeIndic
7
7
  export type DeviceSelectorAudioOutputProps = {
8
8
  title?: string;
9
9
  visualType?: 'list' | 'dropdown';
10
+ speakerTestVisible?: boolean;
11
+ speakerTestAudioUrl?: string;
10
12
  };
11
- export declare const DeviceSelectorAudioOutput: ({ title, visualType, }: DeviceSelectorAudioOutputProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export declare const DeviceSelectorAudioOutput: ({ title, visualType, speakerTestVisible, speakerTestAudioUrl, }: DeviceSelectorAudioOutputProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * SpeakerTest component that plays a test audio through the selected speaker.
3
+ * This allows users to verify their audio output device is working correctly.
4
+ */
5
+ export declare const SpeakerTest: (props: {
6
+ audioUrl?: string;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -3,3 +3,4 @@ export * from './DeviceSettings';
3
3
  export * from './DeviceSelector';
4
4
  export * from './DeviceSelectorAudio';
5
5
  export * from './DeviceSelectorVideo';
6
+ export * from './SpeakerTest';
@@ -6,6 +6,7 @@ export type NotificationProps = {
6
6
  visibilityTimeout?: number;
7
7
  resetIsVisible?: () => void;
8
8
  placement?: Placement;
9
+ className?: string;
9
10
  iconClassName?: string | null;
10
11
  close?: () => void;
11
12
  };
@@ -12,6 +12,7 @@ export declare const translations: {
12
12
  Speakers: string;
13
13
  Video: string;
14
14
  "You are muted. Unmute to speak.": string;
15
+ "Background filters performance is degraded. Consider disabling filters for better performance.": string;
15
16
  Live: string;
16
17
  "Livestream starts soon": string;
17
18
  "Livestream starts at {{ startsAt }}": string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-sdk",
3
- "version": "1.26.1",
3
+ "version": "1.27.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -19,6 +19,7 @@
19
19
  "files": [
20
20
  "dist",
21
21
  "src",
22
+ "assets",
22
23
  "index.ts",
23
24
  "package.json",
24
25
  "README.md",
@@ -30,9 +31,9 @@
30
31
  ],
31
32
  "dependencies": {
32
33
  "@floating-ui/react": "^0.27.6",
33
- "@stream-io/video-client": "1.37.0",
34
- "@stream-io/video-filters-web": "0.4.0",
35
- "@stream-io/video-react-bindings": "1.11.1",
34
+ "@stream-io/video-client": "1.37.1",
35
+ "@stream-io/video-filters-web": "0.5.0",
36
+ "@stream-io/video-react-bindings": "1.11.2",
36
37
  "chart.js": "^4.4.4",
37
38
  "clsx": "^2.0.0",
38
39
  "react-chartjs-2": "^5.3.0"
@@ -46,7 +47,7 @@
46
47
  "@rollup/plugin-replace": "^6.0.2",
47
48
  "@rollup/plugin-typescript": "^12.1.4",
48
49
  "@stream-io/audio-filters-web": "^0.6.0",
49
- "@stream-io/video-styling": "^1.7.0",
50
+ "@stream-io/video-styling": "^1.8.0",
50
51
  "@types/react": "~19.1.17",
51
52
  "@types/react-dom": "~19.1.11",
52
53
  "react": "19.1.0",