@stream-io/video-react-sdk 0.0.1-alpha.45 → 0.0.1-alpha.46
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 +9 -0
- package/dist/src/components/CallControls/CallControls.js +2 -2
- package/dist/src/components/CallControls/CallControls.js.map +1 -1
- package/dist/src/components/CallControls/ToggleAudioButton.js +8 -3
- package/dist/src/components/CallControls/ToggleAudioButton.js.map +1 -1
- package/dist/src/components/CallControls/ToggleVideoButton.d.ts +10 -0
- package/dist/src/components/CallControls/{ToggleCameraButton.js → ToggleVideoButton.js} +11 -6
- package/dist/src/components/CallControls/ToggleVideoButton.js.map +1 -0
- package/dist/src/components/CallControls/index.d.ts +1 -2
- package/dist/src/components/CallControls/index.js +1 -2
- package/dist/src/components/CallControls/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/CallControls/CallControls.tsx +2 -2
- package/src/components/CallControls/ToggleAudioButton.tsx +7 -3
- package/src/components/CallControls/{ToggleCameraButton.tsx → ToggleVideoButton.tsx} +13 -9
- package/src/components/CallControls/index.ts +1 -2
- package/dist/src/components/CallControls/ToggleCameraButton.d.ts +0 -10
- package/dist/src/components/CallControls/ToggleCameraButton.js.map +0 -1
- package/dist/src/components/CallControls/ToggleParticipantListButton.d.ts +0 -6
- package/dist/src/components/CallControls/ToggleParticipantListButton.js +0 -7
- package/dist/src/components/CallControls/ToggleParticipantListButton.js.map +0 -1
- package/src/components/CallControls/ToggleParticipantListButton.tsx +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.1-alpha.46](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.1-alpha.45...@stream-io/video-react-sdk-0.0.1-alpha.46) (2023-05-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* reorganize call control buttons ([#514](https://github.com/GetStream/stream-video-js/issues/514)) ([ed1df9c](https://github.com/GetStream/stream-video-js/commit/ed1df9c230d20c2f08d0d97e2eaa962d22c7fc36))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## [0.0.1-alpha.45](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.1-alpha.44...@stream-io/video-react-sdk-0.0.1-alpha.45) (2023-05-17)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CallStatsButton, CancelCallButton, RecordCallButton, ScreenShareButton, ToggleAudioPublishingButton,
|
|
2
|
+
import { CallStatsButton, CancelCallButton, RecordCallButton, ScreenShareButton, ToggleAudioPublishingButton, ToggleVideoPublishingButton, } from './index';
|
|
3
3
|
import { SpeakingWhileMutedNotification } from '../Notification';
|
|
4
4
|
export const CallControls = (props) => {
|
|
5
5
|
const { call, onLeave } = props;
|
|
6
|
-
return (_jsxs("div", Object.assign({ className: "str-video__call-controls" }, { children: [_jsx(RecordCallButton, { call: call }), _jsx(CallStatsButton, {}), _jsx(ScreenShareButton, { call: call }), _jsx(SpeakingWhileMutedNotification, { children: _jsx(ToggleAudioPublishingButton, {}) }), _jsx(
|
|
6
|
+
return (_jsxs("div", Object.assign({ className: "str-video__call-controls" }, { children: [_jsx(RecordCallButton, { call: call }), _jsx(CallStatsButton, {}), _jsx(ScreenShareButton, { call: call }), _jsx(SpeakingWhileMutedNotification, { children: _jsx(ToggleAudioPublishingButton, {}) }), _jsx(ToggleVideoPublishingButton, {}), _jsx(CancelCallButton, { call: call, onLeave: onLeave })] })));
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=CallControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallControls.js","sourceRoot":"","sources":["../../../../src/components/CallControls/CallControls.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"CallControls.js","sourceRoot":"","sources":["../../../../src/components/CallControls/CallControls.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAOjE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IACvD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEhC,OAAO,CACL,6BAAK,SAAS,EAAC,0BAA0B,iBACvC,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,GAAI,EAChC,KAAC,eAAe,KAAG,EACnB,KAAC,iBAAiB,IAAC,IAAI,EAAE,IAAI,GAAI,EACjC,KAAC,8BAA8B,cAC7B,KAAC,2BAA2B,KAAG,GACA,EACjC,KAAC,2BAA2B,KAAG,EAC/B,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAI,KAC9C,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { useCallback, useEffect, useState } from 'react';
|
|
12
12
|
import { OwnCapability, SfuModels } from '@stream-io/video-client';
|
|
13
|
-
import { useCall, useHasPermissions, useI18n,
|
|
13
|
+
import { Restricted, useCall, useHasPermissions, useI18n, useLocalParticipant, } from '@stream-io/video-react-bindings';
|
|
14
14
|
import { useMediaDevices } from '../../core';
|
|
15
15
|
import { DeviceSelectorAudioInput } from '../DeviceSettings';
|
|
16
16
|
import { CompositeButton, IconButton } from '../Button';
|
|
@@ -48,8 +48,13 @@ export const ToggleAudioPublishingButton = (props) => {
|
|
|
48
48
|
});
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
if (isAudioMute
|
|
52
|
-
|
|
51
|
+
if (isAudioMute) {
|
|
52
|
+
if (hasPermission) {
|
|
53
|
+
yield publishAudioStream();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.log('Cannot publish audio stream. Insufficient permissions.');
|
|
57
|
+
}
|
|
53
58
|
}
|
|
54
59
|
else {
|
|
55
60
|
stopPublishingAudio();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleAudioButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleAudioButton.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"ToggleAudioButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleAudioButton.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EACL,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,OAAO,EACP,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,UAAU,EA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AO,EAAE,OAAO,gBAEhB,KAAC,UAAU,IACT,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACrC,OAAO,EAAE,WAAW,GACpB,IACc,IACK,IACd,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ToggleVideoPreviewButtonProps = {
|
|
3
|
+
caption?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const ToggleVideoPreviewButton: ({ caption, }: ToggleVideoPreviewButtonProps) => JSX.Element;
|
|
6
|
+
type ToggleVideoPublishingButtonProps = {
|
|
7
|
+
caption?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const ToggleVideoPublishingButton: ({ caption, }: ToggleVideoPublishingButtonProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -12,14 +12,14 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
12
12
|
import { Restricted, useCall, useHasPermissions, useLocalParticipant, } from '@stream-io/video-react-bindings';
|
|
13
13
|
import { OwnCapability, SfuModels } from '@stream-io/video-client';
|
|
14
14
|
import { CompositeButton, IconButton } from '../Button/';
|
|
15
|
-
import { useMediaDevices } from '../../core
|
|
15
|
+
import { useMediaDevices } from '../../core';
|
|
16
16
|
import { DeviceSelectorVideo } from '../DeviceSettings';
|
|
17
17
|
import { PermissionNotification } from '../Notification';
|
|
18
|
-
export const
|
|
18
|
+
export const ToggleVideoPreviewButton = ({ caption = 'Video', }) => {
|
|
19
19
|
const { toggleVideoMuteState, initialVideoState } = useMediaDevices();
|
|
20
20
|
return (_jsx(CompositeButton, Object.assign({ Menu: DeviceSelectorVideo, active: !initialVideoState.enabled, caption: caption }, { children: _jsx(IconButton, { icon: initialVideoState.enabled ? 'camera' : 'camera-off', onClick: toggleVideoMuteState }) })));
|
|
21
21
|
};
|
|
22
|
-
export const
|
|
22
|
+
export const ToggleVideoPublishingButton = ({ caption = 'Video', }) => {
|
|
23
23
|
const { publishVideoStream, stopPublishingVideo } = useMediaDevices();
|
|
24
24
|
const localParticipant = useLocalParticipant();
|
|
25
25
|
const isVideoMute = !(localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.publishedTracks.includes(SfuModels.TrackType.VIDEO));
|
|
@@ -45,8 +45,13 @@ export const ToggleCameraPublishingButton = ({ caption = 'Video', }) => {
|
|
|
45
45
|
});
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
if (isVideoMute
|
|
49
|
-
|
|
48
|
+
if (isVideoMute) {
|
|
49
|
+
if (hasPermission) {
|
|
50
|
+
yield publishVideoStream();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
console.log('Cannot publish video. Insufficient permissions.');
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
56
|
else {
|
|
52
57
|
stopPublishingVideo();
|
|
@@ -60,4 +65,4 @@ export const ToggleCameraPublishingButton = ({ caption = 'Video', }) => {
|
|
|
60
65
|
]);
|
|
61
66
|
return (_jsx(Restricted, Object.assign({ requiredGrants: [OwnCapability.SEND_VIDEO] }, { children: _jsx(PermissionNotification, Object.assign({ permission: OwnCapability.SEND_VIDEO, isAwaitingApproval: isAwaitingApproval, messageApproved: "You can now share your video.", messageAwaitingApproval: "Awaiting for an approval to share your video.", messageRevoked: "You can no longer share your video." }, { children: _jsx(CompositeButton, Object.assign({ Menu: DeviceSelectorVideo, active: isVideoMute, caption: caption }, { children: _jsx(IconButton, { icon: isVideoMute ? 'camera-off' : 'camera', onClick: handleClick }) })) })) })));
|
|
62
67
|
};
|
|
63
|
-
//# sourceMappingURL=
|
|
68
|
+
//# sourceMappingURL=ToggleVideoButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleVideoButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleVideoButton.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QA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EACtC,eAAe,EAAC,+BAA+B,EAC/C,uBAAuB,EAAC,+CAA+C,EACvE,cAAc,EAAC,qCAAqC,gBAEpD,KAAC,eAAe,kBACd,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,gBAEhB,KAAC,UAAU,IACT,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAC3C,OAAO,EAAE,WAAW,GACpB,IACc,IACK,IACd,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -6,6 +6,5 @@ export * from './ReactionsButton';
|
|
|
6
6
|
export * from './RecordCallButton';
|
|
7
7
|
export * from './ScreenShareButton';
|
|
8
8
|
export * from './ToggleAudioButton';
|
|
9
|
-
export * from './ToggleCameraButton';
|
|
10
9
|
export * from './ToggleAudioOutputButton';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './ToggleVideoButton';
|
|
@@ -6,7 +6,6 @@ export * from './ReactionsButton';
|
|
|
6
6
|
export * from './RecordCallButton';
|
|
7
7
|
export * from './ScreenShareButton';
|
|
8
8
|
export * from './ToggleAudioButton';
|
|
9
|
-
export * from './ToggleCameraButton';
|
|
10
9
|
export * from './ToggleAudioOutputButton';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './ToggleVideoButton';
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/CallControls/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/CallControls/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@floating-ui/react": "^0.22.0",
|
|
26
26
|
"@nivo/core": "^0.80.0",
|
|
27
27
|
"@nivo/line": "^0.80.0",
|
|
28
|
-
"@stream-io/i18n": "^0.0.1-alpha.
|
|
29
|
-
"@stream-io/video-client": "^0.0.1-alpha.
|
|
30
|
-
"@stream-io/video-react-bindings": "^0.0.1-alpha.
|
|
28
|
+
"@stream-io/i18n": "^0.0.1-alpha.30",
|
|
29
|
+
"@stream-io/video-client": "^0.0.1-alpha.154",
|
|
30
|
+
"@stream-io/video-react-bindings": "^0.0.1-alpha.41",
|
|
31
31
|
"clsx": "^1.2.1",
|
|
32
32
|
"rxjs": "~7.8.1"
|
|
33
33
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-dom": "^18.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@stream-io/video-styling": "^0.0.1-alpha.
|
|
39
|
+
"@stream-io/video-styling": "^0.0.1-alpha.24",
|
|
40
40
|
"@types/rimraf": "^3.0.2",
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-dom": "^18.2.0",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"typedoc": "^0.24.7",
|
|
46
46
|
"typescript": "^4.9.5"
|
|
47
47
|
},
|
|
48
|
-
"version": "0.0.1-alpha.
|
|
48
|
+
"version": "0.0.1-alpha.46"
|
|
49
49
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
RecordCallButton,
|
|
6
6
|
ScreenShareButton,
|
|
7
7
|
ToggleAudioPublishingButton,
|
|
8
|
-
|
|
8
|
+
ToggleVideoPublishingButton,
|
|
9
9
|
} from './index';
|
|
10
10
|
import { SpeakingWhileMutedNotification } from '../Notification';
|
|
11
11
|
|
|
@@ -25,7 +25,7 @@ export const CallControls = (props: CallControlsProps) => {
|
|
|
25
25
|
<SpeakingWhileMutedNotification>
|
|
26
26
|
<ToggleAudioPublishingButton />
|
|
27
27
|
</SpeakingWhileMutedNotification>
|
|
28
|
-
<
|
|
28
|
+
<ToggleVideoPublishingButton />
|
|
29
29
|
<CancelCallButton call={call} onLeave={onLeave} />
|
|
30
30
|
</div>
|
|
31
31
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { OwnCapability, SfuModels } from '@stream-io/video-client';
|
|
3
3
|
import {
|
|
4
|
+
Restricted,
|
|
4
5
|
useCall,
|
|
5
6
|
useHasPermissions,
|
|
6
7
|
useI18n,
|
|
7
|
-
Restricted,
|
|
8
8
|
useLocalParticipant,
|
|
9
9
|
} from '@stream-io/video-react-bindings';
|
|
10
10
|
|
|
@@ -77,8 +77,12 @@ export const ToggleAudioPublishingButton = (
|
|
|
77
77
|
});
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
if (isAudioMute
|
|
81
|
-
|
|
80
|
+
if (isAudioMute) {
|
|
81
|
+
if (hasPermission) {
|
|
82
|
+
await publishAudioStream();
|
|
83
|
+
} else {
|
|
84
|
+
console.log('Cannot publish audio stream. Insufficient permissions.');
|
|
85
|
+
}
|
|
82
86
|
} else {
|
|
83
87
|
stopPublishingAudio();
|
|
84
88
|
}
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { OwnCapability, SfuModels } from '@stream-io/video-client';
|
|
10
10
|
import { CompositeButton, IconButton } from '../Button/';
|
|
11
|
-
import { useMediaDevices } from '../../core
|
|
11
|
+
import { useMediaDevices } from '../../core';
|
|
12
12
|
import { DeviceSelectorVideo } from '../DeviceSettings';
|
|
13
13
|
import { PermissionNotification } from '../Notification';
|
|
14
14
|
|
|
15
|
-
export type
|
|
15
|
+
export type ToggleVideoPreviewButtonProps = { caption?: string };
|
|
16
16
|
|
|
17
|
-
export const
|
|
17
|
+
export const ToggleVideoPreviewButton = ({
|
|
18
18
|
caption = 'Video',
|
|
19
|
-
}:
|
|
19
|
+
}: ToggleVideoPreviewButtonProps) => {
|
|
20
20
|
const { toggleVideoMuteState, initialVideoState } = useMediaDevices();
|
|
21
21
|
|
|
22
22
|
return (
|
|
@@ -33,13 +33,13 @@ export const ToggleCameraPreviewButton = ({
|
|
|
33
33
|
);
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
type
|
|
36
|
+
type ToggleVideoPublishingButtonProps = {
|
|
37
37
|
caption?: string;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export const
|
|
40
|
+
export const ToggleVideoPublishingButton = ({
|
|
41
41
|
caption = 'Video',
|
|
42
|
-
}:
|
|
42
|
+
}: ToggleVideoPublishingButtonProps) => {
|
|
43
43
|
const { publishVideoStream, stopPublishingVideo } = useMediaDevices();
|
|
44
44
|
const localParticipant = useLocalParticipant();
|
|
45
45
|
const isVideoMute = !localParticipant?.publishedTracks.includes(
|
|
@@ -71,8 +71,12 @@ export const ToggleCameraPublishingButton = ({
|
|
|
71
71
|
});
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
if (isVideoMute
|
|
75
|
-
|
|
74
|
+
if (isVideoMute) {
|
|
75
|
+
if (hasPermission) {
|
|
76
|
+
await publishVideoStream();
|
|
77
|
+
} else {
|
|
78
|
+
console.log('Cannot publish video. Insufficient permissions.');
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
stopPublishingVideo();
|
|
78
82
|
}
|
|
@@ -6,6 +6,5 @@ export * from './ReactionsButton';
|
|
|
6
6
|
export * from './RecordCallButton';
|
|
7
7
|
export * from './ScreenShareButton';
|
|
8
8
|
export * from './ToggleAudioButton';
|
|
9
|
-
export * from './ToggleCameraButton';
|
|
10
9
|
export * from './ToggleAudioOutputButton';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './ToggleVideoButton';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type ToggleCameraPreviewButtonProps = {
|
|
3
|
-
caption?: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const ToggleCameraPreviewButton: ({ caption, }: ToggleCameraPreviewButtonProps) => JSX.Element;
|
|
6
|
-
type ToggleCameraPublishingButtonProps = {
|
|
7
|
-
caption?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const ToggleCameraPublishingButton: ({ caption, }: ToggleCameraPublishingButtonProps) => JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleCameraButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleCameraButton.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EACL,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EACxC,OAAO,GAAG,OAAO,GACc,EAA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CAAC,EAC5D;YACA,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAC5B,MAAM,IAAI;iBACP,kBAAkB,CAAC;gBAClB,WAAW,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC;aACxC,CAAC;iBACD,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;gBAChB,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;YACL,OAAO;SACR;QACD,IAAI,WAAW,IAAI,aAAa,EAAE;YAChC,MAAM,kBAAkB,EAAE,CAAC;SAC5B;aAAM;YACL,mBAAmB,EAAE,CAAC;SACvB;IACH,CAAC,CAAA,EAAE;QACD,IAAI;QACJ,aAAa;QACb,WAAW;QACX,kBAAkB;QAClB,mBAAmB;KACpB,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,UAAU,kBAAC,cAAc,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,gBACpD,KAAC,sBAAsB,kBACrB,UAAU,EAAE,aAAa,CAAC,UAAU,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAC,+BAA+B,EAC/C,uBAAuB,EAAC,+CAA+C,EACvE,cAAc,EAAC,qCAAqC,gBAEpD,KAAC,eAAe,kBACd,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,gBAEhB,KAAC,UAAU,IACT,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAC3C,OAAO,EAAE,WAAW,GACpB,IACc,IACK,IACd,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ButtonWithIconProps } from '../Button/';
|
|
3
|
-
export type ToggleParticipantListButtonProps = {
|
|
4
|
-
caption?: string;
|
|
5
|
-
} & Omit<ButtonWithIconProps, 'icon' | 'ref'>;
|
|
6
|
-
export declare const ToggleParticipantListButton: (props: ToggleParticipantListButtonProps) => JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CompositeButton, IconButton } from '../Button/';
|
|
3
|
-
export const ToggleParticipantListButton = (props) => {
|
|
4
|
-
const { enabled, caption = 'Participants' } = props;
|
|
5
|
-
return (_jsx(CompositeButton, Object.assign({ active: enabled, caption: caption }, { children: _jsx(IconButton, Object.assign({ icon: "participants" }, props)) })));
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=ToggleParticipantListButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleParticipantListButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleParticipantListButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAO9E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,KAAuC,EACvC,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,cAAc,EAAE,GAAG,KAAK,CAAC;IACpD,OAAO,CACL,KAAC,eAAe,kBAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,gBAChD,KAAC,UAAU,kBAAC,IAAI,EAAC,cAAc,IAAK,KAAK,EAAI,IAC7B,CACnB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ButtonWithIconProps, CompositeButton, IconButton } from '../Button/';
|
|
2
|
-
|
|
3
|
-
export type ToggleParticipantListButtonProps = { caption?: string } & Omit<
|
|
4
|
-
ButtonWithIconProps,
|
|
5
|
-
'icon' | 'ref'
|
|
6
|
-
>;
|
|
7
|
-
|
|
8
|
-
export const ToggleParticipantListButton = (
|
|
9
|
-
props: ToggleParticipantListButtonProps,
|
|
10
|
-
) => {
|
|
11
|
-
const { enabled, caption = 'Participants' } = props;
|
|
12
|
-
return (
|
|
13
|
-
<CompositeButton active={enabled} caption={caption}>
|
|
14
|
-
<IconButton icon="participants" {...props} />
|
|
15
|
-
</CompositeButton>
|
|
16
|
-
);
|
|
17
|
-
};
|