bigscreen-player 10.11.1 → 10.12.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.
@@ -1,5 +1,5 @@
1
1
  import { fromXML, generateISD, renderHTML } from 'smp-imsc';
2
- import { U as Utils, a as DebugTool, P as Plugins, D as DOMHelpers } from './main-18f937fd.js';
2
+ import { U as Utils, a as DebugTool, P as Plugins, D as DOMHelpers } from './main-cdd18b95.js';
3
3
  import 'tslib';
4
4
 
5
5
  function EmbeddedSubtitles(mediaPlayer, autoStart, parentElement, _mediaSources, defaultStyleOpts) {
@@ -1,5 +1,5 @@
1
1
  import { fromXML, generateISD, renderHTML } from 'smp-imsc';
2
- import { f as findSegmentTemplate, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-18f937fd.js';
2
+ import { f as findSegmentTemplate, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-cdd18b95.js';
3
3
  import 'tslib';
4
4
 
5
5
  const SEGMENTS_BUFFER_SIZE = 3;
@@ -1,4 +1,4 @@
1
- import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-18f937fd.js';
1
+ import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-cdd18b95.js';
2
2
  import 'tslib';
3
3
 
4
4
  /**
@@ -5710,7 +5710,7 @@ BasicStrategy.getLiveSupport = () => LiveSupport.SEEKABLE;
5710
5710
  function StrategyPicker() {
5711
5711
  return new Promise((resolve, reject) => {
5712
5712
  if (window.bigscreenPlayer.playbackStrategy === PlaybackStrategy.MSE) {
5713
- return import('./msestrategy-375cdc09.js')
5713
+ return import('./msestrategy-4caf1374.js')
5714
5714
  .then(({ default: MSEStrategy }) => resolve(MSEStrategy))
5715
5715
  .catch((reason) => {
5716
5716
  const error = new Error(isError(reason) ? reason.message : undefined);
@@ -6020,6 +6020,12 @@ var Plugins = {
6020
6020
  },
6021
6021
  };
6022
6022
 
6023
+ const AbortStages = {
6024
+ DATA_LOADED: "bigscreen-player-data-loaded",
6025
+ PLAYER_COMPONENT: "bigscreen-player-player-component",
6026
+ STRATEGY: "bigscreen-player-strategy",
6027
+ };
6028
+
6023
6029
  /**
6024
6030
  * @import { InitData } from './types.d.ts'
6025
6031
  * @import { MediaSources } from './mediasources'
@@ -6051,7 +6057,8 @@ function PlayerComponent(
6051
6057
  mediaSources,
6052
6058
  stateUpdateCallback,
6053
6059
  errorCallback,
6054
- audioDescribedCallback
6060
+ audioDescribedCallback,
6061
+ abortSignal
6055
6062
  ) {
6056
6063
  let setSubtitlesState;
6057
6064
  let _stateUpdateCallback = stateUpdateCallback;
@@ -6067,6 +6074,8 @@ function PlayerComponent(
6067
6074
 
6068
6075
  StrategyPicker()
6069
6076
  .then((strategy) => {
6077
+ abortSignal.throwIfAborted(AbortStages.PLAYER_COMPONENT);
6078
+
6070
6079
  playbackStrategy = strategy(
6071
6080
  mediaSources,
6072
6081
  mediaKind,
@@ -6499,7 +6508,7 @@ const PauseTriggers = {
6499
6508
  DEVICE: 3,
6500
6509
  };
6501
6510
 
6502
- var Version = "10.11.1";
6511
+ var Version = "10.12.1";
6503
6512
 
6504
6513
  /* eslint-disable no-use-before-define */
6505
6514
 
@@ -7685,7 +7694,7 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7685
7694
 
7686
7695
  if (available()) {
7687
7696
  if (useLegacySubs) {
7688
- import('./legacysubtitles-e1a136df.js')
7697
+ import('./legacysubtitles-7fcd36b2.js')
7689
7698
  .then(({ default: LegacySubtitles }) => {
7690
7699
  subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7691
7700
  callback(subtitlesEnabled);
@@ -7694,7 +7703,7 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7694
7703
  Plugins.interface.onSubtitlesDynamicLoadError();
7695
7704
  });
7696
7705
  } else if (embeddedSubs) {
7697
- import('./embeddedsubtitles-7c8c8a36.js')
7706
+ import('./embeddedsubtitles-5f615acb.js')
7698
7707
  .then(({ default: EmbeddedSubtitles }) => {
7699
7708
  subtitlesContainer = EmbeddedSubtitles(
7700
7709
  mediaPlayer,
@@ -7709,7 +7718,7 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7709
7718
  Plugins.interface.onSubtitlesDynamicLoadError();
7710
7719
  });
7711
7720
  } else {
7712
- import('./imscsubtitles-f6c1960c.js')
7721
+ import('./imscsubtitles-88afe955.js')
7713
7722
  .then(({ default: IMSCSubtitles }) => {
7714
7723
  subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7715
7724
  callback(subtitlesEnabled);
@@ -7812,6 +7821,26 @@ const Timeline = {
7812
7821
  PRESENTATION_TIME: "presentationTime",
7813
7822
  };
7814
7823
 
7824
+ class AbortError extends Error {
7825
+ constructor(abortStage) {
7826
+ super(`bigscreen-player aborted at ${abortStage}`);
7827
+ this.name = "AbortError";
7828
+ }
7829
+ }
7830
+ class AbortSignal {
7831
+ constructor() {
7832
+ this.aborted = false;
7833
+ }
7834
+ throwIfAborted(abortStage) {
7835
+ if (!this.aborted)
7836
+ return;
7837
+ throw new AbortError(abortStage);
7838
+ }
7839
+ abort() {
7840
+ this.aborted = true;
7841
+ }
7842
+ }
7843
+
7815
7844
  /**
7816
7845
  * @module bigscreenplayer/bigscreenplayer
7817
7846
  */
@@ -7846,6 +7875,8 @@ function BigscreenPlayer() {
7846
7875
 
7847
7876
  const END_OF_STREAM_TOLERANCE = 10;
7848
7877
 
7878
+ const abortSignal = new AbortSignal();
7879
+
7849
7880
  function mediaStateUpdateCallback(evt) {
7850
7881
  if (evt.timeUpdate) {
7851
7882
  CallCallbacks(_callbacks.timeUpdate, {
@@ -7899,6 +7930,8 @@ function BigscreenPlayer() {
7899
7930
  }
7900
7931
 
7901
7932
  function bigscreenPlayerDataLoaded({ media, enableSubtitles, enableAudioDescribed }) {
7933
+ abortSignal.throwIfAborted(AbortStages.DATA_LOADED);
7934
+
7902
7935
  const initialPresentationTime =
7903
7936
  initialPlaybackTime == null ? undefined : convertPlaybackTimeToPresentationTimeInSeconds(initialPlaybackTime);
7904
7937
 
@@ -7913,7 +7946,8 @@ function BigscreenPlayer() {
7913
7946
  mediaSources,
7914
7947
  mediaStateUpdateCallback,
7915
7948
  _callbacks.playerError,
7916
- callAudioDescribedCallbacks
7949
+ callAudioDescribedCallbacks,
7950
+ abortSignal
7917
7951
  );
7918
7952
 
7919
7953
  readyHelper = ReadyHelper(
@@ -8104,6 +8138,8 @@ function BigscreenPlayer() {
8104
8138
  * @name tearDown
8105
8139
  */
8106
8140
  tearDown() {
8141
+ abortSignal.abort();
8142
+
8107
8143
  if (subtitles) {
8108
8144
  subtitles.tearDown();
8109
8145
  subtitles = undefined;
package/dist/esm/main.js CHANGED
@@ -1,2 +1,2 @@
1
- export { B as BigscreenPlayer, a as DebugTool, E as EntryCategory, b as LiveSupport, c as ManifestType, M as MediaKinds, d as MediaState, g as MockBigscreenPlayer, h as PauseTriggers, i as PlaybackStrategy, k as Timeline, j as TransferFormat, T as TransportControlPosition, W as WindowTypes, l as isMessage, m as isMetric, n as isTrace } from './main-18f937fd.js';
1
+ export { B as BigscreenPlayer, a as DebugTool, E as EntryCategory, b as LiveSupport, c as ManifestType, M as MediaKinds, d as MediaState, g as MockBigscreenPlayer, h as PauseTriggers, i as PlaybackStrategy, k as Timeline, j as TransferFormat, T as TransportControlPosition, W as WindowTypes, l as isMessage, m as isMetric, n as isTrace } from './main-cdd18b95.js';
2
2
  import 'tslib';
@@ -1,5 +1,5 @@
1
1
  import { MediaPlayer } from 'dashjs/index';
2
- import { U as Utils, M as MediaKinds, b as LiveSupport, a as DebugTool, c as ManifestType, P as Plugins, d as MediaState, e as autoResumeAtStartOfRange, D as DOMHelpers } from './main-18f937fd.js';
2
+ import { U as Utils, M as MediaKinds, b as LiveSupport, a as DebugTool, c as ManifestType, P as Plugins, d as MediaState, e as autoResumeAtStartOfRange, D as DOMHelpers } from './main-cdd18b95.js';
3
3
  import 'tslib';
4
4
 
5
5
  function filter(manifest, representationOptions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigscreen-player",
3
- "version": "10.11.1",
3
+ "version": "10.12.1",
4
4
  "type": "module",
5
5
  "description": "Simplified media playback for bigscreen devices.",
6
6
  "main": "dist/esm/main.js",