@stream-io/video-react-sdk 0.0.1-alpha.102 → 0.0.1-alpha.103

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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.1-alpha.103](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.1-alpha.102...@stream-io/video-react-sdk-0.0.1-alpha.103) (2023-05-31)
6
+
7
+
8
+
5
9
  ## [0.0.1-alpha.102](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.1-alpha.101...@stream-io/video-react-sdk-0.0.1-alpha.102) (2023-05-31)
6
10
 
7
11
 
@@ -1,9 +1,11 @@
1
- /// <reference types="react" />
1
+ import { ComponentType } from 'react';
2
2
  export type ToggleAudioPreviewButtonProps = {
3
3
  caption?: string;
4
+ Menu?: ComponentType;
4
5
  };
5
- export declare const ToggleAudioPreviewButton: ({ caption, }: ToggleAudioPreviewButtonProps) => JSX.Element;
6
+ export declare const ToggleAudioPreviewButton: (props: ToggleAudioPreviewButtonProps) => JSX.Element;
6
7
  export type ToggleAudioPublishingButtonProps = {
7
8
  caption?: string;
9
+ Menu?: ComponentType;
8
10
  };
9
11
  export declare const ToggleAudioPublishingButton: (props: ToggleAudioPublishingButtonProps) => JSX.Element;
@@ -15,16 +15,17 @@ import { useMediaDevices } from '../../core';
15
15
  import { DeviceSelectorAudioInput } from '../DeviceSettings';
16
16
  import { CompositeButton, IconButton } from '../Button';
17
17
  import { PermissionNotification } from '../Notification';
18
- export const ToggleAudioPreviewButton = ({ caption, }) => {
18
+ export const ToggleAudioPreviewButton = (props) => {
19
19
  const { initialAudioEnabled, toggleInitialAudioMuteState } = useMediaDevices();
20
20
  const { t } = useI18n();
21
- return (_jsx(CompositeButton, Object.assign({ Menu: DeviceSelectorAudioInput, active: !initialAudioEnabled, caption: caption || t('Mic') }, { children: _jsx(IconButton, { icon: initialAudioEnabled ? 'mic' : 'mic-off', onClick: toggleInitialAudioMuteState }) })));
21
+ const { caption = t('Mic'), Menu = DeviceSelectorAudioInput } = props;
22
+ return (_jsx(CompositeButton, Object.assign({ Menu: Menu, active: !initialAudioEnabled, caption: caption || t('Mic') }, { children: _jsx(IconButton, { icon: initialAudioEnabled ? 'mic' : 'mic-off', onClick: toggleInitialAudioMuteState }) })));
22
23
  };
23
24
  export const ToggleAudioPublishingButton = (props) => {
24
25
  const { publishAudioStream, stopPublishingAudio, setInitialAudioEnabled } = useMediaDevices();
25
26
  const localParticipant = useLocalParticipant();
26
27
  const { t } = useI18n();
27
- const { caption = t('Mic') } = props;
28
+ const { caption = t('Mic'), Menu = DeviceSelectorAudioInput } = props;
28
29
  const isAudioMute = !(localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.publishedTracks.includes(SfuModels.TrackType.AUDIO));
29
30
  const call = useCall();
30
31
  const hasPermission = useHasPermissions(OwnCapability.SEND_AUDIO);
@@ -68,6 +69,6 @@ export const ToggleAudioPublishingButton = (props) => {
68
69
  setInitialAudioEnabled,
69
70
  stopPublishingAudio,
70
71
  ]);
71
- return (_jsx(Restricted, Object.assign({ requiredGrants: [OwnCapability.SEND_AUDIO] }, { children: _jsx(PermissionNotification, Object.assign({ permission: OwnCapability.SEND_AUDIO, isAwaitingApproval: isAwaitingApproval, messageApproved: "You can now speak.", messageAwaitingApproval: "Awaiting for an approval to speak.", messageRevoked: "You can no longer speak." }, { children: _jsx(CompositeButton, Object.assign({ Menu: DeviceSelectorAudioInput, active: isAudioMute, caption: caption }, { children: _jsx(IconButton, { icon: isAudioMute ? 'mic-off' : 'mic', onClick: handleClick }) })) })) })));
72
+ return (_jsx(Restricted, Object.assign({ requiredGrants: [OwnCapability.SEND_AUDIO] }, { children: _jsx(PermissionNotification, Object.assign({ permission: OwnCapability.SEND_AUDIO, isAwaitingApproval: isAwaitingApproval, messageApproved: "You can now speak.", messageAwaitingApproval: "Awaiting for an approval to speak.", messageRevoked: "You can no longer speak." }, { children: _jsx(CompositeButton, Object.assign({ Menu: Menu, active: isAudioMute, caption: caption }, { children: _jsx(IconButton, { icon: isAudioMute ? 'mic-off' : 'mic', onClick: handleClick }) })) })) })));
72
73
  };
