@vindral/web-sdk 4.7.2-10-gd9156e94 → 4.7.2-12-g8f00addb

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.
@@ -12198,7 +12198,7 @@ var Vx = class {
12198
12198
  let r = o.modules.subscription.getTargetSubscription(), i = e.channels.find((e) => e.channelId === r.channelId);
12199
12199
  if (o.emitter.emit("connect info", e), "timeshift" in e && e.timeshift ? (e.timeshift, o._channels = e.channels.map((t) => y(y({}, t), {}, { timeshift: e.timeshift })), o.emit("timeshift info", e.timeshift)) : o._channels = e.channels, o.updateTextTracks((n = i == null ? void 0 : i.renditions) == null ? [] : n), !o.textTrack && o.options.get("textTrack") && (o.textTrack = o.options.get("textTrack")), yield Promise.all(e.channels.map(function() {
12200
12200
  var e = t(function* (e) {
12201
- e.overrides && o.options.addOverrides(e.channelId, e.overrides), e.renditions = yield o.filterRenditions(e.renditions), o.modules.renditions.setRenditions(e.channelId, e.renditions);
12201
+ e.overrides && o.options.addOverrides(e.channelId, e.overrides), e.renditions = yield o.filterRenditions(e.renditions, e.channelId), o.modules.renditions.setRenditions(e.channelId, e.renditions);
12202
12202
  });
12203
12203
  return function(t) {
12204
12204
  return e.apply(this, arguments);
@@ -12261,59 +12261,56 @@ var Vx = class {
12261
12261
  if (t.cues) for (let n of Array.from(t.cues)) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
12262
12262
  });
12263
12263
  }), e(this, "filterRenditions", function() {
12264
- var e = t(function* (e) {
12265
- let n = yield Promise.all(e.map(function() {
12264
+ var e = t(function* (e, n) {
12265
+ let r = o.options.getOverride("maxVideoBitRate", n), i = yield Promise.all(e.map(function() {
12266
12266
  var e = t(function* (e) {
12267
12267
  if (fn(e)) {
12268
12268
  var t;
12269
12269
  return o.willUseMediaSource() && !((t = Ee()) != null && t.isTypeSupported(pn(e))) ? !1 : o.willUseMediaSource() || e.codec === "opus" ? !0 : o.isWebCodecsAudioAvailable(o.channelId) ? o.webCodecsRenditionSupport.checkAudioSupport(e) : !1;
12270
12270
  }
12271
- if (!dn(e) || !o.isSupportedVideoCodecProfile(e.codec, e.codecString)) return !1;
12271
+ if (!dn(e) || !o.isSupportedVideoCodecProfile(e.codec, e.codecString) || r && e.bitRate > r) return !1;
12272
12272
  if (!o.willUseMediaSource()) return o.isWebCodecsVideoAvailable(o.channelId) ? o.webCodecsRenditionSupport.checkVideoSupport(e) : !0;
12273
12273
  let n = yield fc(e);
12274
- if (!n.supported) return !1;
12275
- if (e.codec === "av1" && !n.smooth && !n.powerEfficient) return o.logger.debug("discarding av1 rendition, neither smooth nor power efficient", {
12274
+ return n.supported ? e.codec === "av1" && !n.smooth && !n.powerEfficient ? (o.logger.debug("discarding av1 rendition, neither smooth nor power efficient", {
12276
12275
  codecString: e.codecString,
12277
12276
  width: e.width,
12278
12277
  height: e.height,
12279
12278
  bitRate: e.bitRate,
12280
12279
  capabilities: n
12281
- }), !1;
12282
- let r = o.options.getOverride("maxVideoBitRate", o.channelId);
12283
- return r ? r >= e.bitRate : !0;
12280
+ }), !1) : !0 : !1;
12284
12281
  });
12285
12282
  return function(t) {
12286
12283
  return e.apply(this, arguments);
12287
12284
  };
12288
- }())), r = e.filter((e, t) => n[t]), i = e.filter((e, t) => !n[t]);
12289
- i.length > 0 && o.logger.debug("unsupported renditions filtered out", { renditions: i.map((e) => y(y({
12285
+ }())), a = e.filter((e, t) => i[t]), s = e.filter((e, t) => !i[t]);
12286
+ s.length > 0 && o.logger.debug("unsupported renditions filtered out", { renditions: s.map((e) => y(y({
12290
12287
  codec: e.codec,
12291
12288
  codecString: e.codecString
12292
12289
  }, dn(e) ? {
12293
12290
  width: e.width,
12294
12291
  height: e.height
12295
12292
  } : {}), {}, { bitRate: e.bitRate })) });
12296
- let a = r.filter((e) => e.codec === "h264").reverse()[0], s = r.filter((e) => e.codec === "av1").reverse()[0];
12297
- return a && s && a.width > s.width && a.height > s.height && (o.logger.debug("discarding av1 renditions, h264 ladder has higher resolution", {
12293
+ let c = a.filter((e) => e.codec === "h264").reverse()[0], l = a.filter((e) => e.codec === "av1").reverse()[0];
12294
+ return c && l && c.width > l.width && c.height > l.height && (o.logger.debug("discarding av1 renditions, h264 ladder has higher resolution", {
12298
12295
  bestH264: {
12299
- width: a.width,
12300
- height: a.height,
12301
- bitRate: a.bitRate
12296
+ width: c.width,
12297
+ height: c.height,
12298
+ bitRate: c.bitRate
12302
12299
  },
12303
12300
  bestAV1: {
12304
- width: s.width,
12305
- height: s.height,
12306
- bitRate: s.bitRate
12301
+ width: l.width,
12302
+ height: l.height,
12303
+ bitRate: l.bitRate
12307
12304
  }
12308
- }), r = r.filter((e) => e.codec !== "av1")), o.logger.debug("supported renditions", { renditions: r.map((e) => y(y({
12305
+ }), a = a.filter((e) => e.codec !== "av1")), o.logger.debug("supported renditions", { renditions: a.map((e) => y(y({
12309
12306
  codec: e.codec,
12310
12307
  codecString: e.codecString
12311
12308
  }, dn(e) ? {
12312
12309
  width: e.width,
12313
12310
  height: e.height
12314
- } : {}), {}, { bitRate: e.bitRate })) }), r;
12311
+ } : {}), {}, { bitRate: e.bitRate })) }), a;
12315
12312
  });
12316
- return function(t) {
12313
+ return function(t, n) {
12317
12314
  return e.apply(this, arguments);
12318
12315
  };
12319
12316
  }()), e(this, "burstFits", (e) => {
@@ -12526,7 +12523,7 @@ var Vx = class {
12526
12523
  let e = this.modules.canvasModule instanceof Vb ? !0 : void 0;
12527
12524
  return y({
12528
12525
  uptime: this.uptime,
12529
- version: "4.7.2-10-gd9156e94",
12526
+ version: "4.7.2-12-g8f00addb",
12530
12527
  clientId: this.clientId,
12531
12528
  sessionId: this.sessionId,
12532
12529
  channelId: this.channelId,
@@ -12789,23 +12786,23 @@ var Vx = class {
12789
12786
  }), this.emitter.on("native text track selected", (e) => {
12790
12787
  this.textTrack = e;
12791
12788
  }), this.emitter.on("received signal", (e) => {
12792
- let t = e, n = this.modules.subscription.getCurrentSubscription();
12789
+ let t = e, n = this.modules.subscription.getCurrentSubscription(), r = this.sessionId;
12793
12790
  switch (this.logger.debug("received", y({}, t)), t.type) {
12794
12791
  case "client ip":
12795
12792
  this.clientIp = t.ip;
12796
12793
  break;
12797
12794
  case "renditions":
12798
- this.updateTextTracks(t.renditions), a(lS, this, this.filterRenditions(t.renditions).then((e) => {
12799
- this.emitter.emit("renditions", {
12795
+ this.updateTextTracks(t.renditions), a(lS, this, this.filterRenditions(t.renditions, n.channelId).then((e) => {
12796
+ r === this.sessionId && (this.emitter.emit("renditions", {
12800
12797
  renditions: e,
12801
- channelId: this.currentSubscription.channelId
12802
- }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
12798
+ channelId: n.channelId
12799
+ }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged());
12803
12800
  }).finally(() => {
12804
12801
  a(lS, this, void 0);
12805
12802
  }));
12806
12803
  break;
12807
12804
  case "subscription changed":
12808
- var r;
12805
+ var i;
12809
12806
  try {
12810
12807
  rS(t.subscription);
12811
12808
  } catch (e) {
@@ -12819,7 +12816,7 @@ var Vx = class {
12819
12816
  reset: t.reset,
12820
12817
  to: t.subscription,
12821
12818
  from: this.modules.subscription.getCurrentSubscription()
12822
- }), t.reset && n.channelId !== t.subscription.channelId && (this.emit("error", rr(t.subscription.channelId)), this.emit("channel switch failed", { channelId: n.channelId })), this.modules.sync.allowTimeshiftOnAudio = !((r = t.subscription.video) != null && r.codec), this.modules.adaptivity.reset();
12819
+ }), t.reset && n.channelId !== t.subscription.channelId && (this.emit("error", rr(t.subscription.channelId)), this.emit("channel switch failed", { channelId: n.channelId })), this.modules.sync.allowTimeshiftOnAudio = !((i = t.subscription.video) != null && i.codec), this.modules.adaptivity.reset();
12823
12820
  break;
12824
12821
  case "timing info":
12825
12822
  this.modules.sync.updateChannelSyncInfo(t.timingInfo.channelId, t.timingInfo), this.emit("server wallclock time", t.timingInfo.wallclockTime);