@stream-io/video-react-bindings 0.1.17 → 0.2.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 CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.2.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.1.18...@stream-io/video-react-bindings-0.2.0) (2023-08-16)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@stream-io/video-client` updated to version `0.1.0`
10
+
11
+ ### ⚠ BREAKING CHANGES
12
+
13
+ * Call State reorganization (#931)
14
+
15
+ ### Features
16
+
17
+ * Call State reorganization ([#931](https://github.com/GetStream/stream-video-js/issues/931)) ([441dbd4](https://github.com/GetStream/stream-video-js/commit/441dbd4ffb8c851abb0ca719be143a1e80d1418c)), closes [#917](https://github.com/GetStream/stream-video-js/issues/917)
18
+
19
+ ### [0.1.18](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.1.17...@stream-io/video-react-bindings-0.1.18) (2023-08-14)
20
+
21
+ ### Dependency Updates
22
+
23
+ * `@stream-io/video-client` updated to version `0.1.0`
5
24
  ### [0.1.17](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.1.16...@stream-io/video-react-bindings-0.1.17) (2023-08-11)
6
25
 
7
26
 
@@ -1,4 +1,4 @@
1
- import { CallState, Comparator, StreamVideoParticipant } from '@stream-io/video-client';
1
+ import { CallIngressResponse, CallSessionResponse, CallSettingsResponse, CallState, CallStatsReport, Comparator, EgressResponse, MemberResponse, StreamVideoParticipant, UserResponse } from '@stream-io/video-client';
2
2
  /**
3
3
  * Utility hook, which provides the current call's state.
4
4
  *
@@ -23,6 +23,58 @@ export declare const useIsCallBroadcastingInProgress: () => boolean;
23
23
  * @category Call State
24
24
  */
25
25
  export declare const useIsCallLive: () => boolean;
26
+ /**
27
+ * Returns the list of blocked users in the current call.
28
+ */
29
+ export declare const useCallBlockedUserIds: () => string[];
30
+ /**
31
+ * Returns the timestamp when this call was created.
32
+ */
33
+ export declare const useCallCreatedAt: () => Date | undefined;
34
+ /**
35
+ * Returns the timestamp when this call was ended.
36
+ */
37
+ export declare const useCallEndedAt: () => Date | undefined;
38
+ /**
39
+ * Returns the timestamp telling when the call is scheduled to start.
40
+ */
41
+ export declare const useCallStartsAt: () => Date | undefined;
42
+ /**
43
+ * Returns the timestamp when this call was updated.
44
+ */
45
+ export declare const useCallUpdatedAt: () => Date | undefined;
46
+ /**
47
+ * Returns the information about the call's creator.
48
+ */
49
+ export declare const useCallCreatedBy: () => UserResponse | undefined;
50
+ /**
51
+ * Returns the call's custom data.
52
+ */
53
+ export declare const useCallCustomData: () => Record<string, any>;
54
+ /**
55
+ * Returns the call's Egress information.
56
+ */
57
+ export declare const useCallEgress: () => EgressResponse | undefined;
58
+ /**
59
+ * Returns the call's Ingress information.
60
+ */
61
+ export declare const useCallIngress: () => CallIngressResponse | undefined;
62
+ /**
63
+ * Returns the data for the current call session.
64
+ */
65
+ export declare const useCallSession: () => CallSessionResponse | undefined;
66
+ /**
67
+ * Returns the call's settings.
68
+ */
69
+ export declare const useCallSettings: () => CallSettingsResponse | undefined;
70
+ /**
71
+ * Returns whether the call has transcribing enabled.
72
+ */
73
+ export declare const useIsCallTranscribingInProgress: () => boolean;
74
+ /**
75
+ * Returns information about the user who has marked this call as ended.
76
+ */
77
+ export declare const useCallEndedBy: () => UserResponse | undefined;
26
78
  /**
27
79
  * Utility hook which provides a boolean indicating whether there is
28
80
  * a participant in the current call which shares their screen.
@@ -42,32 +94,19 @@ export declare const useHasOngoingScreenShare: () => boolean;
42
94
  *
43
95
  * @category Call State
44
96
  */
45
- export declare const useCallStatsReport: () => import("@stream-io/video-client").CallStatsReport | undefined;
97
+ export declare const useCallStatsReport: () => CallStatsReport | undefined;
46
98
  /**
47
99
  * Utility hook which provides the dominant speaker of the current call.
48
100
  *
49
101
  * @category Call State
50
102
  */
51
103
  export declare const useDominantSpeaker: () => StreamVideoParticipant | undefined;
52
- /**
53
- * Utility hook which provides call metadata (such as blocked users and own capabilities).
54
- *
55
- * @category Call State
56
- * @deprecated will be removed in the next major release and replaced with more specific hooks.
57
- */
58
- export declare const useCallMetadata: () => import("@stream-io/video-client").CallResponse | undefined;
59
104
  /**
60
105
  * Utility hook which provides a list of call members.
61
106
  *
62
107
  * @category Call State
63
108
  */
64
- export declare const useCallMembers: () => import("@stream-io/video-client").MemberResponse[];
65
- /**
66
- * Utility hook providing the latest list of recordings performed during the active call
67
- *
68
- * @category Call State
69
- */
70
- export declare const useCallRecordings: () => import("@stream-io/video-client").CallRecording[];
109
+ export declare const useCallMembers: () => MemberResponse[];
71
110
  /**
72
111
  * Utility hook providing the current calling state of the call. For example, `RINGING` or `JOINED`.
73
112
  *
@@ -25,8 +25,8 @@ export const useCallState = () => {
25
25
  * @category Call State
26
26
  */
27
27
  export const useIsCallRecordingInProgress = () => {
28
- const metadata = useCallMetadata();
29
- return !!(metadata === null || metadata === void 0 ? void 0 : metadata.recording);
28
+ const { recording$ } = useCallState();
29
+ return useObservableValue(recording$);
30
30
  };
31
31
  /**
32
32
  * Utility hook which provides information whether the current call is broadcasting.
@@ -34,8 +34,11 @@ export const useIsCallRecordingInProgress = () => {
34
34
  * @category Call State
35
35
  */
36
36
  export const useIsCallBroadcastingInProgress = () => {
37
- const metadata = useCallMetadata();
38
- return !!(metadata === null || metadata === void 0 ? void 0 : metadata.egress.broadcasting);
37
+ const { egress$ } = useCallState();
38
+ const egress = useObservableValue(egress$);
39
+ if (!egress)
40
+ return false;
41
+ return egress.broadcasting;
39
42
  };
40
43
  /**
41
44
  * Utility hook which provides information whether the current call is live.
@@ -43,10 +46,99 @@ export const useIsCallBroadcastingInProgress = () => {
43
46
  * @category Call State
44
47
  */
45
48
  export const useIsCallLive = () => {
46
- const metadata = useCallMetadata();
47
- if (!metadata)
48
- return false;
49
- return !(metadata === null || metadata === void 0 ? void 0 : metadata.backstage);
49
+ const { backstage$ } = useCallState();
50
+ return useObservableValue(backstage$);
51
+ };
52
+ /**
53
+ * Returns the list of blocked users in the current call.
54
+ */
55
+ export const useCallBlockedUserIds = () => {
56
+ const { blockedUserIds$ } = useCallState();
57
+ return useObservableValue(blockedUserIds$);
58
+ };
59
+ /**
60
+ * Returns the timestamp when this call was created.
61
+ */
62
+ export const useCallCreatedAt = () => {
63
+ const { createdAt$ } = useCallState();
64
+ return useObservableValue(createdAt$);
65
+ };
66
+ /**
67
+ * Returns the timestamp when this call was ended.
68
+ */
69
+ export const useCallEndedAt = () => {
70
+ const { endedAt$ } = useCallState();
71
+ return useObservableValue(endedAt$);
72
+ };
73
+ /**
74
+ * Returns the timestamp telling when the call is scheduled to start.
75
+ */
76
+ export const useCallStartsAt = () => {
77
+ const { startsAt$ } = useCallState();
78
+ return useObservableValue(startsAt$);
79
+ };
80
+ /**
81
+ * Returns the timestamp when this call was updated.
82
+ */
83
+ export const useCallUpdatedAt = () => {
84
+ const { updatedAt$ } = useCallState();
85
+ return useObservableValue(updatedAt$);
86
+ };
87
+ /**
88
+ * Returns the information about the call's creator.
89
+ */
90
+ export const useCallCreatedBy = () => {
91
+ const { createdBy$ } = useCallState();
92
+ return useObservableValue(createdBy$);
93
+ };
94
+ /**
95
+ * Returns the call's custom data.
96
+ */
97
+ export const useCallCustomData = () => {
98
+ const { custom$ } = useCallState();
99
+ return useObservableValue(custom$);
100
+ };
101
+ /**
102
+ * Returns the call's Egress information.
103
+ */
104
+ export const useCallEgress = () => {
105
+ const { egress$ } = useCallState();
106
+ return useObservableValue(egress$);
107
+ };
108
+ /**
109
+ * Returns the call's Ingress information.
110
+ */
111
+ export const useCallIngress = () => {
112
+ const { ingress$ } = useCallState();
113
+ return useObservableValue(ingress$);
114
+ };
115
+ /**
116
+ * Returns the data for the current call session.
117
+ */
118
+ export const useCallSession = () => {
119
+ const { session$ } = useCallState();
120
+ return useObservableValue(session$);
121
+ };
122
+ /**
123
+ * Returns the call's settings.
124
+ */
125
+ export const useCallSettings = () => {
126
+ const { settings$ } = useCallState();
127
+ return useObservableValue(settings$);
128
+ };
129
+ /**
130
+ * Returns whether the call has transcribing enabled.
131
+ */
132
+ export const useIsCallTranscribingInProgress = () => {
133
+ const { transcribing$ } = useCallState();
134
+ return useObservableValue(transcribing$);
135
+ };
136
+ /**
137
+ * Returns information about the user who has marked this call as ended.
138
+ */
139
+ export const useCallEndedBy = () => {
140
+ const { endedBy$ } = useCallState();
141
+ return useObservableValue(endedBy$);
50
142
  };
51
143
  /**
52
144
  * Utility hook which provides a boolean indicating whether there is
@@ -83,16 +175,6 @@ export const useDominantSpeaker = () => {
83
175
  const { dominantSpeaker$ } = useCallState();
84
176
  return useObservableValue(dominantSpeaker$);
85
177
  };
86
- /**
87
- * Utility hook which provides call metadata (such as blocked users and own capabilities).
88
- *
89
- * @category Call State
90
- * @deprecated will be removed in the next major release and replaced with more specific hooks.
91
- */
92
- export const useCallMetadata = () => {
93
- const { metadata$ } = useCallState();
94
- return useObservableValue(metadata$);
95
- };
96
178
  /**
97
179
  * Utility hook which provides a list of call members.
98
180
  *
@@ -102,15 +184,6 @@ export const useCallMembers = () => {
102
184
  const { members$ } = useCallState();
103
185
  return useObservableValue(members$);
104
186
  };
105
- /**
106
- * Utility hook providing the latest list of recordings performed during the active call
107
- *
108
- * @category Call State
109
- */
110
- export const useCallRecordings = () => {
111
- const { callRecordingList$ } = useCallState();
112
- return useObservableValue(callRecordingList$);
113
- };
114
187
  /**
115
188
  * Utility hook providing the current calling state of the call. For example, `RINGING` or `JOINED`.
116
189
  *
@@ -1 +1 @@
1
- {"version":3,"file":"callStateHooks.js","sourceRoot":"","sources":["../../../src/hooks/callStateHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,SAAS,GAGV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MA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issions';
3
3
  export * from './store';
4
- export * from './callStateHooks';
5
4
  /**
6
5
  * A hook-alike function that exposes all call state hooks.
7
6
  *
@@ -1,7 +1,6 @@
1
1
  import * as CallStateHooks from './callStateHooks';
2
2
  export * from './permissions';
3
3
  export * from './store';
4
- export * from './callStateHooks';
5
4
  /**
6
5
  * A hook-alike function that exposes all call state hooks.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAEnD,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAEnD,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-bindings",
3
- "version": "0.1.17",
3
+ "version": "0.2.0",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@stream-io/i18n": "^0.1.1",
27
- "@stream-io/video-client": "^0.2.2",
27
+ "@stream-io/video-client": "^0.3.0",
28
28
  "react": ">=17.0.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@stream-io/i18n": "^0.1.1",
32
- "@stream-io/video-client": "^0.2.2",
32
+ "@stream-io/video-client": "^0.3.0",
33
33
  "@types/react": "^18.0.26",
34
34
  "@types/rimraf": "^3.0.2",
35
35
  "react": "^18.2.0",
@@ -1,8 +1,15 @@
1
1
  import { useMemo } from 'react';
2
2
  import {
3
+ CallIngressResponse,
4
+ CallSessionResponse,
5
+ CallSettingsResponse,
3
6
  CallState,
7
+ CallStatsReport,
4
8
  Comparator,
9
+ EgressResponse,
10
+ MemberResponse,
5
11
  StreamVideoParticipant,
12
+ UserResponse,
6
13
  } from '@stream-io/video-client';
7
14
  import { useCall } from '../contexts';
8
15
  import { useObservableValue } from './useObservableValue';
@@ -31,9 +38,9 @@ export const useCallState = () => {
31
38
  *
32
39
  * @category Call State
33
40
  */
34
- export const useIsCallRecordingInProgress = () => {
35
- const metadata = useCallMetadata();
36
- return !!metadata?.recording;
41
+ export const useIsCallRecordingInProgress = (): boolean => {
42
+ const { recording$ } = useCallState();
43
+ return useObservableValue(recording$);
37
44
  };
38
45
 
39
46
  /**
@@ -41,9 +48,11 @@ export const useIsCallRecordingInProgress = () => {
41
48
  *
42
49
  * @category Call State
43
50
  */
44
- export const useIsCallBroadcastingInProgress = () => {
45
- const metadata = useCallMetadata();
46
- return !!metadata?.egress.broadcasting;
51
+ export const useIsCallBroadcastingInProgress = (): boolean => {
52
+ const { egress$ } = useCallState();
53
+ const egress = useObservableValue(egress$);
54
+ if (!egress) return false;
55
+ return egress.broadcasting;
47
56
  };
48
57
 
49
58
  /**
@@ -51,10 +60,113 @@ export const useIsCallBroadcastingInProgress = () => {
51
60
  *
52
61
  * @category Call State
53
62
  */
54
- export const useIsCallLive = () => {
55
- const metadata = useCallMetadata();
56
- if (!metadata) return false;
57
- return !metadata?.backstage;
63
+ export const useIsCallLive = (): boolean => {
64
+ const { backstage$ } = useCallState();
65
+ return useObservableValue(backstage$);
66
+ };
67
+
68
+ /**
69
+ * Returns the list of blocked users in the current call.
70
+ */
71
+ export const useCallBlockedUserIds = (): string[] => {
72
+ const { blockedUserIds$ } = useCallState();
73
+ return useObservableValue(blockedUserIds$);
74
+ };
75
+
76
+ /**
77
+ * Returns the timestamp when this call was created.
78
+ */
79
+ export const useCallCreatedAt = (): Date | undefined => {
80
+ const { createdAt$ } = useCallState();
81
+ return useObservableValue(createdAt$);
82
+ };
83
+
84
+ /**
85
+ * Returns the timestamp when this call was ended.
86
+ */
87
+ export const useCallEndedAt = (): Date | undefined => {
88
+ const { endedAt$ } = useCallState();
89
+ return useObservableValue(endedAt$);
90
+ };
91
+
92
+ /**
93
+ * Returns the timestamp telling when the call is scheduled to start.
94
+ */
95
+ export const useCallStartsAt = (): Date | undefined => {
96
+ const { startsAt$ } = useCallState();
97
+ return useObservableValue(startsAt$);
98
+ };
99
+
100
+ /**
101
+ * Returns the timestamp when this call was updated.
102
+ */
103
+ export const useCallUpdatedAt = (): Date | undefined => {
104
+ const { updatedAt$ } = useCallState();
105
+ return useObservableValue(updatedAt$);
106
+ };
107
+
108
+ /**
109
+ * Returns the information about the call's creator.
110
+ */
111
+ export const useCallCreatedBy = (): UserResponse | undefined => {
112
+ const { createdBy$ } = useCallState();
113
+ return useObservableValue(createdBy$);
114
+ };
115
+
116
+ /**
117
+ * Returns the call's custom data.
118
+ */
119
+ export const useCallCustomData = (): Record<string, any> => {
120
+ const { custom$ } = useCallState();
121
+ return useObservableValue(custom$);
122
+ };
123
+
124
+ /**
125
+ * Returns the call's Egress information.
126
+ */
127
+ export const useCallEgress = (): EgressResponse | undefined => {
128
+ const { egress$ } = useCallState();
129
+ return useObservableValue(egress$);
130
+ };
131
+
132
+ /**
133
+ * Returns the call's Ingress information.
134
+ */
135
+ export const useCallIngress = (): CallIngressResponse | undefined => {
136
+ const { ingress$ } = useCallState();
137
+ return useObservableValue(ingress$);
138
+ };
139
+
140
+ /**
141
+ * Returns the data for the current call session.
142
+ */
143
+ export const useCallSession = (): CallSessionResponse | undefined => {
144
+ const { session$ } = useCallState();
145
+ return useObservableValue(session$);
146
+ };
147
+
148
+ /**
149
+ * Returns the call's settings.
150
+ */
151
+ export const useCallSettings = (): CallSettingsResponse | undefined => {
152
+ const { settings$ } = useCallState();
153
+ return useObservableValue(settings$);
154
+ };
155
+
156
+ /**
157
+ * Returns whether the call has transcribing enabled.
158
+ */
159
+ export const useIsCallTranscribingInProgress = (): boolean => {
160
+ const { transcribing$ } = useCallState();
161
+ return useObservableValue(transcribing$);
162
+ };
163
+
164
+ /**
165
+ * Returns information about the user who has marked this call as ended.
166
+ */
167
+ export const useCallEndedBy = (): UserResponse | undefined => {
168
+ const { endedBy$ } = useCallState();
169
+ return useObservableValue(endedBy$);
58
170
  };
59
171
 
60
172
  /**
@@ -63,7 +175,7 @@ export const useIsCallLive = () => {
63
175
  *
64
176
  * @category Call State
65
177
  */
66
- export const useHasOngoingScreenShare = () => {
178
+ export const useHasOngoingScreenShare = (): boolean => {
67
179
  const { hasOngoingScreenShare$ } = useCallState();
68
180
  return useObservableValue(hasOngoingScreenShare$);
69
181
  };
@@ -80,7 +192,7 @@ export const useHasOngoingScreenShare = () => {
80
192
  *
81
193
  * @category Call State
82
194
  */
83
- export const useCallStatsReport = () => {
195
+ export const useCallStatsReport = (): CallStatsReport | undefined => {
84
196
  const { callStatsReport$ } = useCallState();
85
197
  return useObservableValue(callStatsReport$);
86
198
  };
@@ -90,42 +202,21 @@ export const useCallStatsReport = () => {
90
202
  *
91
203
  * @category Call State
92
204
  */
93
- export const useDominantSpeaker = () => {
205
+ export const useDominantSpeaker = (): StreamVideoParticipant | undefined => {
94
206
  const { dominantSpeaker$ } = useCallState();
95
207
  return useObservableValue(dominantSpeaker$);
96
208
  };
97
209
 
98
- /**
99
- * Utility hook which provides call metadata (such as blocked users and own capabilities).
100
- *
101
- * @category Call State
102
- * @deprecated will be removed in the next major release and replaced with more specific hooks.
103
- */
104
- export const useCallMetadata = () => {
105
- const { metadata$ } = useCallState();
106
- return useObservableValue(metadata$);
107
- };
108
-
109
210
  /**
110
211
  * Utility hook which provides a list of call members.
111
212
  *
112
213
  * @category Call State
113
214
  */
114
- export const useCallMembers = () => {
215
+ export const useCallMembers = (): MemberResponse[] => {
115
216
  const { members$ } = useCallState();
116
217
  return useObservableValue(members$);
117
218
  };
118
219
 
119
- /**
120
- * Utility hook providing the latest list of recordings performed during the active call
121
- *
122
- * @category Call State
123
- */
124
- export const useCallRecordings = () => {
125
- const { callRecordingList$ } = useCallState();
126
- return useObservableValue(callRecordingList$);
127
- };
128
-
129
220
  /**
130
221
  * Utility hook providing the current calling state of the call. For example, `RINGING` or `JOINED`.
131
222
  *
@@ -2,7 +2,6 @@ import * as CallStateHooks from './callStateHooks';
2
2
 
3
3
  export * from './permissions';
4
4
  export * from './store';
5
- export * from './callStateHooks';
6
5
 
7
6
  /**
8
7
  * A hook-alike function that exposes all call state hooks.