bigscreen-player 8.7.2 → 8.8.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.
@@ -1,5 +1,5 @@
1
1
  import { fromXML, generateISD, renderHTML } from 'smp-imsc';
2
- import { f as findSegmentTemplate, L as LoadUrl, a as DebugToolInstance, P as Plugins, U as Utils, D as DOMHelpers } from './main-399e824b.js';
2
+ import { f as findSegmentTemplate, L as LoadUrl, a as DebugToolInstance, P as Plugins, U as Utils, D as DOMHelpers } from './main-9897db0b.js';
3
3
 
4
4
  const SEGMENTS_BUFFER_SIZE = 3;
5
5
  const LOAD_ERROR_COUNT_MAX = 3;
@@ -1,4 +1,4 @@
1
- import { D as DOMHelpers, a as DebugToolInstance, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-399e824b.js';
1
+ import { D as DOMHelpers, a as DebugToolInstance, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-9897db0b.js';
2
2
 
3
3
  /**
4
4
  * Safely checks if an attribute exists on an element.
@@ -285,6 +285,7 @@ var Plugins = {
285
285
  onPlayerInfoUpdated: (evt) => callOnAllPlugins("onPlayerInfoUpdated", evt),
286
286
  onManifestLoaded: (manifest) => callOnAllPlugins("onManifestLoaded", manifest),
287
287
  onManifestParseError: (evt) => callOnAllPlugins("onManifestParseError", evt),
288
+ onQualityChangeRequested: (evt) => callOnAllPlugins("onQualityChangeRequested", evt),
288
289
  onQualityChangedRendered: (evt) => callOnAllPlugins("onQualityChangedRendered", evt),
289
290
  onSubtitlesLoadError: (evt) => callOnAllPlugins("onSubtitlesLoadError", evt),
290
291
  onSubtitlesTimeout: (evt) => callOnAllPlugins("onSubtitlesTimeout", evt),
@@ -5960,7 +5961,7 @@ BasicStrategy.getLiveSupport = () => LiveSupport.SEEKABLE;
5960
5961
  function StrategyPicker() {
5961
5962
  return new Promise((resolve, reject) => {
5962
5963
  if (window.bigscreenPlayer.playbackStrategy === PlaybackStrategy.MSE) {
5963
- return import('./msestrategy-fdbb4fd5.js')
5964
+ return import('./msestrategy-315ca897.js')
5964
5965
  .then(({ default: MSEStrategy }) => resolve(MSEStrategy))
5965
5966
  .catch(() => {
5966
5967
  reject({ error: "strategyDynamicLoadError" });
@@ -6383,7 +6384,7 @@ const PauseTriggers = {
6383
6384
  DEVICE: 3,
6384
6385
  };
6385
6386
 
6386
- var Version = "8.7.2";
6387
+ var Version = "8.8.0";
6387
6388
 
6388
6389
  var sourceList;
6389
6390
  var source;
@@ -7734,7 +7735,7 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7734
7735
 
7735
7736
  if (available()) {
7736
7737
  if (useLegacySubs) {
7737
- import('./legacysubtitles-6e3a16aa.js')
7738
+ import('./legacysubtitles-cfb3355d.js')
7738
7739
  .then(({ default: LegacySubtitles }) => {
7739
7740
  subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7740
7741
  callback(subtitlesEnabled);
@@ -7743,7 +7744,7 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7743
7744
  Plugins.interface.onSubtitlesDynamicLoadError();
7744
7745
  });
7745
7746
  } else {
7746
- import('./imscsubtitles-bac28114.js')
7747
+ import('./imscsubtitles-ac507526.js')
7747
7748
  .then(({ default: IMSCSubtitles }) => {
7748
7749
  subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7749
7750
  callback(subtitlesEnabled);
package/dist/esm/main.js CHANGED
@@ -1 +1 @@
1
- export { B as BigscreenPlayer, a as DebugTool, E as EntryCategory, c as LiveSupport, M as MediaKinds, g as MediaState, h as MockBigscreenPlayer, b as PauseTriggers, i as PlaybackStrategy, j as TransferFormat, T as TransportControlPosition, W as WindowTypes, k as isMessage, l as isMetric, m as isTrace } from './main-399e824b.js';
1
+ export { B as BigscreenPlayer, a as DebugTool, E as EntryCategory, c as LiveSupport, M as MediaKinds, g as MediaState, h as MockBigscreenPlayer, b as PauseTriggers, i as PlaybackStrategy, j as TransferFormat, T as TransportControlPosition, W as WindowTypes, k as isMessage, l as isMetric, m as isTrace } from './main-9897db0b.js';
@@ -1,5 +1,5 @@
1
1
  import { MediaPlayer } from 'dashjs/index_mediaplayerOnly';
2
- import { W as WindowTypes, U as Utils, b as PauseTriggers, c as LiveSupport, M as MediaKinds, a as DebugToolInstance, d as TimeUtils, e as DynamicWindowUtils, g as MediaState, P as Plugins, D as DOMHelpers } from './main-399e824b.js';
2
+ import { W as WindowTypes, U as Utils, b as PauseTriggers, c as LiveSupport, M as MediaKinds, a as DebugToolInstance, d as TimeUtils, e as DynamicWindowUtils, g as MediaState, P as Plugins, D as DOMHelpers } from './main-9897db0b.js';
3
3
 
4
4
  function filter(manifest, representationOptions) {
5
5
  const constantFps = representationOptions.constantFps;
@@ -243,6 +243,7 @@ function MSEStrategy(mediaSources, windowType, mediaKind, playbackElement, isUHD
243
243
  DOWNLOAD_INIT_SEGMENT_ERROR_CODE: 28,
244
244
  UNSUPPORTED_CODEC: 30,
245
245
  MANIFEST_VALIDITY_CHANGED: "manifestValidityChanged",
246
+ QUALITY_CHANGE_REQUESTED: "qualityChangeRequested",
246
247
  QUALITY_CHANGE_RENDERED: "qualityChangeRendered",
247
248
  BASE_URL_SELECTED: "baseUrlSelected",
248
249
  SERVICE_LOCATION_AVAILABLE: "serviceLocationUnblacklisted",
@@ -510,25 +511,31 @@ function MSEStrategy(mediaSources, windowType, mediaKind, playbackElement, isUHD
510
511
  return parseInt(bitrateInfoList[index].bitrate / 1000)
511
512
  }
512
513
 
513
- function onQualityChangeRendered(event) {
514
- function logBitrate(event) {
515
- const { mediaType, oldQuality, newQuality } = event;
516
-
517
- const oldBitrate = isNaN(oldQuality) ? "--" : playbackBitrateForRepresentationIndex(oldQuality, mediaType);
518
- const newBitrate = isNaN(newQuality) ? "--" : playbackBitrateForRepresentationIndex(newQuality, mediaType);
514
+ function logBitrate(abrType, { mediaType, oldQuality, newQuality }) {
515
+ const oldBitrate = isNaN(oldQuality) ? "--" : playbackBitrateForRepresentationIndex(oldQuality, mediaType);
516
+ const newBitrate = isNaN(newQuality) ? "--" : playbackBitrateForRepresentationIndex(newQuality, mediaType);
519
517
 
520
- const oldRepresentation = isNaN(oldQuality) ? "Start" : `${oldQuality} (${oldBitrate} kbps)`;
521
- const newRepresentation = `${newQuality} (${newBitrate} kbps)`;
518
+ const oldRepresentation = isNaN(oldQuality) ? "Start" : `${oldQuality} (${oldBitrate} kbps)`;
519
+ const newRepresentation = `${newQuality} (${newBitrate} kbps)`;
522
520
 
523
- DebugToolInstance.dynamicMetric(`representation-${mediaType}`, [newQuality, newBitrate]);
521
+ DebugToolInstance.info(
522
+ `${mediaType} ABR Change ${abrType} From Representation ${oldRepresentation} to ${newRepresentation}`
523
+ );
524
+ }
524
525
 
525
- DebugToolInstance.info(
526
- `${mediaType} ABR Change Rendered From Representation ${oldRepresentation} To ${newRepresentation}`
527
- );
526
+ function onQualityChangeRequested(event) {
527
+ if (event.newQuality !== undefined) {
528
+ logBitrate("Requested", event);
528
529
  }
529
530
 
531
+ event.throughput = mediaPlayer.getAverageThroughput(mediaKind);
532
+
533
+ Plugins.interface.onQualityChangeRequested(event);
534
+ }
535
+
536
+ function onQualityChangeRendered(event) {
530
537
  if (event.newQuality !== undefined) {
531
- logBitrate(event);
538
+ logBitrate("Rendered", event);
532
539
  }
533
540
 
534
541
  emitPlayerInfo();
@@ -700,6 +707,7 @@ function MSEStrategy(mediaSources, windowType, mediaKind, playbackElement, isUHD
700
707
  mediaPlayer.on(DashJSEvents.MANIFEST_LOADED, onManifestLoaded);
701
708
  mediaPlayer.on(DashJSEvents.STREAM_INITIALIZED, onStreamInitialised);
702
709
  mediaPlayer.on(DashJSEvents.MANIFEST_VALIDITY_CHANGED, onManifestValidityChange);
710
+ mediaPlayer.on(DashJSEvents.QUALITY_CHANGE_REQUESTED, onQualityChangeRequested);
703
711
  mediaPlayer.on(DashJSEvents.QUALITY_CHANGE_RENDERED, onQualityChangeRendered);
704
712
  mediaPlayer.on(DashJSEvents.BASE_URL_SELECTED, onBaseUrlSelected);
705
713
  mediaPlayer.on(DashJSEvents.METRIC_ADDED, onMetricAdded);
@@ -810,6 +818,7 @@ function MSEStrategy(mediaSources, windowType, mediaKind, playbackElement, isUHD
810
818
  mediaPlayer.off(DashJSEvents.MANIFEST_VALIDITY_CHANGED, onManifestValidityChange);
811
819
  mediaPlayer.off(DashJSEvents.STREAM_INITIALIZED, onStreamInitialised);
812
820
  mediaPlayer.off(DashJSEvents.QUALITY_CHANGE_RENDERED, onQualityChangeRendered);
821
+ mediaPlayer.off(DashJSEvents.QUALITY_CHANGE_REQUESTED, onQualityChangeRequested);
813
822
  mediaPlayer.off(DashJSEvents.METRIC_ADDED, onMetricAdded);
814
823
  mediaPlayer.off(DashJSEvents.BASE_URL_SELECTED, onBaseUrlSelected);
815
824
  mediaPlayer.off(DashJSEvents.LOG, onDebugLog);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigscreen-player",
3
- "version": "8.7.2",
3
+ "version": "8.8.0",
4
4
  "type": "module",
5
5
  "description": "Simplified media playback for bigscreen devices.",
6
6
  "main": "dist/esm/main.js",