@stream-io/video-react-sdk 1.23.1 → 1.24.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/CHANGELOG.md +16 -0
- package/dist/css/styles.css +10 -8
- package/dist/css/styles.css.map +1 -1
- package/dist/index.cjs.js +5 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +6 -17
- package/dist/index.es.js.map +1 -1
- package/dist/latency-chart-Bj5OSYzg.es.js.map +1 -1
- package/dist/latency-chart-CpL1M_s0.cjs.js.map +1 -1
- package/package.json +13 -13
- package/src/wrappers/LivestreamPlayer/LivestreamPlayer.tsx +5 -5
- package/dist/src/hooks/useEffectEvent.d.ts +0 -1
- package/src/hooks/useEffectEvent.ts +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latency-chart-Bj5OSYzg.es.js","sources":["../../src/components/CallStats/CallStatsLatencyChart.tsx"],"sourcesContent":["import {\n CategoryScale,\n Chart as ChartJS,\n ChartData,\n ChartOptions,\n LinearScale,\n LineElement,\n PointElement,\n} from 'chart.js';\nimport { Line } from 'react-chartjs-2';\nimport { useMemo } from 'react';\n\n// NOTE: this is a side effect by definition, but this component is\n// isolated in a separate chunk, and it won't affect the rest of the app.\n// See CallStats.tsx for more details.\nChartJS.register(CategoryScale, LinearScale, LineElement, PointElement);\n\nconst CallStatsLatencyChart = (props: {\n values: Array<{ x: number; y: number }>;\n}) => {\n const { values } = props;\n let max = 0;\n const data: ChartData<'line'> = {\n labels: values.map((point) => {\n const date = new Date(point.x * 1000);\n return `${date.getHours()}:${date.getMinutes()}`;\n }),\n datasets: [\n {\n data: values.map((point) => {\n const { y } = point;\n max = Math.max(max, y);\n return point;\n }),\n borderColor: '#00e2a1',\n backgroundColor: '#00e2a1',\n },\n ],\n };\n\n const options = useMemo(() => getLineOptions(max), [max]);\n return (\n <div className=\"str-video__call-stats-line-chart-container\">\n <Line\n options={options}\n data={data}\n className=\"str-video__call-stats__latencychart\"\n />\n </div>\n );\n};\n\nexport default CallStatsLatencyChart;\n\nconst getLineOptions = (max: number): ChartOptions<'line'> => ({\n maintainAspectRatio: false,\n animation: { duration: 0 },\n elements: {\n line: { borderWidth: 1 },\n point: { radius: 2 },\n },\n scales: {\n y: {\n position: 'right',\n stacked: true,\n min: 0,\n max: Math.max(180, Math.ceil((max + 10) / 10) * 10),\n grid: { display: true, color: '#979ca0' },\n ticks: { stepSize: 30 },\n },\n x: {\n grid: { display: false },\n ticks: { display: false },\n },\n },\n});\n"],"names":["ChartJS","_jsx"],"mappings":";;;;;AAYA;AACA;AACA;AACAA,KAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC;AAEvE,MAAM,qBAAqB,GAAG,CAAC,KAE9B,KAAI;AACH,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK;IACxB,IAAI,GAAG,GAAG,CAAC;AACX,IAAA,MAAM,IAAI,GAAsB;QAC9B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;YAC3B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;YACrC,OAAO,CAAA,EAAG,IAAI,CAAC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"latency-chart-Bj5OSYzg.es.js","sources":["../../src/components/CallStats/CallStatsLatencyChart.tsx"],"sourcesContent":["import {\n CategoryScale,\n Chart as ChartJS,\n ChartData,\n ChartOptions,\n LinearScale,\n LineElement,\n PointElement,\n} from 'chart.js';\nimport { Line } from 'react-chartjs-2';\nimport { useMemo } from 'react';\n\n// NOTE: this is a side effect by definition, but this component is\n// isolated in a separate chunk, and it won't affect the rest of the app.\n// See CallStats.tsx for more details.\nChartJS.register(CategoryScale, LinearScale, LineElement, PointElement);\n\nconst CallStatsLatencyChart = (props: {\n values: Array<{ x: number; y: number }>;\n}) => {\n const { values } = props;\n let max = 0;\n const data: ChartData<'line'> = {\n labels: values.map((point) => {\n const date = new Date(point.x * 1000);\n return `${date.getHours()}:${date.getMinutes()}`;\n }),\n datasets: [\n {\n data: values.map((point) => {\n const { y } = point;\n max = Math.max(max, y);\n return point;\n }),\n borderColor: '#00e2a1',\n backgroundColor: '#00e2a1',\n },\n ],\n };\n\n const options = useMemo(() => getLineOptions(max), [max]);\n return (\n <div className=\"str-video__call-stats-line-chart-container\">\n <Line\n options={options}\n data={data}\n className=\"str-video__call-stats__latencychart\"\n />\n </div>\n );\n};\n\nexport default CallStatsLatencyChart;\n\nconst getLineOptions = (max: number): ChartOptions<'line'> => ({\n maintainAspectRatio: false,\n animation: { duration: 0 },\n elements: {\n line: { borderWidth: 1 },\n point: { radius: 2 },\n },\n scales: {\n y: {\n position: 'right',\n stacked: true,\n min: 0,\n max: Math.max(180, Math.ceil((max + 10) / 10) * 10),\n grid: { display: true, color: '#979ca0' },\n ticks: { stepSize: 30 },\n },\n x: {\n grid: { display: false },\n ticks: { display: false },\n },\n },\n});\n"],"names":["ChartJS","_jsx"],"mappings":";;;;;AAYA;AACA;AACA;AACAA,KAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC;AAEvE,MAAM,qBAAqB,GAAG,CAAC,KAE9B,KAAI;AACH,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK;IACxB,IAAI,GAAG,GAAG,CAAC;AACX,IAAA,MAAM,IAAI,GAAsB;QAC9B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;YAC3B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;YACrC,OAAO,CAAA,EAAG,IAAI,CAAC,QAAQ,EAAE,CAAA,CAAA,EAAI,IAAI,CAAC,UAAU,EAAE,CAAA,CAAE;AAClD,QAAA,CAAC,CAAC;AACF,QAAA,QAAQ,EAAE;AACR,YAAA;gBACE,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AAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;AACxB,SAAA;AACD,QAAA,CAAC,EAAE;AACD,YAAA,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AACxB,YAAA,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AAC1B,SAAA;AACF,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latency-chart-CpL1M_s0.cjs.js","sources":["../../src/components/CallStats/CallStatsLatencyChart.tsx"],"sourcesContent":["import {\n CategoryScale,\n Chart as ChartJS,\n ChartData,\n ChartOptions,\n LinearScale,\n LineElement,\n PointElement,\n} from 'chart.js';\nimport { Line } from 'react-chartjs-2';\nimport { useMemo } from 'react';\n\n// NOTE: this is a side effect by definition, but this component is\n// isolated in a separate chunk, and it won't affect the rest of the app.\n// See CallStats.tsx for more details.\nChartJS.register(CategoryScale, LinearScale, LineElement, PointElement);\n\nconst CallStatsLatencyChart = (props: {\n values: Array<{ x: number; y: number }>;\n}) => {\n const { values } = props;\n let max = 0;\n const data: ChartData<'line'> = {\n labels: values.map((point) => {\n const date = new Date(point.x * 1000);\n return `${date.getHours()}:${date.getMinutes()}`;\n }),\n datasets: [\n {\n data: values.map((point) => {\n const { y } = point;\n max = Math.max(max, y);\n return point;\n }),\n borderColor: '#00e2a1',\n backgroundColor: '#00e2a1',\n },\n ],\n };\n\n const options = useMemo(() => getLineOptions(max), [max]);\n return (\n <div className=\"str-video__call-stats-line-chart-container\">\n <Line\n options={options}\n data={data}\n className=\"str-video__call-stats__latencychart\"\n />\n </div>\n );\n};\n\nexport default CallStatsLatencyChart;\n\nconst getLineOptions = (max: number): ChartOptions<'line'> => ({\n maintainAspectRatio: false,\n animation: { duration: 0 },\n elements: {\n line: { borderWidth: 1 },\n point: { radius: 2 },\n },\n scales: {\n y: {\n position: 'right',\n stacked: true,\n min: 0,\n max: Math.max(180, Math.ceil((max + 10) / 10) * 10),\n grid: { display: true, color: '#979ca0' },\n ticks: { stepSize: 30 },\n },\n x: {\n grid: { display: false },\n ticks: { display: false },\n },\n },\n});\n"],"names":["ChartJS","CategoryScale","LinearScale","LineElement","PointElement","useMemo","_jsx","Line"],"mappings":";;;;;;;AAYA;AACA;AACA;AACAA,cAAO,CAAC,QAAQ,CAACC,sBAAa,EAAEC,oBAAW,EAAEC,oBAAW,EAAEC,qBAAY,CAAC;AAEvE,MAAM,qBAAqB,GAAG,CAAC,KAE9B,KAAI;AACH,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK;IACxB,IAAI,GAAG,GAAG,CAAC;AACX,IAAA,MAAM,IAAI,GAAsB;QAC9B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;YAC3B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;YACrC,OAAO,CAAA,EAAG,IAAI,CAAC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"latency-chart-CpL1M_s0.cjs.js","sources":["../../src/components/CallStats/CallStatsLatencyChart.tsx"],"sourcesContent":["import {\n CategoryScale,\n Chart as ChartJS,\n ChartData,\n ChartOptions,\n LinearScale,\n LineElement,\n PointElement,\n} from 'chart.js';\nimport { Line } from 'react-chartjs-2';\nimport { useMemo } from 'react';\n\n// NOTE: this is a side effect by definition, but this component is\n// isolated in a separate chunk, and it won't affect the rest of the app.\n// See CallStats.tsx for more details.\nChartJS.register(CategoryScale, LinearScale, LineElement, PointElement);\n\nconst CallStatsLatencyChart = (props: {\n values: Array<{ x: number; y: number }>;\n}) => {\n const { values } = props;\n let max = 0;\n const data: ChartData<'line'> = {\n labels: values.map((point) => {\n const date = new Date(point.x * 1000);\n return `${date.getHours()}:${date.getMinutes()}`;\n }),\n datasets: [\n {\n data: values.map((point) => {\n const { y } = point;\n max = Math.max(max, y);\n return point;\n }),\n borderColor: '#00e2a1',\n backgroundColor: '#00e2a1',\n },\n ],\n };\n\n const options = useMemo(() => getLineOptions(max), [max]);\n return (\n <div className=\"str-video__call-stats-line-chart-container\">\n <Line\n options={options}\n data={data}\n className=\"str-video__call-stats__latencychart\"\n />\n </div>\n );\n};\n\nexport default CallStatsLatencyChart;\n\nconst getLineOptions = (max: number): ChartOptions<'line'> => ({\n maintainAspectRatio: false,\n animation: { duration: 0 },\n elements: {\n line: { borderWidth: 1 },\n point: { radius: 2 },\n },\n scales: {\n y: {\n position: 'right',\n stacked: true,\n min: 0,\n max: Math.max(180, Math.ceil((max + 10) / 10) * 10),\n grid: { display: true, color: '#979ca0' },\n ticks: { stepSize: 30 },\n },\n x: {\n grid: { display: false },\n ticks: { display: false },\n },\n },\n});\n"],"names":["ChartJS","CategoryScale","LinearScale","LineElement","PointElement","useMemo","_jsx","Line"],"mappings":";;;;;;;AAYA;AACA;AACA;AACAA,cAAO,CAAC,QAAQ,CAACC,sBAAa,EAAEC,oBAAW,EAAEC,oBAAW,EAAEC,qBAAY,CAAC;AAEvE,MAAM,qBAAqB,GAAG,CAAC,KAE9B,KAAI;AACH,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK;IACxB,IAAI,GAAG,GAAG,CAAC;AACX,IAAA,MAAM,IAAI,GAAsB;QAC9B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;YAC3B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;YACrC,OAAO,CAAA,EAAG,IAAI,CAAC,QAAQ,EAAE,CAAA,CAAA,EAAI,IAAI,CAAC,UAAU,EAAE,CAAA,CAAE;AAClD,QAAA,CAAC,CAAC;AACF,QAAA,QAAQ,EAAE;AACR,YAAA;gBACE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;AACzB,oBAAA,MAAM,EAAE,CAAC,EAAE,GAAG,KAAK;oBACnB,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAA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,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AAC1B,SAAA;AACF,KAAA;AACF,CAAA,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@floating-ui/react": "^0.27.6",
|
|
33
|
-
"@stream-io/video-client": "1.
|
|
34
|
-
"@stream-io/video-filters-web": "0.
|
|
35
|
-
"@stream-io/video-react-bindings": "1.
|
|
33
|
+
"@stream-io/video-client": "1.34.0",
|
|
34
|
+
"@stream-io/video-filters-web": "0.3.0",
|
|
35
|
+
"@stream-io/video-react-bindings": "1.10.0",
|
|
36
36
|
"chart.js": "^4.4.4",
|
|
37
37
|
"clsx": "^2.0.0",
|
|
38
38
|
"react-chartjs-2": "^5.3.0"
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@rollup/plugin-json": "^6.1.0",
|
|
46
46
|
"@rollup/plugin-replace": "^6.0.2",
|
|
47
|
-
"@rollup/plugin-typescript": "^12.1.
|
|
48
|
-
"@stream-io/audio-filters-web": "^0.
|
|
49
|
-
"@stream-io/video-styling": "^1.
|
|
50
|
-
"@types/react": "
|
|
51
|
-
"@types/react-dom": "
|
|
52
|
-
"react": "19.
|
|
53
|
-
"react-dom": "19.
|
|
47
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
48
|
+
"@stream-io/audio-filters-web": "^0.6.0",
|
|
49
|
+
"@stream-io/video-styling": "^1.6.0",
|
|
50
|
+
"@types/react": "~19.1.17",
|
|
51
|
+
"@types/react-dom": "~19.1.11",
|
|
52
|
+
"react": "19.1.0",
|
|
53
|
+
"react-dom": "19.1.0",
|
|
54
54
|
"rimraf": "^6.0.1",
|
|
55
|
-
"rollup": "^4.
|
|
56
|
-
"typescript": "^5.
|
|
55
|
+
"rollup": "^4.52.4",
|
|
56
|
+
"typescript": "^5.9.3"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
LivestreamLayoutProps,
|
|
13
13
|
StreamCall,
|
|
14
14
|
} from '../../core';
|
|
15
|
-
import { useEffectEvent } from '
|
|
15
|
+
import { useEffectEvent } from '@stream-io/video-react-bindings';
|
|
16
16
|
|
|
17
17
|
export type LivestreamPlayerProps = {
|
|
18
18
|
/**
|
|
@@ -53,7 +53,7 @@ export const LivestreamPlayer = (props: LivestreamPlayerProps) => {
|
|
|
53
53
|
const { callType, callId, ...restProps } = props;
|
|
54
54
|
const client = useStreamVideoClient();
|
|
55
55
|
const [call, setCall] = useState<Call>();
|
|
56
|
-
const onError = useEffectEvent(props.onError);
|
|
56
|
+
const onError = useEffectEvent(props.onError ?? (() => {}));
|
|
57
57
|
|
|
58
58
|
useEffect(() => {
|
|
59
59
|
if (!client) return;
|
|
@@ -69,7 +69,7 @@ export const LivestreamPlayer = (props: LivestreamPlayerProps) => {
|
|
|
69
69
|
});
|
|
70
70
|
setCall(undefined);
|
|
71
71
|
};
|
|
72
|
-
}, [callId, callType, client
|
|
72
|
+
}, [callId, callType, client]);
|
|
73
73
|
|
|
74
74
|
if (!call) {
|
|
75
75
|
return null;
|
|
@@ -116,7 +116,7 @@ const useLivestreamCall = (props: {
|
|
|
116
116
|
const canJoin =
|
|
117
117
|
(joinBehavior === 'asap' && canJoinAsap) ||
|
|
118
118
|
(joinBehavior === 'live' && canJoinLive);
|
|
119
|
-
const onError = useEffectEvent(props.onError);
|
|
119
|
+
const onError = useEffectEvent(props.onError ?? (() => {}));
|
|
120
120
|
|
|
121
121
|
useEffect(() => {
|
|
122
122
|
if (call && call.state.callingState === CallingState.IDLE && canJoin) {
|
|
@@ -125,7 +125,7 @@ const useLivestreamCall = (props: {
|
|
|
125
125
|
onError(e);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
}, [call, canJoin
|
|
128
|
+
}, [call, canJoin]);
|
|
129
129
|
|
|
130
130
|
return call;
|
|
131
131
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useEffectEvent<P extends unknown[]>(cb: ((...args: P) => void) | undefined): (...args: P) => void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCallback, useLayoutEffect, useRef } from 'react';
|
|
2
|
-
|
|
3
|
-
export function useEffectEvent<P extends unknown[]>(
|
|
4
|
-
cb: ((...args: P) => void) | undefined,
|
|
5
|
-
): (...args: P) => void {
|
|
6
|
-
const cbRef = useRef<((...args: P) => void) | undefined>(undefined);
|
|
7
|
-
|
|
8
|
-
useLayoutEffect(() => {
|
|
9
|
-
cbRef.current = cb;
|
|
10
|
-
}, [cb]);
|
|
11
|
-
|
|
12
|
-
return useCallback((...args: P) => {
|
|
13
|
-
const callback = cbRef.current;
|
|
14
|
-
callback?.(...args);
|
|
15
|
-
}, []);
|
|
16
|
-
}
|