@uniai-fe/uds-templates 0.5.11 → 0.5.12
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/package.json
CHANGED
|
@@ -218,6 +218,7 @@ export function useCctvRtcStream({
|
|
|
218
218
|
useEffect(() => {
|
|
219
219
|
const camId = cam?.cam_id;
|
|
220
220
|
if (!camId) return;
|
|
221
|
+
|
|
221
222
|
const instanceKey = instanceKeyRef.current as string;
|
|
222
223
|
setLiveRegistry(prev => {
|
|
223
224
|
const next = { ...prev };
|
|
@@ -226,7 +227,13 @@ export function useCctvRtcStream({
|
|
|
226
227
|
next[camId] = perCam;
|
|
227
228
|
return next;
|
|
228
229
|
});
|
|
230
|
+
}, [cam?.cam_id, liveState, setLiveRegistry]);
|
|
231
|
+
|
|
232
|
+
useEffect(() => {
|
|
233
|
+
const camId = cam?.cam_id;
|
|
234
|
+
if (!camId) return;
|
|
229
235
|
|
|
236
|
+
const instanceKey = instanceKeyRef.current as string;
|
|
230
237
|
return () => {
|
|
231
238
|
setLiveRegistry(prev => {
|
|
232
239
|
const next = { ...prev };
|
|
@@ -240,7 +247,7 @@ export function useCctvRtcStream({
|
|
|
240
247
|
return next;
|
|
241
248
|
});
|
|
242
249
|
};
|
|
243
|
-
}, [cam?.cam_id,
|
|
250
|
+
}, [cam?.cam_id, setLiveRegistry]);
|
|
244
251
|
|
|
245
252
|
// 호출자에게 video ref와 상태값, 토큰 쿼리 상태를 전달한다.
|
|
246
253
|
return {
|
|
@@ -60,6 +60,7 @@ export function getOverlayMessage({
|
|
|
60
60
|
*/
|
|
61
61
|
export function getIsLive({
|
|
62
62
|
cam,
|
|
63
|
+
connectionState,
|
|
63
64
|
isTokenLoading,
|
|
64
65
|
isTokenError,
|
|
65
66
|
isStreaming,
|
|
@@ -70,6 +71,7 @@ export function getIsLive({
|
|
|
70
71
|
if (isTokenLoading || isTokenError) return false;
|
|
71
72
|
if (isStreaming) return false;
|
|
72
73
|
if (streamError) return false;
|
|
74
|
+
if (connectionState !== "connected") return false;
|
|
73
75
|
return true;
|
|
74
76
|
}
|
|
75
77
|
|