73
74
  //# sourceMappingURL=ToggleAudioButton.js.map
@@ -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,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,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACvC,OAAO,GACuB,EAAE,EAAE;IAClC,MAAM,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,GACxD,eAAe,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;IAExB,OAAO,CACL,KAAC,eAAe,kBACd,IAAI,EAAE,wBAAwB,EAC9B,MAAM,EAAE,CAAC,mBAAmB,EAC5B,OAAO,EAAE,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,gBAE5B,KAAC,UAAU,IACT,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAA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EAAE,EAAE;gBAChB,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;YACL,OAAO;SACR;QACD,IAAI,WAAW,EAAE;YACf,IAAI,aAAa,EAAE;gBACjB,sBAAsB,CAAC,IAAI,CAAC,CAAC;gBAC7B,MAAM,kBAAkB,EAAE,CAAC;aAC5B;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;aACvE;SACF;aAAM;YACL,mBAAmB,EAAE,CAAC;SACvB;IACH,CAAC,CAAA,EAAE;QACD,IAAI;QACJ,aAAa;QACb,WAAW;QACX,kBAAkB;QAClB,sBAAsB;QACtB,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,oBAAoB,EACpC,uBAAuB,EAAC,oCAAoC,EAC5D,cAAc,EAAC,0BAA0B,gBAEzC,KAAC,eAAe,kBACd,IAAI,EAAE,wBAAwB,EAC9B,MAAM,EAAE,WAAW,EACnB,OAAO,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"}
1
+ {"version":3,"file":"ToggleAudioButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleAudioButton.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAiB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,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I;QACJ,aAAa;QACb,WAAW;QACX,kBAAkB;QAClB,sBAAsB;QACtB,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,oBAAoB,EACpC,uBAAuB,EAAC,oCAAoC,EAC5D,cAAc,EAAC,0BAA0B,gBAEzC,KAAC,eAAe,kBAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,gBAChE,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"}
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
1
+ import { ComponentType } from 'react';
2
2
  export type ToggleAudioOutputButtonProps = {
3
3
  caption?: string;
4
+ Menu?: ComponentType;
4
5
  };
5
- export declare const ToggleAudioOutputButton: ({ caption, }: ToggleAudioOutputButtonProps) => JSX.Element;
6
+ export declare const ToggleAudioOutputButton: (props: ToggleAudioOutputButtonProps) => JSX.Element;
@@ -2,8 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CompositeButton, IconButton } from '../Button';
3
3
  import { DeviceSelectorAudioOutput } from '../DeviceSettings';
4
4
  import { useI18n } from '@stream-io/video-react-bindings';
