@stream-io/video-react-native-sdk 0.0.1-alpha.232 → 0.0.1-alpha.234
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 +8 -0
- package/dist/__tests__/components/CallControlsView.test.js +3 -2
- package/dist/__tests__/components/CallControlsView.test.js.map +1 -1
- package/dist/__tests__/mocks/call.js +0 -2
- package/dist/__tests__/mocks/call.js.map +1 -1
- package/dist/src/components/CallControlsView.d.ts +31 -1
- package/dist/src/components/CallControlsView.js +2 -15
- package/dist/src/components/CallControlsView.js.map +1 -1
- package/dist/src/components/LobbyView.d.ts +21 -1
- package/dist/src/components/LobbyView.js +21 -53
- package/dist/src/components/LobbyView.js.map +1 -1
- package/dist/src/providers/StreamCall.d.ts +1 -1
- package/package.json +4 -4
- package/src/components/CallControlsView.tsx +35 -20
- package/src/components/LobbyView.tsx +51 -38
- package/src/providers/StreamCall.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.1-alpha.234](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.233...@stream-io/video-react-native-sdk-0.0.1-alpha.234) (2023-07-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [0.0.1-alpha.233](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.232...@stream-io/video-react-native-sdk-0.0.1-alpha.233) (2023-07-03)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
## [0.0.1-alpha.232](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.231...@stream-io/video-react-native-sdk-0.0.1-alpha.232) (2023-07-03)
|
|
6
14
|
|
|
7
15
|
|
|
@@ -68,12 +68,13 @@ describe('CallControlsView', () => {
|
|
|
68
68
|
userId: P_IDS.LOCAL_1,
|
|
69
69
|
}),
|
|
70
70
|
]);
|
|
71
|
-
|
|
71
|
+
const mockCallLeave = jest.fn();
|
|
72
|
+
(0, RNTLTools_1.render)(<components_1.CallControlsView hangUpCallButton={{ onPressHandler: mockCallLeave }}/>, {
|
|
72
73
|
call,
|
|
73
74
|
});
|
|
74
75
|
const button = await RNTLTools_1.screen.findByLabelText(A11yLabels_1.A11yButtons.HANG_UP_CALL);
|
|
75
76
|
RNTLTools_1.fireEvent.press(button);
|
|
76
|
-
expect(
|
|
77
|
+
expect(mockCallLeave).toHaveBeenCalled();
|
|
77
78
|
});
|
|
78
79
|
});
|
|
79
80
|
//# sourceMappingURL=CallControlsView.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallControlsView.test.js","sourceRoot":"","sources":["../../../__tests__/components/CallControlsView.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,4CAAqD;AACrD,uEAAmD;AACnD,+DAA6E;AAC7E,wCAAyC;AACzC,kDAAwE;AACxE,qDAAwD;AACxD,0DAAwD;AAExD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACzB,IAAI,CAAC,aAAa,EAAE,CAAC;AAErB,IAAK,KAEJ;AAFD,WAAK,KAAK;IACR,4BAAmB,CAAA;AACrB,CAAC,EAFI,KAAK,KAAL,KAAK,QAET;AAED,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,0FAA0F,EAAE,KAAK,IAAI,EAAE;QACxG,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAA,2BAAkB,GAAE,EAAE;YAC1C,IAAA,qBAAe,EAAC;gBACd,kBAAkB,EAAE,IAAI;gBACxB,SAAS,EAAE,KAAK,CAAC,OAAO;gBACxB,MAAM,EAAE,KAAK,CAAC,OAAO;aACtB,CAAC;SACH,CAAC,CAA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AAC,OAAO;aACtB,CAAC;SACH,EACD,CAAC,4BAAa,CAAC,eAAe,CAAC,CAChC,CAAC;QAEF,IAAA,kBAAM,EAAC,CAAC,6BAAgB,CAAC,AAAD,EAAG,EAAE;YAC3B,IAAI;SACL,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,kBAAM,CAAC,eAAe,CAAC,wBAAW,CAAC,QAAQ,CAAC,CAAC;QAElE,qBAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAExB,MAAM,CAAC,kBAAM,CAAC,cAAc,CAAC,2BAAc,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yEAAyE,EAAE,KAAK,IAAI,EAAE;QACvF,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAA,2BAAkB,GAAE,EAAE;YAC1C,IAAA,qBAAe,EAAC;gBACd,kBAAkB,EAAE,IAAI;gBACxB,SAAS,EAAE,KAAK,CAAC,OAAO;gBACxB,MAAM,EAAE,KAAK,CAAC,OAAO;aACtB,CAAC;SACH,CAAC,CAAC;QAEH,IAAA,kBAAM,
|
|
1
|
+
{"version":3,"file":"CallControlsView.test.js","sourceRoot":"","sources":["../../../__tests__/components/CallControlsView.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,4CAAqD;AACrD,uEAAmD;AACnD,+DAA6E;AAC7E,wCAAyC;AACzC,kDAAwE;AACxE,qDAAwD;AACxD,0DAAwD;AAExD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACzB,IAAI,CAAC,aAAa,EAAE,CAAC;AAErB,IAAK,KAEJ;AAFD,WAAK,KAAK;IACR,4BAAmB,CAAA;AACrB,CAAC,EAFI,KAAK,KAAL,KAAK,QAET;AAED,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,0FAA0F,EAAE,KAAK,IAAI,EAA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AAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAExB,MAAM,CAAC,aAAa,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -17,8 +17,6 @@ const mockCall = (client, participants, ownCapabilities) => {
|
|
|
17
17
|
]);
|
|
18
18
|
call.permissionsContext.setPermissions(ownCapabilities ?? []);
|
|
19
19
|
call.state.setOwnCapabilities(ownCapabilities ?? []);
|
|
20
|
-
// To handle the hang up call we need to mock the `leave` function
|
|
21
|
-
call.leave = jest.fn();
|
|
22
20
|
return call;
|
|
23
21
|
};
|
|
24
22
|
exports.mockCall = mockCall;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../__tests__/mocks/call.ts"],"names":[],"mappings":";;;;;;AAAA,0DAIiC;AACjC,gEAA4C;AAErC,MAAM,QAAQ,GAAG,CACtB,MAAyB,EACzB,YAAuC,EACvC,eAAiC,EACjC,EAAE;IACF,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,YAAY,IAAI,CAAC,IAAA,qBAAe,GAAE,CAAC,CAAC;IAC1D,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACrD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,EAAE,kBAAkB,CAAC,cAAc,CAAC;QACtC,4BAAa,CAAC,UAAU;QACxB,4BAAa,CAAC,UAAU;KACzB,CAAC,CAAC;IACH,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IAErD,
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../__tests__/mocks/call.ts"],"names":[],"mappings":";;;;;;AAAA,0DAIiC;AACjC,gEAA4C;AAErC,MAAM,QAAQ,GAAG,CACtB,MAAyB,EACzB,YAAuC,EACvC,eAAiC,EACjC,EAAE;IACF,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,YAAY,IAAI,CAAC,IAAA,qBAAe,GAAE,CAAC,CAAC;IAC1D,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACrD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,EAAE,kBAAkB,CAAC,cAAc,CAAC;QACtC,4BAAa,CAAC,UAAU;QACxB,4BAAa,CAAC,UAAU;KACzB,CAAC,CAAC;IACH,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IAErD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAjBW,QAAA,QAAQ,YAiBnB"}
|
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
import { ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* The props for the Chat Button in the Call Control View.
|
|
4
|
+
*/
|
|
2
5
|
type ChatButtonType = {
|
|
6
|
+
/**
|
|
7
|
+
* Handler to be called when the chat button is pressed.
|
|
8
|
+
* @returns void
|
|
9
|
+
*/
|
|
3
10
|
onPressHandler: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* The unread message indicator to be displayed above on the Chat button.
|
|
13
|
+
*/
|
|
4
14
|
unreadBadgeCountIndicator?: number;
|
|
5
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* The props for the Hang up call button in the Call Control View.
|
|
18
|
+
*/
|
|
19
|
+
type HangUpCallButtonType = {
|
|
20
|
+
/**
|
|
21
|
+
* Handler to be called when the hang up button is pressed.
|
|
22
|
+
* @returns void
|
|
23
|
+
*/
|
|
24
|
+
onPressHandler: () => void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Props for the CallControlsView Component.
|
|
28
|
+
*/
|
|
6
29
|
export interface CallControlsViewType extends Pick<ViewProps, 'style'> {
|
|
30
|
+
/**
|
|
31
|
+
* Chat Button Props to be passed as an object
|
|
32
|
+
*/
|
|
7
33
|
chatButton?: ChatButtonType;
|
|
34
|
+
/**
|
|
35
|
+
* Hang up call button props to be passed as an object
|
|
36
|
+
*/
|
|
37
|
+
hangUpCallButton?: HangUpCallButtonType;
|
|
8
38
|
}
|
|
9
39
|
/**
|
|
10
40
|
* Shows a list/row of controls (mute audio/video, toggle front/back camera, hangup call etc.)
|
|
@@ -14,5 +44,5 @@ export interface CallControlsViewType extends Pick<ViewProps, 'style'> {
|
|
|
14
44
|
* | :--- |
|
|
15
45
|
* |  |
|
|
16
46
|
*/
|
|
17
|
-
export declare const CallControlsView: ({ chatButton, style, }: CallControlsViewType) => JSX.Element;
|
|
47
|
+
export declare const CallControlsView: ({ chatButton, hangUpCallButton, style, }: CallControlsViewType) => JSX.Element;
|
|
18
48
|
export {};
|
|
@@ -45,22 +45,9 @@ const MediaStreamManagement_1 = require("../providers/MediaStreamManagement");
|
|
|
45
45
|
* | :--- |
|
|
46
46
|
* |  |
|
|
47
47
|
*/
|
|
48
|
-
const CallControlsView = ({ chatButton, style, }) => {
|
|
48
|
+
const CallControlsView = ({ chatButton, hangUpCallButton, style, }) => {
|
|
49
49
|
const [isReactionModalActive, setIsReactionModalActive] = (0, react_1.useState)(false);
|
|
50
50
|
const { isCameraOnFrontFacingMode, toggleCameraFacingMode } = (0, MediaStreamManagement_1.useMediaStreamManagement)();
|
|
51
|
-
const call = (0, video_react_bindings_1.useCall)();
|
|
52
|
-
const callingState = (0, video_react_bindings_1.useCallCallingState)();
|
|
53
|
-
const onCallHangup = async () => {
|
|
54
|
-
try {
|
|
55
|
-
if (callingState === video_client_1.CallingState.LEFT) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
await call?.leave();
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
console.log('Error Leaving call:', err);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
51
|
const muteStatusColor = (status) => {
|
|
65
52
|
return status ? theme_1.theme.light.overlay_dark : theme_1.theme.light.static_white;
|
|
66
53
|
};
|
|
@@ -89,7 +76,7 @@ const CallControlsView = ({ chatButton, style, }) => {
|
|
|
89
76
|
: theme_1.theme.light.static_white}/>
|
|
90
77
|
</CallControlsButton_1.CallControlsButton>
|
|
91
78
|
</video_react_bindings_1.Restricted>
|
|
92
|
-
<CallControlsButton_1.CallControlsButton onPress={
|
|
79
|
+
<CallControlsButton_1.CallControlsButton onPress={hangUpCallButton?.onPressHandler} color={theme_1.theme.light.error} style={[styles.button, { shadowColor: theme_1.theme.light.error }]} accessibilityLabel={A11yLabels_1.A11yButtons.HANG_UP_CALL}>
|
|
93
80
|
<icons_1.PhoneDown color={theme_1.theme.light.static_white}/>
|
|
94
81
|
</CallControlsButton_1.CallControlsButton>
|
|
95
82
|
</react_native_1.View>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallControlsView.js","sourceRoot":"","sources":["../../../src/components/CallControlsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,+CAAiE;AACjE,oCAAmE;AACnE,6DAA0D;AAC1D,oCAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"CallControlsView.js","sourceRoot":"","sources":["../../../src/components/CallControlsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,+CAAiE;AACjE,oCAAmE;AACnE,6DAA0D;AAC1D,oCAAiC;AACjC,0DAAwD;AACxD,0EAA6D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,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI;QAElB,cAAc;QACd,SAAS,EAAE,CAAC;KACb;IACD,iBAAiB,EAAE;QACjB,UAAU,EAAE,aAAK,CAAC,OAAO,CAAC,EAAE;KAC7B;IACD,SAAS,EAAE;QACT,eAAe,EAAE,aAAK,CAAC,KAAK,CAAC,KAAK;QAClC,YAAY,EAAE,aAAK,CAAC,OAAO,CAAC,EAAE;QAC9B,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,mBAAO,CAAC,QAAQ;QACxB,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,QAAQ;KACzB;IACD,aAAa,EAAE;QACb,KAAK,EAAE,aAAK,CAAC,KAAK,CAAC,YAAY;QAC/B,SAAS,EAAE,QAAQ;QACnB,GAAG,aAAK,CAAC,KAAK,CAAC,QAAQ;KACxB;CACF,CAAC,CAAC"}
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The props for the Join Button in the LobbyView.
|
|
3
|
+
*/
|
|
4
|
+
type JoinButton = {
|
|
5
|
+
/**
|
|
6
|
+
* Handler called when the join button is clicked in the LobbyView.
|
|
7
|
+
* @returns void
|
|
8
|
+
*/
|
|
9
|
+
onPressHandler: () => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Props for the Lobby View Component
|
|
13
|
+
*/
|
|
14
|
+
type LobbyViewType = {
|
|
15
|
+
/**
|
|
16
|
+
* Join button props to be passed as an object
|
|
17
|
+
*/
|
|
18
|
+
joinButton: JoinButton;
|
|
19
|
+
};
|
|
20
|
+
export declare const LobbyView: ({ joinButton }: LobbyViewType) => JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.LobbyView = void 0;
|
|
27
|
-
const react_1 =
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
28
8
|
const react_native_1 = require("react-native");
|
|
29
9
|
const icons_1 = require("../icons");
|
|
30
10
|
const video_react_bindings_1 = require("@stream-io/video-react-bindings");
|
|
@@ -33,26 +13,9 @@ const theme_1 = require("../theme");
|
|
|
33
13
|
const hooks_1 = require("../hooks");
|
|
34
14
|
const VideoRenderer_1 = require("./VideoRenderer");
|
|
35
15
|
const Avatar_1 = require("./Avatar");
|
|
36
|
-
const video_client_1 = require("@stream-io/video-client");
|
|
37
16
|
const constants_1 = require("../constants");
|
|
38
17
|
const MediaStreamManagement_1 = require("../providers/MediaStreamManagement");
|
|
39
|
-
const
|
|
40
|
-
const connectedUser = (0, video_react_bindings_1.useConnectedUser)();
|
|
41
|
-
const participantLabel = connectedUser?.name ?? connectedUser?.id;
|
|
42
|
-
const { initialAudioEnabled, initialVideoEnabled } = (0, MediaStreamManagement_1.useMediaStreamManagement)();
|
|
43
|
-
return (<react_native_1.View style={styles.status}>
|
|
44
|
-
<react_native_1.Text style={styles.userNameLabel} numberOfLines={1}>
|
|
45
|
-
{participantLabel}
|
|
46
|
-
</react_native_1.Text>
|
|
47
|
-
{!initialAudioEnabled && (<react_native_1.View style={[styles.svgContainerStyle, theme_1.theme.icon.xs]}>
|
|
48
|
-
<icons_1.MicOff color={theme_1.theme.light.error}/>
|
|
49
|
-
</react_native_1.View>)}
|
|
50
|
-
{!initialVideoEnabled && (<react_native_1.View style={[styles.svgContainerStyle, theme_1.theme.icon.xs]}>
|
|
51
|
-
<icons_1.VideoSlash color={theme_1.theme.light.error}/>
|
|
52
|
-
</react_native_1.View>)}
|
|
53
|
-
</react_native_1.View>);
|
|
54
|
-
};
|
|
55
|
-
const LobbyView = () => {
|
|
18
|
+
const LobbyView = ({ joinButton }) => {
|
|
56
19
|
const localVideoStream = (0, hooks_1.useLocalVideoStream)();
|
|
57
20
|
const connectedUser = (0, video_react_bindings_1.useConnectedUser)();
|
|
58
21
|
const { initialAudioEnabled, initialVideoEnabled, toggleInitialAudioMuteState, toggleInitialVideoMuteState, isCameraOnFrontFacingMode, } = (0, MediaStreamManagement_1.useMediaStreamManagement)();
|
|
@@ -61,17 +24,6 @@ const LobbyView = () => {
|
|
|
61
24
|
const call = (0, video_react_bindings_1.useCall)();
|
|
62
25
|
const MicIcon = !initialAudioEnabled ? (<icons_1.MicOff color={theme_1.theme.light.static_white}/>) : (<icons_1.Mic color={theme_1.theme.light.static_black}/>);
|
|
63
26
|
const VideoIcon = !initialVideoEnabled ? (<icons_1.VideoSlash color={theme_1.theme.light.static_white}/>) : (<icons_1.Video color={theme_1.theme.light.static_black}/>);
|
|
64
|
-
const onJoinCallHandler = (0, react_1.useCallback)(async () => {
|
|
65
|
-
try {
|
|
66
|
-
await call?.join({ create: true });
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
console.log('Error joining call:', error);
|
|
70
|
-
if (error instanceof video_client_1.AxiosError) {
|
|
71
|
-
react_native_1.Alert.alert(error.response?.data.message);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}, [call]);
|
|
75
27
|
const connectedUserAsParticipant = {
|
|
76
28
|
userId: connectedUser?.id,
|
|
77
29
|
image: connectedUser?.image,
|
|
@@ -118,7 +70,7 @@ const LobbyView = () => {
|
|
|
118
70
|
? `${count} more people are in the call now.`
|
|
119
71
|
: 'You are first to Join the call.'}
|
|
120
72
|
</react_native_1.Text>
|
|
121
|
-
<react_native_1.Pressable style={styles.joinButton} onPress={
|
|
73
|
+
<react_native_1.Pressable style={styles.joinButton} onPress={joinButton.onPressHandler}>
|
|
122
74
|
<react_native_1.Text style={styles.joinButtonText}>Join</react_native_1.Text>
|
|
123
75
|
</react_native_1.Pressable>
|
|
124
76
|
</react_native_1.View>
|
|
@@ -126,6 +78,22 @@ const LobbyView = () => {
|
|
|
126
78
|
</react_native_1.View>);
|
|
127
79
|
};
|
|
128
80
|
exports.LobbyView = LobbyView;
|
|
81
|
+
const ParticipantStatus = () => {
|
|
82
|
+
const connectedUser = (0, video_react_bindings_1.useConnectedUser)();
|
|
83
|
+
const participantLabel = connectedUser?.name ?? connectedUser?.id;
|
|
84
|
+
const { initialAudioEnabled, initialVideoEnabled } = (0, MediaStreamManagement_1.useMediaStreamManagement)();
|
|
85
|
+
return (<react_native_1.View style={styles.status}>
|
|
86
|
+
<react_native_1.Text style={styles.userNameLabel} numberOfLines={1}>
|
|
87
|
+
{participantLabel}
|
|
88
|
+
</react_native_1.Text>
|
|
89
|
+
{!initialAudioEnabled && (<react_native_1.View style={[styles.svgContainerStyle, theme_1.theme.icon.xs]}>
|
|
90
|
+
<icons_1.MicOff color={theme_1.theme.light.error}/>
|
|
91
|
+
</react_native_1.View>)}
|
|
92
|
+
{!initialVideoEnabled && (<react_native_1.View style={[styles.svgContainerStyle, theme_1.theme.icon.xs]}>
|
|
93
|
+
<icons_1.VideoSlash color={theme_1.theme.light.error}/>
|
|
94
|
+
</react_native_1.View>)}
|
|
95
|
+
</react_native_1.View>);
|
|
96
|
+
};
|
|
129
97
|
const styles = react_native_1.StyleSheet.create({
|
|
130
98
|
container: {
|
|
131
99
|
flex: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LobbyView.js","sourceRoot":"","sources":["../../../src/components/LobbyView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LobbyView.js","sourceRoot":"","sources":["../../../src/components/LobbyView.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAiE;AACjE,oCAA0D;AAC1D,0EAIyC;AACzC,6DAA0D;AAC1D,oCAAiC;AACjC,oCAA+C;AAC/C,mDAAgD;AAChD,qCAAkC;AAElC,4CAAsD;AACtD,8EAA8E;AAuBvE,MAAM,SAAS,GAAG,CAAC,EAAE,UAAU,EAAiB,EAAE,EAAE;IACzD,MAAM,gBAAgB,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC/C,MAAM,aAAa,GAAG,IAAA,uCAAgB,GAAE,CAAC;IACzC,MAAM,EACJ,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,GAC1B,GAAG,IAAA,gDAAwB,GAAE,CAAC;IAC/B,MAAM,gBAAgB,GAAG,CAAC,CAAC,gBAAgB,IAAI,mBAAmB,CAAC;IACnE,MAAM,KAAK,GAAG,IAAA,0CAAmB,GAAE,CAAC;IACpC,MAAM,IAAI,GAAG,IAAA,8BAAO,GAAE,CAAC;IAEvB,MAAM,OAAO,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,CACrC,CAAC,cAAM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QACvB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,aAAK,CAAC,OAAO,CAAC,EAAE;QACzB,YAAY,EAAE,aAAK,CAAC,OAAO,CAAC,EAAE;QAC9B,eAAe,EAAE,aAAK,CAAC,KAAK,CAAC,cAAc;KAC5C;IACD,MAAM,EAAE;QACN,MAAM,EAAE,aAAK,CAAC,MAAM,CAAC,EAAE;QACvB,KAAK,EAAE,aAAK,CAAC,MAAM,CAAC,EAAE;QACtB,YAAY,EAAE,aAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC;QACjC,SAAS,EAAE,QAAQ;KACpB;IACD,aAAa,EAAE;QACb,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,aAAK,CAAC,KAAK,CAAC,YAAY;QAC/B,GAAG,aAAK,CAAC,KAAK,CAAC,OAAO;KACvB;IACD,iBAAiB,EAAE;QACjB,UAAU,EAAE,aAAK,CAAC,MAAM,CAAC,EAAE;KAC5B;CACF,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { Call } from '@stream-io/video-client';
|
|
3
3
|
export type StreamCallProps = {
|
|
4
4
|
call: Call;
|
|
5
|
-
callCycleHandlers
|
|
5
|
+
callCycleHandlers?: CallCycleHandlersType;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* StreamCall is a wrapper component that orchestrates the call life cycle logic and
|
package/package.json
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"CHANGELOG.md"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@stream-io/i18n": "^0.0.
|
|
25
|
-
"@stream-io/video-client": "^0.0.
|
|
26
|
-
"@stream-io/video-react-bindings": "^0.0.
|
|
24
|
+
"@stream-io/i18n": "^0.0.8",
|
|
25
|
+
"@stream-io/video-client": "^0.0.29",
|
|
26
|
+
"@stream-io/video-react-bindings": "^0.0.31"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@notifee/react-native": ">=7.7.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"typedoc-plugin-markdown": "^3.15.3",
|
|
86
86
|
"typescript": "^4.9.5"
|
|
87
87
|
},
|
|
88
|
-
"version": "0.0.1-alpha.
|
|
88
|
+
"version": "0.0.1-alpha.234"
|
|
89
89
|
}
|
|
@@ -3,12 +3,8 @@ import { StyleSheet, Text, View, ViewProps } from 'react-native';
|
|
|
3
3
|
import { CameraSwitch, Chat, PhoneDown, Reaction } from '../icons';
|
|
4
4
|
import { CallControlsButton } from './CallControlsButton';
|
|
5
5
|
import { theme } from '../theme';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
Restricted,
|
|
9
|
-
useCall,
|
|
10
|
-
useCallCallingState,
|
|
11
|
-
} from '@stream-io/video-react-bindings';
|
|
6
|
+
import { OwnCapability } from '@stream-io/video-client';
|
|
7
|
+
import { Restricted } from '@stream-io/video-react-bindings';
|
|
12
8
|
import { ReactionModal } from './ReactionsModal';
|
|
13
9
|
import { ToggleAudioButton } from './ToggleAudioButton';
|
|
14
10
|
import { ToggleVideoButton } from './ToggleVideoButton';
|
|
@@ -16,13 +12,44 @@ import { A11yButtons, A11yComponents } from '../constants/A11yLabels';
|
|
|
16
12
|
import { Z_INDEX } from '../constants';
|
|
17
13
|
import { useMediaStreamManagement } from '../providers/MediaStreamManagement';
|
|
18
14
|
|
|
15
|
+
/**
|
|
16
|
+
* The props for the Chat Button in the Call Control View.
|
|
17
|
+
*/
|
|
19
18
|
type ChatButtonType = {
|
|
19
|
+
/**
|
|
20
|
+
* Handler to be called when the chat button is pressed.
|
|
21
|
+
* @returns void
|
|
22
|
+
*/
|
|
20
23
|
onPressHandler: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* The unread message indicator to be displayed above on the Chat button.
|
|
26
|
+
*/
|
|
21
27
|
unreadBadgeCountIndicator?: number;
|
|
22
28
|
};
|
|
23
29
|
|
|
30
|
+
/**
|
|
31
|
+
* The props for the Hang up call button in the Call Control View.
|
|
32
|
+
*/
|
|
33
|
+
type HangUpCallButtonType = {
|
|
34
|
+
/**
|
|
35
|
+
* Handler to be called when the hang up button is pressed.
|
|
36
|
+
* @returns void
|
|
37
|
+
*/
|
|
38
|
+
onPressHandler: () => void;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Props for the CallControlsView Component.
|
|
43
|
+
*/
|
|
24
44
|
export interface CallControlsViewType extends Pick<ViewProps, 'style'> {
|
|
45
|
+
/**
|
|
46
|
+
* Chat Button Props to be passed as an object
|
|
47
|
+
*/
|
|
25
48
|
chatButton?: ChatButtonType;
|
|
49
|
+
/**
|
|
50
|
+
* Hang up call button props to be passed as an object
|
|
51
|
+
*/
|
|
52
|
+
hangUpCallButton?: HangUpCallButtonType;
|
|
26
53
|
}
|
|
27
54
|
|
|
28
55
|
/**
|
|
@@ -35,6 +62,7 @@ export interface CallControlsViewType extends Pick<ViewProps, 'style'> {
|
|
|
35
62
|
*/
|
|
36
63
|
export const CallControlsView = ({
|
|
37
64
|
chatButton,
|
|
65
|
+
hangUpCallButton,
|
|
38
66
|
style,
|
|
39
67
|
}: CallControlsViewType) => {
|
|
40
68
|
const [isReactionModalActive, setIsReactionModalActive] =
|
|
@@ -42,19 +70,6 @@ export const CallControlsView = ({
|
|
|
42
70
|
|
|
43
71
|
const { isCameraOnFrontFacingMode, toggleCameraFacingMode } =
|
|
44
72
|
useMediaStreamManagement();
|
|
45
|
-
const call = useCall();
|
|
46
|
-
const callingState = useCallCallingState();
|
|
47
|
-
|
|
48
|
-
const onCallHangup = async () => {
|
|
49
|
-
try {
|
|
50
|
-
if (callingState === CallingState.LEFT) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
await call?.leave();
|
|
54
|
-
} catch (err) {
|
|
55
|
-
console.log('Error Leaving call:', err);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
73
|
|
|
59
74
|
const muteStatusColor = (status: boolean) => {
|
|
60
75
|
return status ? theme.light.overlay_dark : theme.light.static_white;
|
|
@@ -113,7 +128,7 @@ export const CallControlsView = ({
|
|
|
113
128
|
</CallControlsButton>
|
|
114
129
|
</Restricted>
|
|
115
130
|
<CallControlsButton
|
|
116
|
-
onPress={
|
|
131
|
+
onPress={hangUpCallButton?.onPressHandler}
|
|
117
132
|
color={theme.light.error}
|
|
118
133
|
style={[styles.button, { shadowColor: theme.light.error }]}
|
|
119
134
|
accessibilityLabel={A11yButtons.HANG_UP_CALL}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import { Mic, MicOff, Video, VideoSlash } from '../icons';
|
|
4
4
|
import {
|
|
5
5
|
useCall,
|
|
@@ -11,35 +11,32 @@ import { theme } from '../theme';
|
|
|
11
11
|
import { useLocalVideoStream } from '../hooks';
|
|
12
12
|
import { VideoRenderer } from './VideoRenderer';
|
|
13
13
|
import { Avatar } from './Avatar';
|
|
14
|
-
import {
|
|
14
|
+
import { StreamVideoParticipant } from '@stream-io/video-client';
|
|
15
15
|
import { LOCAL_VIDEO_VIEW_STYLE } from '../constants';
|
|
16
16
|
import { useMediaStreamManagement } from '../providers/MediaStreamManagement';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</Text>
|
|
28
|
-
{!initialAudioEnabled && (
|
|
29
|
-
<View style={[styles.svgContainerStyle, theme.icon.xs]}>
|
|
30
|
-
<MicOff color={theme.light.error} />
|
|
31
|
-
</View>
|
|
32
|
-
)}
|
|
33
|
-
{!initialVideoEnabled && (
|
|
34
|
-
<View style={[styles.svgContainerStyle, theme.icon.xs]}>
|
|
35
|
-
<VideoSlash color={theme.light.error} />
|
|
36
|
-
</View>
|
|
37
|
-
)}
|
|
38
|
-
</View>
|
|
39
|
-
);
|
|
18
|
+
/**
|
|
19
|
+
* The props for the Join Button in the LobbyView.
|
|
20
|
+
*/
|
|
21
|
+
type JoinButton = {
|
|
22
|
+
/**
|
|
23
|
+
* Handler called when the join button is clicked in the LobbyView.
|
|
24
|
+
* @returns void
|
|
25
|
+
*/
|
|
26
|
+
onPressHandler: () => void;
|
|
40
27
|
};
|
|
41
28
|
|
|
42
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Props for the Lobby View Component
|
|
31
|
+
*/
|
|
32
|
+
type LobbyViewType = {
|
|
33
|
+
/**
|
|
34
|
+
* Join button props to be passed as an object
|
|
35
|
+
*/
|
|
36
|
+
joinButton: JoinButton;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const LobbyView = ({ joinButton }: LobbyViewType) => {
|
|
43
40
|
const localVideoStream = useLocalVideoStream();
|
|
44
41
|
const connectedUser = useConnectedUser();
|
|
45
42
|
const {
|
|
@@ -64,17 +61,6 @@ export const LobbyView = () => {
|
|
|
64
61
|
<Video color={theme.light.static_black} />
|
|
65
62
|
);
|
|
66
63
|
|
|
67
|
-
const onJoinCallHandler = useCallback(async () => {
|
|
68
|
-
try {
|
|
69
|
-
await call?.join({ create: true });
|
|
70
|
-
} catch (error) {
|
|
71
|
-
console.log('Error joining call:', error);
|
|
72
|
-
if (error instanceof AxiosError) {
|
|
73
|
-
Alert.alert(error.response?.data.message);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, [call]);
|
|
77
|
-
|
|
78
64
|
const connectedUserAsParticipant = {
|
|
79
65
|
userId: connectedUser?.id,
|
|
80
66
|
image: connectedUser?.image,
|
|
@@ -143,7 +129,10 @@ export const LobbyView = () => {
|
|
|
143
129
|
? `${count} more people are in the call now.`
|
|
144
130
|
: 'You are first to Join the call.'}
|
|
145
131
|
</Text>
|
|
146
|
-
<Pressable
|
|
132
|
+
<Pressable
|
|
133
|
+
style={styles.joinButton}
|
|
134
|
+
onPress={joinButton.onPressHandler}
|
|
135
|
+
>
|
|
147
136
|
<Text style={styles.joinButtonText}>Join</Text>
|
|
148
137
|
</Pressable>
|
|
149
138
|
</View>
|
|
@@ -152,6 +141,30 @@ export const LobbyView = () => {
|
|
|
152
141
|
);
|
|
153
142
|
};
|
|
154
143
|
|
|
144
|
+
const ParticipantStatus = () => {
|
|
145
|
+
const connectedUser = useConnectedUser();
|
|
146
|
+
const participantLabel = connectedUser?.name ?? connectedUser?.id;
|
|
147
|
+
const { initialAudioEnabled, initialVideoEnabled } =
|
|
148
|
+
useMediaStreamManagement();
|
|
149
|
+
return (
|
|
150
|
+
<View style={styles.status}>
|
|
151
|
+
<Text style={styles.userNameLabel} numberOfLines={1}>
|
|
152
|
+
{participantLabel}
|
|
153
|
+
</Text>
|
|
154
|
+
{!initialAudioEnabled && (
|
|
155
|
+
<View style={[styles.svgContainerStyle, theme.icon.xs]}>
|
|
156
|
+
<MicOff color={theme.light.error} />
|
|
157
|
+
</View>
|
|
158
|
+
)}
|
|
159
|
+
{!initialVideoEnabled && (
|
|
160
|
+
<View style={[styles.svgContainerStyle, theme.icon.xs]}>
|
|
161
|
+
<VideoSlash color={theme.light.error} />
|
|
162
|
+
</View>
|
|
163
|
+
)}
|
|
164
|
+
</View>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
155
168
|
const styles = StyleSheet.create({
|
|
156
169
|
container: {
|
|
157
170
|
flex: 1,
|
|
@@ -11,7 +11,7 @@ import { MediaStreamManagement } from './MediaStreamManagement';
|
|
|
11
11
|
|
|
12
12
|
export type StreamCallProps = {
|
|
13
13
|
call: Call;
|
|
14
|
-
callCycleHandlers
|
|
14
|
+
callCycleHandlers?: CallCycleHandlersType;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* StreamCall is a wrapper component that orchestrates the call life cycle logic and
|