@stream-io/video-client 0.0.39 → 0.0.41
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 +14 -0
- package/dist/index.browser.es.js +316 -311
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +316 -311
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +316 -311
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +0 -6
- package/dist/src/coordinator/connection/client.d.ts +29 -29
- package/dist/src/coordinator/connection/connection.d.ts +3 -2
- package/dist/src/events/internal.d.ts +1 -0
- package/package.json +1 -1
- package/src/Call.ts +27 -38
- package/src/StreamSfuClient.ts +2 -2
- package/src/StreamVideoClient.ts +4 -1
- package/src/coordinator/connection/client.ts +58 -54
- package/src/coordinator/connection/connection.ts +7 -5
- package/src/events/callEventHandlers.ts +2 -0
- package/src/events/internal.ts +15 -0
- package/src/rtc/Publisher.ts +3 -3
- package/src/rtc/Subscriber.ts +1 -1
- package/src/stats/state-store-stats-reporter.ts +1 -1
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
watchChangePublishQuality,
|
|
27
27
|
watchConnectionQualityChanged,
|
|
28
28
|
watchDominantSpeakerChanged,
|
|
29
|
+
watchLiveEnded,
|
|
29
30
|
watchNewReactions,
|
|
30
31
|
watchParticipantCountChanged,
|
|
31
32
|
watchParticipantJoined,
|
|
@@ -92,6 +93,7 @@ export const registerEventHandlers = (
|
|
|
92
93
|
'call.user_muted': () => console.log('call.user_muted received'),
|
|
93
94
|
};
|
|
94
95
|
const eventHandlers = [
|
|
96
|
+
watchLiveEnded(dispatcher, call),
|
|
95
97
|
watchSfuErrorReports(dispatcher),
|
|
96
98
|
watchChangePublishQuality(dispatcher, call),
|
|
97
99
|
watchConnectionQualityChanged(dispatcher, state),
|
package/src/events/internal.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { CallState } from '../store';
|
|
|
4
4
|
import { StreamVideoParticipantPatches } from '../types';
|
|
5
5
|
import { getLogger } from '../logger';
|
|
6
6
|
import { ErrorCode } from '../gen/video/sfu/models/models';
|
|
7
|
+
import { OwnCapability } from '../gen/coordinator';
|
|
7
8
|
|
|
8
9
|
const logger = getLogger(['events']);
|
|
9
10
|
|
|
@@ -68,6 +69,20 @@ export const watchParticipantCountChanged = (
|
|
|
68
69
|
});
|
|
69
70
|
};
|
|
70
71
|
|
|
72
|
+
export const watchLiveEnded = (dispatcher: Dispatcher, call: Call) => {
|
|
73
|
+
return dispatcher.on('error', (e) => {
|
|
74
|
+
if (
|
|
75
|
+
e.eventPayload.oneofKind !== 'error' ||
|
|
76
|
+
!e.eventPayload.error.error ||
|
|
77
|
+
e.eventPayload.error.error.code !== ErrorCode.LIVE_ENDED
|
|
78
|
+
)
|
|
79
|
+
return;
|
|
80
|
+
|
|
81
|
+
if (!call.permissionsContext.hasPermission(OwnCapability.JOIN_BACKSTAGE))
|
|
82
|
+
call.leave();
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
71
86
|
/**
|
|
72
87
|
* Watches and logs the errors reported by the currently connected SFU.
|
|
73
88
|
*/
|
package/src/rtc/Publisher.ts
CHANGED
|
@@ -412,7 +412,7 @@ export class Publisher {
|
|
|
412
412
|
private onIceCandidate = async (e: RTCPeerConnectionIceEvent) => {
|
|
413
413
|
const { candidate } = e;
|
|
414
414
|
if (!candidate) {
|
|
415
|
-
this.logger('
|
|
415
|
+
this.logger('debug', 'null ice candidate');
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
418
|
await this.sfuClient.iceTrickle({
|
|
@@ -615,14 +615,14 @@ export class Publisher {
|
|
|
615
615
|
|
|
616
616
|
private onIceConnectionStateChange = () => {
|
|
617
617
|
this.logger(
|
|
618
|
-
'
|
|
618
|
+
'debug',
|
|
619
619
|
`ICE Connection state changed`,
|
|
620
620
|
this.pc.iceConnectionState,
|
|
621
621
|
);
|
|
622
622
|
};
|
|
623
623
|
|
|
624
624
|
private onIceGatheringStateChange = () => {
|
|
625
|
-
this.logger('
|
|
625
|
+
this.logger('debug', `ICE Gathering State`, this.pc.iceGatheringState);
|
|
626
626
|
};
|
|
627
627
|
|
|
628
628
|
private onSignalingStateChange = () => {
|
package/src/rtc/Subscriber.ts
CHANGED
|
@@ -248,7 +248,7 @@ export class Subscriber {
|
|
|
248
248
|
private onIceCandidate = async (e: RTCPeerConnectionIceEvent) => {
|
|
249
249
|
const { candidate } = e;
|
|
250
250
|
if (!candidate) {
|
|
251
|
-
logger('
|
|
251
|
+
logger('debug', 'null ice candidate');
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -188,7 +188,7 @@ export const createStatsReporter = ({
|
|
|
188
188
|
if (pollingIntervalInMs > 0) {
|
|
189
189
|
const loop = async () => {
|
|
190
190
|
await run().catch((e) => {
|
|
191
|
-
logger('
|
|
191
|
+
logger('debug', 'Failed to collect stats', e);
|
|
192
192
|
});
|
|
193
193
|
timeoutId = setTimeout(loop, pollingIntervalInMs);
|
|
194
194
|
};
|