5
- export const ToggleAudioOutputButton = ({ caption, }) => {
5
+ export const ToggleAudioOutputButton = (props) => {
6
6
  const { t } = useI18n();
7
- return (_jsx(CompositeButton, Object.assign({ Menu: DeviceSelectorAudioOutput, active: true, caption: caption || t('Speakers') }, { children: _jsx(IconButton, { icon: "speaker" }) })));
7
+ const { caption = t('Speakers'), Menu = DeviceSelectorAudioOutput } = props;
8
+ return (_jsx(CompositeButton, Object.assign({ Menu: Menu, active: true, caption: caption }, { children: _jsx(IconButton, { icon: "speaker" }) })));
8
9
  };
9
10
  //# sourceMappingURL=ToggleAudioOutputButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleAudioOutputButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleAudioOutputButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAI1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,OAAO,GACsB,EAAE,EAAE;IACjC,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;IAExB,OAAO,CACL,KAAC,eAAe,kBACd,IAAI,EAAE,yBAAyB,EAC/B,MAAM,QACN,OAAO,EAAE,OAAO,IAAI,CAAC,CAAC,UAAU,CAAC,gBAEjC,KAAC,UAAU,IAAC,IAAI,EAAC,SAAS,GAAG,IACb,CACnB,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"ToggleAudioOutputButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleAudioOutputButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAQ1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,KAAmC,EACnC,EAAE;IACF,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;IACxB,MAAM,EAAE,OAAO,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,GAAG,yBAAyB,EAAE,GAAG,KAAK,CAAC;IAE5E,OAAO,CACL,KAAC,eAAe,kBAAC,IAAI,EAAE,IAAI,EAAE,MAAM,QAAC,OAAO,EAAE,OAAO,gBAClD,KAAC,UAAU,IAAC,IAAI,EAAC,SAAS,GAAG,IACb,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,10 +1,12 @@
1
- /// <reference types="react" />
1
+ import { ComponentType } from 'react';
2
2
  export type ToggleVideoPreviewButtonProps = {
3
3
  caption?: string;
4
+ Menu?: ComponentType;
4
5
  };
5
- export declare const ToggleVideoPreviewButton: ({ caption, }: ToggleVideoPreviewButtonProps) => JSX.Element;
6
+ export declare const ToggleVideoPreviewButton: (props: ToggleVideoPreviewButtonProps) => JSX.Element;
6
7
  type ToggleVideoPublishingButtonProps = {
7
8
  caption?: string;
9
+ Menu?: ComponentType;
8
10
  };
9
- export declare const ToggleVideoPublishingButton: ({ caption, }: ToggleVideoPublishingButtonProps) => JSX.Element;
11
+ export declare const ToggleVideoPublishingButton: (props: ToggleVideoPublishingButtonProps) => JSX.Element;
10
12
  export {};
@@ -9,20 +9,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { useCallback, useEffect, useState } from 'react';
12
- import { Restricted, useCall, useHasPermissions, useLocalParticipant, } from '@stream-io/video-react-bindings';
12
+ import { Restricted, useCall, useHasPermissions, useI18n, 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
15
  import { DEVICE_STATE, useMediaDevices } from '../../core';
16
16
  import { DeviceSelectorVideo } from '../DeviceSettings';
17
17
  import { PermissionNotification } from '../Notification';
18
- export const ToggleVideoPreviewButton = ({ caption = 'Video', }) => {
18
+ export const ToggleVideoPreviewButton = (props) => {
19
19
  const { toggleInitialVideoMuteState, initialVideoState } = useMediaDevices();
20
- return (_jsx(CompositeButton, Object.assign({ Menu: DeviceSelectorVideo, active: !initialVideoState.enabled, caption: caption }, { children: _jsx(IconButton, { icon: initialVideoState.enabled ? 'camera' : 'camera-off', onClick: toggleInitialVideoMuteState }) })));
20
+ const { t } = useI18n();
21
+ const { caption = t('Video'), Menu = DeviceSelectorVideo } = props;
22
+ return (_jsx(CompositeButton, Object.assign({ Menu: Menu, active: !initialVideoState.enabled, caption: caption }, { children: _jsx(IconButton, { icon: initialVideoState.enabled ? 'camera' : 'camera-off', onClick: toggleInitialVideoMuteState }) })));
21
23
  };
22
- export const ToggleVideoPublishingButton = ({ caption = 'Video', }) => {
24
+ export const ToggleVideoPublishingButton = (props) => {
23
25
  const { publishVideoStream, stopPublishingVideo, setInitialVideoState } = useMediaDevices();
24
26
  const localParticipant = useLocalParticipant();
27
+ const { t } = useI18n();
25
28
  const isVideoMute = !(localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.publishedTracks.includes(SfuModels.TrackType.VIDEO));
29
+ const { caption = t('Video'), Menu = DeviceSelectorVideo } = props;
26
30
  const call = useCall();
27
31
  const hasPermission = useHasPermissions(OwnCapability.SEND_VIDEO);
28
32
  const [isAwaitingApproval, setIsAwaitingApproval] = useState(false);
@@ -65,6 +69,6 @@ export const ToggleVideoPublishingButton = ({ caption = 'Video', }) => {
65
69
  setInitialVideoState,
66
70
  stopPublishingVideo,
67
71
  ]);
68
- 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 }) })) })) })));
72
+ 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: Menu, active: isVideoMute, caption: caption }, { children: _jsx(IconButton, { icon: isVideoMute ? 'camera-off' : 'camera', onClick: handleClick }) })) })) })));
69
73
  };
