@stream-io/video-react-bindings 0.1.18 → 0.2.1

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,27 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.2.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.2.0...@stream-io/video-react-bindings-0.2.1) (2023-08-16)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * correctly report `live` state of the call ([#940](https://github.com/GetStream/stream-video-js/issues/940)) ([75f36e1](https://github.com/GetStream/stream-video-js/commit/75f36e1e955da01b683a299a921b8abc74e87982)), closes [#931](https://github.com/GetStream/stream-video-js/issues/931)
11
+
12
+ ## [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)
13
+
14
+ ### Dependency Updates
15
+
16
+ * `@stream-io/video-client` updated to version `0.1.0`
17
+
18
+ ### ⚠ BREAKING CHANGES
19
+
20
+ * Call State reorganization (#931)
21
+
22
+ ### Features
23
+
24
+ * 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)
25
+
5
26
  ### [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)
6
27
 
7
28
  ### Dependency Updates
@@ -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,100 @@ 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
+ const isBackstageOn = useObservableValue(backstage$);
51
+ return !isBackstageOn;
52
+ };
53
+ /**
54
+ * Returns the list of blocked users in the current call.
55
+ */
56
+ export const useCallBlockedUserIds = () => {
57
+ const { blockedUserIds$ } = useCallState();
58
+ return useObservableValue(blockedUserIds$);
59
+ };
60
+ /**
61
+ * Returns the timestamp when this call was created.
62
+ */
63
+ export const useCallCreatedAt = () => {
64
+ const { createdAt$ } = useCallState();
65
+ return useObservableValue(createdAt$);
66
+ };
67
+ /**
68
+ * Returns the timestamp when this call was ended.
69
+ */
70
+ export const useCallEndedAt = () => {
71
+ const { endedAt$ } = useCallState();
72
+ return useObservableValue(endedAt$);
73
+ };
74
+ /**
75
+ * Returns the timestamp telling when the call is scheduled to start.
76
+ */
77
+ export const useCallStartsAt = () => {
78
+ const { startsAt$ } = useCallState();
79
+ return useObservableValue(startsAt$);
80
+ };
81
+ /**
82
+ * Returns the timestamp when this call was updated.
83
+ */
84
+ export const useCallUpdatedAt = () => {
85
+ const { updatedAt$ } = useCallState();
86
+ return useObservableValue(updatedAt$);
87
+ };
88
+ /**
89
+ * Returns the information about the call's creator.
90
+ */
91
+ export const useCallCreatedBy = () => {
92
+ const { createdBy$ } = useCallState();
93
+ return useObservableValue(createdBy$);
94
+ };
95
+ /**
96
+ * Returns the call's custom data.
97
+ */
98
+ export const useCallCustomData = () => {
99
+ const { custom$ } = useCallState();
100
+ return useObservableValue(custom$);
101
+ };
102
+ /**
103
+ * Returns the call's Egress information.
104
+ */
105
+ export const useCallEgress = () => {
106
+ const { egress$ } = useCallState();
107
+ return useObservableValue(egress$);
108
+ };
109
+ /**
110
+ * Returns the call's Ingress information.
111
+ */
112
+ export const useCallIngress = () => {
113
+ const { ingress$ } = useCallState();
114
+ return useObservableValue(ingress$);
115
+ };
116
+ /**
117
+ * Returns the data for the current call session.
118
+ */
119
+ export const useCallSession = () => {
120
+ const { session$ } = useCallState();
121
+ return useObservableValue(session$);
122
+ };
123
+ /**
124
+ * Returns the call's settings.
125
+ */
126
+ export const useCallSettings = () => {
127
+ const { settings$ } = useCallState();
128
+ return useObservableValue(settings$);
129
+ };
130
+ /**
131
+ * Returns whether the call has transcribing enabled.
132
+ */
133
+ export const useIsCallTranscribingInProgress = () => {
134
+ const { transcribing$ } = useCallState();
135
+ return useObservableValue(transcribing$);
136
+ };
137
+ /**
138
+ * Returns information about the user who has marked this call as ended.
139
+ */
140
+ export const useCallEndedBy = () => {
141
+ const { endedBy$ } = useCallState();
142
+ return useObservableValue(endedBy$);
50
143
  };
51
144
  /**
52
145
  * Utility hook which provides a boolean indicating whether there is
@@ -83,16 +176,6 @@ export const useDominantSpeaker = () => {
83
176
  const { dominantSpeaker$ } = useCallState();
84
177
  return useObservableValue(dominantSpeaker$);
85
178
  };
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
179
  /**
97
180
  * Utility hook which provides a list of call members.
98
181
  *
@@ -102,15 +185,6 @@ export const useCallMembers = () => {
102
185
  const { members$ } = useCallState();
103
186
  return useObservableValue(members$);
104
187
  };
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
188
  /**
115
189
  * Utility hook providing the current calling state of the call. For example, `RINGING` or `JOINED`.
116
190
  *
@@ -1 +1 @@
1
- {"version":3,"file":"callStateHooks.js","sourceRoot":"","sources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BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,EAAE,0BAA0B,EAAE,GAAG,YAAY,EAAE,CAAC;IACtD,OAAO,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;AACxD,CAAC,CAAC"}
@@ -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,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.18",
3
+ "version": "0.2.1",
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.3",
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.3",
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,114 @@ 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
+ const isBackstageOn = useObservableValue(backstage$);
66
+ return !isBackstageOn;
67
+ };
68
+
69
+ /**
70
+ * Returns the list of blocked users in the current call.
71
+ */
72
+ export const useCallBlockedUserIds = (): string[] => {
73
+ const { blockedUserIds$ } = useCallState();
74
+ return useObservableValue(blockedUserIds$);
75
+ };
76
+
77
+ /**
78
+ * Returns the timestamp when this call was created.
79
+ */
80
+ export const useCallCreatedAt = (): Date | undefined => {
81
+ const { createdAt$ } = useCallState();
82
+ return useObservableValue(createdAt$);
83
+ };
84
+
85
+ /**
86
+ * Returns the timestamp when this call was ended.
87
+ */
88
+ export const useCallEndedAt = (): Date | undefined => {
89
+ const { endedAt$ } = useCallState();
90
+ return useObservableValue(endedAt$);
91
+ };
92
+
93
+ /**
94
+ * Returns the timestamp telling when the call is scheduled to start.
95
+ */
96
+ export const useCallStartsAt = (): Date | undefined => {
97
+ const { startsAt$ } = useCallState();
98
+ return useObservableValue(startsAt$);
99
+ };
100
+
101
+ /**
102
+ * Returns the timestamp when this call was updated.
103
+ */
104
+ export const useCallUpdatedAt = (): Date | undefined => {
105
+ const { updatedAt$ } = useCallState();
106
+ return useObservableValue(updatedAt$);
107
+ };
108
+
109
+ /**
110
+ * Returns the information about the call's creator.
111
+ */
112
+ export const useCallCreatedBy = (): UserResponse | undefined => {
113
+ const { createdBy$ } = useCallState();
114
+ return useObservableValue(createdBy$);
115
+ };
116
+
117
+ /**
118
+ * Returns the call's custom data.
119
+ */
120
+ export const useCallCustomData = (): Record<string, any> => {
121
+ const { custom$ } = useCallState();
122
+ return useObservableValue(custom$);
123
+ };
124
+
125
+ /**
126
+ * Returns the call's Egress information.
127
+ */
128
+ export const useCallEgress = (): EgressResponse | undefined => {
129
+ const { egress$ } = useCallState();
130
+ return useObservableValue(egress$);
131
+ };
132
+
133
+ /**
134
+ * Returns the call's Ingress information.
135
+ */
136
+ export const useCallIngress = (): CallIngressResponse | undefined => {
137
+ const { ingress$ } = useCallState();
138
+ return useObservableValue(ingress$);
139
+ };
140
+
141
+ /**
142
+ * Returns the data for the current call session.
143
+ */
144
+ export const useCallSession = (): CallSessionResponse | undefined => {
145
+ const { session$ } = useCallState();
146
+ return useObservableValue(session$);
147
+ };
148
+
149
+ /**
150
+ * Returns the call's settings.
151
+ */
152
+ export const useCallSettings = (): CallSettingsResponse | undefined => {
153
+ const { settings$ } = useCallState();
154
+ return useObservableValue(settings$);
155
+ };
156
+
157
+ /**
158
+ * Returns whether the call has transcribing enabled.
159
+ */
160
+ export const useIsCallTranscribingInProgress = (): boolean => {
161
+ const { transcribing$ } = useCallState();
162
+ return useObservableValue(transcribing$);
163
+ };
164
+
165
+ /**
166
+ * Returns information about the user who has marked this call as ended.
167
+ */
168
+ export const useCallEndedBy = (): UserResponse | undefined => {
169
+ const { endedBy$ } = useCallState();
170
+ return useObservableValue(endedBy$);
58
171
  };
59
172
 
60
173
  /**
@@ -63,7 +176,7 @@ export const useIsCallLive = () => {
63
176
  *
64
177
  * @category Call State
65
178
  */
66
- export const useHasOngoingScreenShare = () => {
179
+ export const useHasOngoingScreenShare = (): boolean => {
67
180
  const { hasOngoingScreenShare$ } = useCallState();
68
181
  return useObservableValue(hasOngoingScreenShare$);
69
182
  };
@@ -80,7 +193,7 @@ export const useHasOngoingScreenShare = () => {
80
193
  *
81
194
  * @category Call State
82
195
  */
83
- export const useCallStatsReport = () => {
196
+ export const useCallStatsReport = (): CallStatsReport | undefined => {
84
197
  const { callStatsReport$ } = useCallState();
85
198
  return useObservableValue(callStatsReport$);
86
199
  };
@@ -90,42 +203,21 @@ export const useCallStatsReport = () => {
90
203
  *
91
204
  * @category Call State
92
205
  */
93
- export const useDominantSpeaker = () => {
206
+ export const useDominantSpeaker = (): StreamVideoParticipant | undefined => {
94
207
  const { dominantSpeaker$ } = useCallState();
95
208
  return useObservableValue(dominantSpeaker$);
96
209
  };
97
210
 
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
211
  /**
110
212
  * Utility hook which provides a list of call members.
111
213
  *
112
214
  * @category Call State
113
215
  */
114
- export const useCallMembers = () => {
216
+ export const useCallMembers = (): MemberResponse[] => {
115
217
  const { members$ } = useCallState();
116
218
  return useObservableValue(members$);
117
219
  };
118
220
 
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
221
  /**
130
222
  * Utility hook providing the current calling state of the call. For example, `RINGING` or `JOINED`.
131
223
  *
@@ -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.