@stream-io/video-client 1.6.5 → 1.7.0

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.
@@ -252,7 +252,7 @@ const transform = (
252
252
 
253
253
  const codec = stats.find(
254
254
  (s) => s.type === 'codec' && s.id === rtcStreamStats.codecId,
255
- ) as { mimeType: string } | undefined; // FIXME OL: incorrect type!
255
+ ) as RTCRtpCodec | undefined;
256
256
 
257
257
  const transport = stats.find(
258
258
  (s) => s.type === 'transport' && s.id === rtcStreamStats.transportId,
@@ -303,6 +303,7 @@ const getEmptyStats = (stats?: StatsReport): AggregatedStatsReport => {
303
303
  highestFrameWidth: 0,
304
304
  highestFrameHeight: 0,
305
305
  highestFramesPerSecond: 0,
306
+ codec: '',
306
307
  timestamp: Date.now(),
307
308
  };
308
309
  };
@@ -346,6 +347,8 @@ const aggregate = (stats: StatsReport): AggregatedStatsReport => {
346
347
  report.averageRoundTripTimeInMs = Math.round(
347
348
  (report.averageRoundTripTimeInMs / streams.length) * 1000,
348
349
  );
350
+ // we take the first codec we find, as it should be the same for all streams
351
+ report.codec = streams[0].codec || '';
349
352
  }
350
353
 
351
354
  const qualityLimitationReason = [
@@ -29,6 +29,7 @@ export type AggregatedStatsReport = {
29
29
  highestFrameWidth: number;
30
30
  highestFrameHeight: number;
31
31
  highestFramesPerSecond: number;
32
+ codec: string;
32
33
  timestamp: number;
33
34
  rawReport: StatsReport;
34
35
  };