@stream-io/video-client 0.7.12 → 0.7.13
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 +7 -0
- package/dist/index.browser.es.js +5 -6
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +5 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5 -6
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/StreamSfuClient.ts +5 -7
package/package.json
CHANGED
package/src/StreamSfuClient.ts
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
sleep,
|
|
35
35
|
} from './coordinator/connection/utils';
|
|
36
36
|
import { SFUResponse } from './gen/coordinator';
|
|
37
|
-
import { Logger } from './coordinator/connection/types';
|
|
37
|
+
import { LogLevel, Logger } from './coordinator/connection/types';
|
|
38
38
|
import { getLogger } from './logger';
|
|
39
39
|
|
|
40
40
|
export type StreamSfuClientConstructor = {
|
|
@@ -228,6 +228,7 @@ export class StreamSfuClient {
|
|
|
228
228
|
tracks: subscriptions,
|
|
229
229
|
}),
|
|
230
230
|
this.logger,
|
|
231
|
+
'debug',
|
|
231
232
|
);
|
|
232
233
|
};
|
|
233
234
|
|
|
@@ -307,6 +308,7 @@ export class StreamSfuClient {
|
|
|
307
308
|
sessionId: this.sessionId,
|
|
308
309
|
}),
|
|
309
310
|
this.logger,
|
|
311
|
+
'debug',
|
|
310
312
|
);
|
|
311
313
|
};
|
|
312
314
|
|
|
@@ -421,6 +423,7 @@ const MAX_RETRIES = 5;
|
|
|
421
423
|
const retryable = async <I extends object, O extends SfuResponseWithError>(
|
|
422
424
|
rpc: () => UnaryCall<I, O>,
|
|
423
425
|
logger: Logger,
|
|
426
|
+
level: LogLevel = 'error',
|
|
424
427
|
) => {
|
|
425
428
|
let retryAttempt = 0;
|
|
426
429
|
let rpcCallResult: FinishedUnaryCall<I, O>;
|
|
@@ -431,16 +434,11 @@ const retryable = async <I extends object, O extends SfuResponseWithError>(
|
|
|
431
434
|
}
|
|
432
435
|
|
|
433
436
|
rpcCallResult = await rpc();
|
|
434
|
-
logger(
|
|
435
|
-
'trace',
|
|
436
|
-
`SFU RPC response received for ${rpcCallResult.method.name}`,
|
|
437
|
-
rpcCallResult,
|
|
438
|
-
);
|
|
439
437
|
|
|
440
438
|
// if the RPC call failed, log the error and retry
|
|
441
439
|
if (rpcCallResult.response.error) {
|
|
442
440
|
logger(
|
|
443
|
-
|
|
441
|
+
level,
|
|
444
442
|
`SFU RPC Error (${rpcCallResult.method.name}):`,
|
|
445
443
|
rpcCallResult.response.error,
|
|
446
444
|
);
|