@livedigital/client 2.24.1 → 2.25.0-add-keyframes-delay.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/dist/engine/media/tracks/BaseTrack.d.ts +1 -1
- package/dist/engine/media/tracks/VideoTrack.d.ts +2 -2
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/common.d.ts +4 -0
- package/package.json +1 -1
- package/src/engine/media/tracks/BaseTrack.ts +8 -1
- package/src/engine/media/tracks/VideoTrack.ts +5 -2
- package/src/types/common.ts +5 -0
package/dist/types/common.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare type TrackProduceParams = {
|
|
|
20
20
|
codecOptions?: ProducerCodecOptions;
|
|
21
21
|
preferredCodec?: string;
|
|
22
22
|
transformParams?: TrackTransformParams;
|
|
23
|
+
keyFrameRequestDelay?: number;
|
|
23
24
|
};
|
|
24
25
|
export declare type TrackTransformParams = {
|
|
25
26
|
width?: number;
|
|
@@ -303,3 +304,6 @@ export declare type UpdatePeerAppDataPayload = {
|
|
|
303
304
|
peerId: string;
|
|
304
305
|
appData: Record<string, unknown>;
|
|
305
306
|
};
|
|
307
|
+
export declare type TrackPublishParams = {
|
|
308
|
+
keyFrameRequestDelay: number;
|
|
309
|
+
};
|
package/package.json
CHANGED
|
@@ -212,6 +212,7 @@ class BaseTrack {
|
|
|
212
212
|
codecOptions,
|
|
213
213
|
trackTransformParams,
|
|
214
214
|
preferredCodec,
|
|
215
|
+
keyFrameRequestDelay,
|
|
215
216
|
},
|
|
216
217
|
} = this.producer;
|
|
217
218
|
|
|
@@ -222,6 +223,7 @@ class BaseTrack {
|
|
|
222
223
|
codecOptions,
|
|
223
224
|
transformParams: trackTransformParams,
|
|
224
225
|
preferredCodec,
|
|
226
|
+
keyFrameRequestDelay,
|
|
225
227
|
});
|
|
226
228
|
|
|
227
229
|
this.logger.debug('restartProducer()', { track: this });
|
|
@@ -266,7 +268,11 @@ class BaseTrack {
|
|
|
266
268
|
}
|
|
267
269
|
|
|
268
270
|
async produce({
|
|
269
|
-
encodings,
|
|
271
|
+
encodings,
|
|
272
|
+
codecOptions,
|
|
273
|
+
preferredCodec,
|
|
274
|
+
transformParams,
|
|
275
|
+
keyFrameRequestDelay,
|
|
270
276
|
}: TrackProduceParams): Promise<void> {
|
|
271
277
|
if (!this.#engine.cahPublish) {
|
|
272
278
|
this.logger.error('produce()', { message: 'Not enough access to produce' });
|
|
@@ -286,6 +292,7 @@ class BaseTrack {
|
|
|
286
292
|
codecOptions,
|
|
287
293
|
preferredCodec,
|
|
288
294
|
codec,
|
|
295
|
+
keyFrameRequestDelay,
|
|
289
296
|
};
|
|
290
297
|
|
|
291
298
|
const producer = await this.#engine.network.sendTransport?.produce({
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ProducerCodecOptions } from 'mediasoup-client/lib/Producer';
|
|
2
2
|
import { RtpEncodingParameters } from 'mediasoup-client/lib/RtpParameters';
|
|
3
3
|
import { WEBCAM_SIMULCAST_ENCODINGS } from '../../../constants/simulcastEncodings';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
TrackLabel, TrackPublishParams, VideoCodec, VideoEncoderConfig,
|
|
6
|
+
} from '../../../types/common';
|
|
5
7
|
import BaseTrack from './BaseTrack';
|
|
6
8
|
import TrackWithCodecOptions from './TrackWithCodecOptions';
|
|
7
9
|
import TrackWithEncodings from './TrackWithEncodings';
|
|
@@ -65,12 +67,13 @@ class VideoTrack extends BaseTrack implements TrackWithCodecOptions, TrackWithEn
|
|
|
65
67
|
return producer.maxSpatialLayer;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
async publish(): Promise<void> {
|
|
70
|
+
async publish(params: TrackPublishParams): Promise<void> {
|
|
69
71
|
await this.produce({
|
|
70
72
|
encodings: this.getEncodings(),
|
|
71
73
|
preferredCodec: this.getPreferredCodec(),
|
|
72
74
|
transformParams: this.transformParams,
|
|
73
75
|
codecOptions: this.getCodecOptions(),
|
|
76
|
+
keyFrameRequestDelay: params.keyFrameRequestDelay ?? 0,
|
|
74
77
|
});
|
|
75
78
|
|
|
76
79
|
this.clientEventEmitter.emit(INTERNAL_CLIENT_EVENTS.trackProduced, this);
|
package/src/types/common.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type TrackProduceParams = {
|
|
|
27
27
|
codecOptions?: ProducerCodecOptions,
|
|
28
28
|
preferredCodec?: string,
|
|
29
29
|
transformParams?: TrackTransformParams,
|
|
30
|
+
keyFrameRequestDelay?: number,
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
export type TrackTransformParams = {
|
|
@@ -348,3 +349,7 @@ export type UpdatePeerAppDataPayload = {
|
|
|
348
349
|
peerId: string,
|
|
349
350
|
appData: Record<string, unknown>,
|
|
350
351
|
};
|
|
352
|
+
|
|
353
|
+
export type TrackPublishParams = {
|
|
354
|
+
keyFrameRequestDelay: number;
|
|
355
|
+
};
|