@stream-io/video-client 0.3.17 → 0.3.19
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 +6 -5
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +5 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +6 -5
- package/dist/index.es.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/StreamSfuClient.ts +5 -1
- package/src/devices/InputMediaDeviceManager.ts +1 -1
- package/src/helpers/DynascaleManager.ts +3 -0
- package/src/helpers/__tests__/DynascaleManager.test.ts +24 -0
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.3.
|
|
1
|
+
export declare const version = "0.3.19";
|
package/package.json
CHANGED
package/src/StreamSfuClient.ts
CHANGED
|
@@ -388,7 +388,11 @@ const retryable = async <I extends object, O extends SfuResponseWithError>(
|
|
|
388
388
|
|
|
389
389
|
// if the RPC call failed, log the error and retry
|
|
390
390
|
if (rpcCallResult.response.error) {
|
|
391
|
-
logger(
|
|
391
|
+
logger(
|
|
392
|
+
'error',
|
|
393
|
+
`SFU RPC Error (${rpcCallResult.method.name}):`,
|
|
394
|
+
rpcCallResult.response.error,
|
|
395
|
+
);
|
|
392
396
|
}
|
|
393
397
|
retryAttempt++;
|
|
394
398
|
} while (
|
|
@@ -154,7 +154,7 @@ export abstract class InputMediaDeviceManager<
|
|
|
154
154
|
// @ts-expect-error release() is present in react-native-webrtc and must be called to dispose the stream
|
|
155
155
|
if (typeof this.state.mediaStream.release === 'function') {
|
|
156
156
|
// @ts-expect-error
|
|
157
|
-
|
|
157
|
+
this.state.mediaStream.release();
|
|
158
158
|
}
|
|
159
159
|
this.state.setMediaStream(undefined);
|
|
160
160
|
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
distinctUntilChanged,
|
|
17
17
|
distinctUntilKeyChanged,
|
|
18
18
|
map,
|
|
19
|
+
shareReplay,
|
|
19
20
|
takeWhile,
|
|
20
21
|
} from 'rxjs';
|
|
21
22
|
import { ViewportTracker } from './ViewportTracker';
|
|
@@ -167,6 +168,7 @@ export class DynascaleManager {
|
|
|
167
168
|
),
|
|
168
169
|
takeWhile((participant) => !!participant),
|
|
169
170
|
distinctUntilChanged(),
|
|
171
|
+
shareReplay(1),
|
|
170
172
|
);
|
|
171
173
|
|
|
172
174
|
// keep copy for resize observer handler
|
|
@@ -284,6 +286,7 @@ export class DynascaleManager {
|
|
|
284
286
|
videoElement.muted = true;
|
|
285
287
|
|
|
286
288
|
return () => {
|
|
289
|
+
requestTrackWithDimensions(DebounceType.IMMEDIATE, undefined);
|
|
287
290
|
viewportVisibilityStateSubscription?.unsubscribe();
|
|
288
291
|
publishedTracksSubscription?.unsubscribe();
|
|
289
292
|
streamSubscription.unsubscribe();
|
|
@@ -226,6 +226,12 @@ describe('DynascaleManager', () => {
|
|
|
226
226
|
);
|
|
227
227
|
|
|
228
228
|
cleanup?.();
|
|
229
|
+
|
|
230
|
+
expect(updateSubscription).toHaveBeenCalledWith(
|
|
231
|
+
'videoTrack',
|
|
232
|
+
{ 'session-id': { dimension: undefined } },
|
|
233
|
+
DebounceType.IMMEDIATE,
|
|
234
|
+
);
|
|
229
235
|
});
|
|
230
236
|
|
|
231
237
|
it('video: should play video when track becomes available', () => {
|
|
@@ -271,6 +277,12 @@ describe('DynascaleManager', () => {
|
|
|
271
277
|
expect(videoElement.srcObject).toBe(mediaStream);
|
|
272
278
|
|
|
273
279
|
cleanup?.();
|
|
280
|
+
|
|
281
|
+
expect(updateSubscription).toHaveBeenCalledWith(
|
|
282
|
+
'videoTrack',
|
|
283
|
+
{ 'session-id': { dimension: undefined } },
|
|
284
|
+
DebounceType.IMMEDIATE,
|
|
285
|
+
);
|
|
274
286
|
});
|
|
275
287
|
|
|
276
288
|
it('video: should update subscription when element becomes visible', () => {
|
|
@@ -353,6 +365,12 @@ describe('DynascaleManager', () => {
|
|
|
353
365
|
);
|
|
354
366
|
|
|
355
367
|
cleanup?.();
|
|
368
|
+
|
|
369
|
+
expect(updateSubscription).toHaveBeenCalledWith(
|
|
370
|
+
'videoTrack',
|
|
371
|
+
{ 'session-id': { dimension: undefined } },
|
|
372
|
+
DebounceType.IMMEDIATE,
|
|
373
|
+
);
|
|
356
374
|
});
|
|
357
375
|
|
|
358
376
|
it('video: should update subscription when element resizes', () => {
|
|
@@ -417,6 +435,12 @@ describe('DynascaleManager', () => {
|
|
|
417
435
|
);
|
|
418
436
|
|
|
419
437
|
cleanup?.();
|
|
438
|
+
|
|
439
|
+
expect(updateSubscription).toHaveBeenCalledWith(
|
|
440
|
+
'videoTrack',
|
|
441
|
+
{ 'session-id': { dimension: undefined } },
|
|
442
|
+
DebounceType.IMMEDIATE,
|
|
443
|
+
);
|
|
420
444
|
});
|
|
421
445
|
});
|
|
422
446
|
});
|