@tellescope/video-chat 1.76.0 → 1.78.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/lib/cjs/video.d.ts +1 -0
- package/lib/cjs/video.d.ts.map +1 -1
- package/lib/cjs/video.js +53 -4
- package/lib/cjs/video.js.map +1 -1
- package/lib/esm/video.d.ts +1 -0
- package/lib/esm/video.d.ts.map +1 -1
- package/lib/esm/video.js +54 -8
- package/lib/esm/video.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/video.tsx +45 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/video-chat",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.78.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"@fontsource/roboto": "^4.5.1",
|
|
35
35
|
"@mui/icons-material": "^5.0.1",
|
|
36
36
|
"@mui/material": "^5.0.2",
|
|
37
|
-
"@tellescope/constants": "^1.
|
|
38
|
-
"@tellescope/react-components": "^1.
|
|
39
|
-
"@tellescope/sdk": "^1.
|
|
40
|
-
"@tellescope/types-client": "^1.
|
|
41
|
-
"@tellescope/types-models": "^1.
|
|
37
|
+
"@tellescope/constants": "^1.78.0",
|
|
38
|
+
"@tellescope/react-components": "^1.78.0",
|
|
39
|
+
"@tellescope/sdk": "^1.78.0",
|
|
40
|
+
"@tellescope/types-client": "^1.78.0",
|
|
41
|
+
"@tellescope/types-models": "^1.78.0",
|
|
42
42
|
"@tellescope/types-utilities": "^1.69.3",
|
|
43
|
-
"@tellescope/utilities": "^1.
|
|
43
|
+
"@tellescope/utilities": "^1.78.0",
|
|
44
44
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
45
45
|
"@typescript-eslint/parser": "^4.33.0",
|
|
46
46
|
"amazon-chime-sdk-component-library-react": "^3.7.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
56
56
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "37a62cf8570d9bd4a9068a1dc583567a4dbaa39a",
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
}
|
package/src/video.tsx
CHANGED
|
@@ -38,11 +38,9 @@ import {
|
|
|
38
38
|
MeetingStatus,
|
|
39
39
|
ContentShareControl,
|
|
40
40
|
VideoInputBackgroundBlurControl,
|
|
41
|
-
BackgroundBlurProvider,
|
|
42
41
|
// CameraSelection,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// useBackgroundReplacement,
|
|
42
|
+
useVideoInputs,
|
|
43
|
+
useBackgroundReplacement,
|
|
46
44
|
// useRemoteVideoTileState,
|
|
47
45
|
// useContentShareControls, // screen sharing
|
|
48
46
|
} from 'amazon-chime-sdk-component-library-react';
|
|
@@ -210,7 +208,6 @@ const WithContext = ({ children } : { children: React.ReactNode }) => {
|
|
|
210
208
|
|
|
211
209
|
// return (
|
|
212
210
|
// <ThemeProvider theme={darkTheme}>
|
|
213
|
-
// <BackgroundBlurProvider>
|
|
214
211
|
// <BackgroundReplacementProvider options={{ imageBlob }}>
|
|
215
212
|
// <MeetingProvider>
|
|
216
213
|
// <WithContext>
|
|
@@ -218,20 +215,17 @@ const WithContext = ({ children } : { children: React.ReactNode }) => {
|
|
|
218
215
|
// </WithContext>
|
|
219
216
|
// </MeetingProvider>
|
|
220
217
|
// </BackgroundReplacementProvider>
|
|
221
|
-
// </BackgroundBlurProvider>
|
|
222
218
|
// </ThemeProvider>
|
|
223
219
|
// )
|
|
224
220
|
// }
|
|
225
221
|
|
|
226
222
|
export const WithVideo = ({ children }: VideoProps) => (
|
|
227
223
|
<ThemeProvider theme={darkTheme}>
|
|
228
|
-
<BackgroundBlurProvider>
|
|
229
224
|
<MeetingProvider>
|
|
230
225
|
<WithContext>
|
|
231
226
|
{children}
|
|
232
227
|
</WithContext>
|
|
233
228
|
</MeetingProvider>
|
|
234
|
-
</BackgroundBlurProvider>
|
|
235
229
|
</ThemeProvider>
|
|
236
230
|
)
|
|
237
231
|
|
|
@@ -434,52 +428,48 @@ export const BlurToggleIcon = () => (
|
|
|
434
428
|
<VideoInputBackgroundBlurControl />
|
|
435
429
|
)
|
|
436
430
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
// const {
|
|
443
|
-
// isBackgroundReplacementSupported,
|
|
444
|
-
// createBackgroundReplacementDevice,
|
|
445
|
-
// } = useBackgroundReplacement();
|
|
431
|
+
export const ToggleBackgroundImageButton = () => {
|
|
432
|
+
const meetingManager = useMeetingManager();
|
|
433
|
+
const { selectedDevice } = useVideoInputs();
|
|
434
|
+
const [isVideoTransformCheckBoxOn, setisVideoTransformCheckBoxOn] = useState(false);
|
|
435
|
+
const { isBackgroundReplacementSupported, createBackgroundReplacementDevice } = useBackgroundReplacement();
|
|
446
436
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
//
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
// toggleBackgroundReplacement();
|
|
468
|
-
// }, [isVideoTransformCheckBoxOn]);
|
|
469
|
-
|
|
470
|
-
// const onClick = () => {
|
|
471
|
-
// setisVideoTransformCheckBoxOn((current) => !current);
|
|
472
|
-
// };
|
|
437
|
+
useEffect(() => {
|
|
438
|
+
async function toggleBackgroundReplacement() {
|
|
439
|
+
try {
|
|
440
|
+
let current = selectedDevice;
|
|
441
|
+
if (isVideoTransformCheckBoxOn) {
|
|
442
|
+
current = await createBackgroundReplacementDevice(selectedDevice as any);
|
|
443
|
+
} else {
|
|
444
|
+
if (isVideoTransformDevice(selectedDevice)) {
|
|
445
|
+
let intrinsicDevice = await selectedDevice.intrinsicDevice();
|
|
446
|
+
selectedDevice.stop();
|
|
447
|
+
current = intrinsicDevice;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
await meetingManager.startVideoInputDevice(current!);
|
|
451
|
+
} catch (error) {
|
|
452
|
+
// Handle device selection failure here
|
|
453
|
+
console.error('Failed to toggle BackgroundReplacement');
|
|
454
|
+
}
|
|
455
|
+
}
|
|
473
456
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
457
|
+
toggleBackgroundReplacement();
|
|
458
|
+
}, [isVideoTransformCheckBoxOn]);
|
|
459
|
+
|
|
460
|
+
const onClick = () => {
|
|
461
|
+
setisVideoTransformCheckBoxOn((current) => !current);
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
return (
|
|
465
|
+
<div>
|
|
466
|
+
{isBackgroundReplacementSupported && (
|
|
467
|
+
<button onClick={onClick}>
|
|
468
|
+
{isVideoTransformDevice(selectedDevice)
|
|
469
|
+
? 'Background Replacement Enabled'
|
|
470
|
+
: 'Enable Background Replacement'}
|
|
471
|
+
</button>
|
|
472
|
+
)}
|
|
473
|
+
</div>
|
|
474
|
+
);
|
|
475
|
+
};
|