70
74
  //# sourceMappingURL=ToggleVideoButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleVideoButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleVideoButton.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,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACvC,OAAO,GAAG,OAAO,GACa,EAAE,EAAE;IAClC,MAAM,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,GAAG,eAAe,EAAE,CAAC;IAE7E,OAAO,CACL,KAAC,eAAe,kBACd,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAClC,OAAO,EAAE,OAAO,gBAEhB,KAAC,UAAU,IACT,IAAI,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C,2BAA2B,EAAE,MAAM,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;YACL,OAAO;SACR;QACD,IAAI,WAAW,EAAE;YACf,IAAI,aAAa,EAAE;gBACjB,oBAAoB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBAC3C,MAAM,kBAAkB,EAAE,CAAC;aAC5B;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;aAChE;SACF;aAAM;YACL,mBAAmB,EAAE,CAAC;SACvB;IACH,CAAC,CAAA,EAAE;QACD,IAAI;QACJ,aAAa;QACb,WAAW;QACX,kBAAkB;QAClB,oBAAoB;QACpB,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
+ {"version":3,"file":"ToggleVideoButton.js","sourceRoot":"","sources":["../../../../src/components/CallControls/ToggleVideoButton.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAiB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EACL,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,OAAO,EACP,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAE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a;QACb,WAAW;QACX,kBAAkB;QAClB,oBAAoB;QACpB,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,kBAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,gBAChE,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"}
@@ -16,8 +16,8 @@ export const SpeakingWhileMutedNotification = ({ children }) => {
16
16
  return;
17
17
  const disposeSoundDetector = getAudioStream({
18
18
  deviceId: audioDeviceId,
19
- }).then((audioStream) => createSoundDetector(audioStream, (isSpeechDetected) => {
20
- setIsSpeakingWhileMuted((isNotified) => isNotified ? isNotified : isSpeechDetected);
19
+ }).then((audioStream) => createSoundDetector(audioStream, ({ isSoundDetected }) => {
20
+ setIsSpeakingWhileMuted((isNotified) => isNotified ? isNotified : isSoundDetected);
21
21
  }));
22
22
  disposeSoundDetector.catch((err) => {
23
23
  console.error('Error while creating sound detector', err);
@@ -1 +1 @@
1
- {"version":3,"file":"SpeakingWhileMutedNotification.js","sourceRoot":"","sources":["../../../../src/components/Notification/SpeakingWhileMutedNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,mB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jB,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC;iBAC5B,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;YACL,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,oBAAoB;YAAE,OAAO;QAClC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,kBACX,OAAO,EAAC,iCAAiC,EACzC,SAAS,EAAE,oBAAoB,gBAE9B,QAAQ,IACI,CAChB,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"SpeakingWhileMutedNotification.js","sourceRoot":"","sources":["../../../../src/components/Notification/SpeakingWhileMutedNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,CAAC,MAAM,8BA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AG,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;YACL,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,oBAAoB;YAAE,OAAO;QAClC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3B,OAAO,CACL,KAAC,YAAY,kBACX,OAAO,EAAC,iCAAiC,EACzC,SAAS,EAAE,oBAAoB,gBAE9B,QAAQ,IACI,CAChB,CAAC;AACJ,CAAC,CAAC"}
@@ -4,6 +4,7 @@ export * from './CallControls';
4
4
  export * from './CallParticipantsList';
5
5
  export * from './CallRecordingList';
6
6
  export * from './DeviceSettings';
7
+ export * from './Icon';
7
8
  export * from './LoadingIndicator';
8
9
  export * from './Menu';
9
10
  export * from './Notification';
@@ -4,6 +4,7 @@ export * from './CallControls';
4
4
  export * from './CallParticipantsList';
5
5
  export * from './CallRecordingList';
6
6
  export * from './DeviceSettings';
7
+ export * from './Icon';
7
8
  export * from './LoadingIndicator';
8
9
  export * from './Menu';
9
10
  export * from './Notification';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,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.84",
29
- "@stream-io/video-client": "^0.0.2-alpha.13",
30
- "@stream-io/video-react-bindings": "^0.0.1-alpha.95",
28
+ "@stream-io/i18n": "^0.0.1-alpha.85",
29
+ "@stream-io/video-client": "^0.0.2-alpha.14",
30
+ "@stream-io/video-react-bindings": "^0.0.1-alpha.96",
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.79",
39
+ "@stream-io/video-styling": "^0.0.1-alpha.80",
40
40
  "@types/prop-types": "^15.7.5",
41
41
  "@types/rimraf": "^3.0.2",
42
42
  "prop-types": "^15.8.1",
@@ -47,5 +47,5 @@
47
47
  "typedoc": "^0.24.7",
48
48
  "typescript": "^4.9.5"
49
49
  },
50
- "version": "0.0.1-alpha.102"
50
+ "version": "0.0.1-alpha.103"
51
51
  }
@@ -1,4 +1,4 @@
1
- import { useCallback, useEffect, useState } from 'react';
1
+ import { ComponentType, useCallback, useEffect, useState } from 'react';
2
2
  import { OwnCapability, SfuModels } from '@stream-io/video-client';
3
3
  import {
4
4
  Restricted,
@@ -13,18 +13,22 @@ import { DeviceSelectorAudioInput } from '../DeviceSettings';
13
13
  import { CompositeButton, IconButton } from '../Button';
14
14
  import { PermissionNotification } from '../Notification';
15
15
 
16
- export type ToggleAudioPreviewButtonProps = { caption?: string };
16
+ export type ToggleAudioPreviewButtonProps = {
17
+ caption?: string;
18
+ Menu?: ComponentType;
19
+ };
17
20
 
18
- export const ToggleAudioPreviewButton = ({
19
- caption,
20
- }: ToggleAudioPreviewButtonProps) => {
21
+ export const ToggleAudioPreviewButton = (
22
+ props: ToggleAudioPreviewButtonProps,
23
+ ) => {
21
24
  const { initialAudioEnabled, toggleInitialAudioMuteState } =
22
25
  useMediaDevices();
23
26
  const { t } = useI18n();
27
+ const { caption = t('Mic'), Menu = DeviceSelectorAudioInput } = props;
24
28
 
25
29
  return (
26
30
  <CompositeButton
27
- Menu={DeviceSelectorAudioInput}
31
+ Menu={Menu}
28
32
  active={!initialAudioEnabled}
29
33
  caption={caption || t('Mic')}
30
34
  >
@@ -38,6 +42,7 @@ export const ToggleAudioPreviewButton = ({
38
42
 
39
43
  export type ToggleAudioPublishingButtonProps = {
40
44
  caption?: string;
45
+ Menu?: ComponentType;
41
46
  };
42
47
 
43
48
  export const ToggleAudioPublishingButton = (
@@ -48,7 +53,7 @@ export const ToggleAudioPublishingButton = (
48
53
  const localParticipant = useLocalParticipant();
49
54
  const { t } = useI18n();
50
55
 
51
- const { caption = t('Mic') } = props;
56
+ const { caption = t('Mic'), Menu = DeviceSelectorAudioInput } = props;
52
57
 
53
58
  const isAudioMute = !localParticipant?.publishedTracks.includes(
54
59
  SfuModels.TrackType.AUDIO,
@@ -107,11 +112,7 @@ export const ToggleAudioPublishingButton = (
107
112
  messageAwaitingApproval="Awaiting for an approval to speak."
108
113
  messageRevoked="You can no longer speak."
109
114
  >
110
- <CompositeButton
111
- Menu={DeviceSelectorAudioInput}
112
- active={isAudioMute}
113
- caption={caption}
114
- >
115
+ <CompositeButton Menu={Menu} active={isAudioMute} caption={caption}>
115
116
  <IconButton
116
117
  icon={isAudioMute ? 'mic-off' : 'mic'}
117
118
  onClick={handleClick}
@@ -1,20 +1,21 @@
1
1
  import { CompositeButton, IconButton } from '../Button';
2
2
  import { DeviceSelectorAudioOutput } from '../DeviceSettings';
3
3
  import { useI18n } from '@stream-io/video-react-bindings';
4
+ import { ComponentType } from 'react';
4
5
 
5
- export type ToggleAudioOutputButtonProps = { caption?: string };
6
+ export type ToggleAudioOutputButtonProps = {
7
+ caption?: string;
8
+ Menu?: ComponentType;
9
+ };
6
10
 
7
- export const ToggleAudioOutputButton = ({
8
- caption,
9
- }: ToggleAudioOutputButtonProps) => {
11
+ export const ToggleAudioOutputButton = (
12
+ props: ToggleAudioOutputButtonProps,
13
+ ) => {
10
14
  const { t } = useI18n();
15
+ const { caption = t('Speakers'), Menu = DeviceSelectorAudioOutput } = props;
11
16
 
12
17
  return (
13
- <CompositeButton
14
- Menu={DeviceSelectorAudioOutput}
15
- active
16
- caption={caption || t('Speakers')}
17
- >
18
+ <CompositeButton Menu={Menu} active caption={caption}>
18
19
  <IconButton icon="speaker" />
19
20
  </CompositeButton>
20
21
  );
@@ -1,8 +1,9 @@
1
- import { useCallback, useEffect, useState } from 'react';
1
+ import { ComponentType, useCallback, useEffect, useState } from 'react';
2
2
  import {
3
3
  Restricted,
4
4
  useCall,
5
5
  useHasPermissions,
6
+ useI18n,
6
7
  useLocalParticipant,
7
8
  } from '@stream-io/video-react-bindings';
8
9
 
@@ -12,16 +13,21 @@ import { DEVICE_STATE, useMediaDevices } from '../../core';
12
13
  import { DeviceSelectorVideo } from '../DeviceSettings';
13
14
  import { PermissionNotification } from '../Notification';
14
15
 
15
- export type ToggleVideoPreviewButtonProps = { caption?: string };
16
+ export type ToggleVideoPreviewButtonProps = {
17
+ caption?: string;
18
+ Menu?: ComponentType;
19
+ };
16
20
 
17
- export const ToggleVideoPreviewButton = ({
18
- caption = 'Video',
19
- }: ToggleVideoPreviewButtonProps) => {
21
+ export const ToggleVideoPreviewButton = (
22
+ props: ToggleVideoPreviewButtonProps,
23
+ ) => {
20
24
  const { toggleInitialVideoMuteState, initialVideoState } = useMediaDevices();
25
+ const { t } = useI18n();
26
+ const { caption = t('Video'), Menu = DeviceSelectorVideo } = props;
21
27
 
22
28
  return (
23
29
  <CompositeButton
24
- Menu={DeviceSelectorVideo}
30
+ Menu={Menu}
25
31
  active={!initialVideoState.enabled}
26
32
  caption={caption}
27
33
  >
@@ -35,17 +41,20 @@ export const ToggleVideoPreviewButton = ({
35
41
 
36
42
  type ToggleVideoPublishingButtonProps = {
37
43
  caption?: string;
44
+ Menu?: ComponentType;
38
45
  };
39
46
 
40
- export const ToggleVideoPublishingButton = ({
41
- caption = 'Video',
42
- }: ToggleVideoPublishingButtonProps) => {
47
+ export const ToggleVideoPublishingButton = (
48
+ props: ToggleVideoPublishingButtonProps,
49
+ ) => {
43
50
  const { publishVideoStream, stopPublishingVideo, setInitialVideoState } =
44
51
  useMediaDevices();
45
52
  const localParticipant = useLocalParticipant();
53
+ const { t } = useI18n();
46
54
  const isVideoMute = !localParticipant?.publishedTracks.includes(
47
55
  SfuModels.TrackType.VIDEO,
48
56
  );
57
+ const { caption = t('Video'), Menu = DeviceSelectorVideo } = props;
49
58
 
50
59
  const call = useCall();
51
60
  const hasPermission = useHasPermissions(OwnCapability.SEND_VIDEO);
@@ -100,11 +109,7 @@ export const ToggleVideoPublishingButton = ({
100
109
  messageAwaitingApproval="Awaiting for an approval to share your video."
101
110
  messageRevoked="You can no longer share your video."
102
111
  >
103
- <CompositeButton
104
- Menu={DeviceSelectorVideo}
105
- active={isVideoMute}
106
- caption={caption}
107
- >
112
+ <CompositeButton Menu={Menu} active={isVideoMute} caption={caption}>
108
113
  <IconButton
109
114
  icon={isVideoMute ? 'camera-off' : 'camera'}
110
115
  onClick={handleClick}
@@ -21,9 +21,9 @@ export const SpeakingWhileMutedNotification = ({ children }: ChildrenOnly) => {
21
21
  const disposeSoundDetector = getAudioStream({
22
22
  deviceId: audioDeviceId,
23
23
  }).then((audioStream) =>
24
- createSoundDetector(audioStream, (isSpeechDetected) => {
24
+ createSoundDetector(audioStream, ({ isSoundDetected }) => {
25
25
  setIsSpeakingWhileMuted((isNotified) =>
26
- isNotified ? isNotified : isSpeechDetected,
26
+ isNotified ? isNotified : isSoundDetected,
27
27
  );
28
28
  }),
29
29
  );
@@ -4,6 +4,7 @@ export * from './CallControls';
4
4
  export * from './CallParticipantsList';
5
5
  export * from './CallRecordingList';
6
6
  export * from './DeviceSettings';
7
+ export * from './Icon';
7
8
  export * from './LoadingIndicator';
8
9
  export * from './Menu';
9
10
  export * from './Notification';