bigscreen-player 5.5.2 → 5.5.3

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 { b as TimeUtils, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-0a969f9e.js';
2
+ import { b as TimeUtils, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-bf9fddfc.js';
3
3
 
4
4
  function IMSCSubtitles (mediaPlayer, autoStart, parentElement, mediaSources, defaultStyleOpts) {
5
5
  const SEGMENTS_TO_KEEP = 3;
@@ -76,9 +76,9 @@ function IMSCSubtitles (mediaPlayer, autoStart, parentElement, mediaSources, def
76
76
  stop();
77
77
  }
78
78
  },
79
- onError: (statusCode) => {
79
+ onError: ({statusCode, ...rest} = {}) => {
80
80
  DebugTool.info('Error loading subtitles data: ' + statusCode);
81
- loadErrorFailover(statusCode);
81
+ loadErrorFailover({statusCode, ...rest});
82
82
  },
83
83
  onTimeout: () => {
84
84
  DebugTool.info('Request timeout loading subtitles');
@@ -100,13 +100,13 @@ function IMSCSubtitles (mediaPlayer, autoStart, parentElement, mediaSources, def
100
100
  }
101
101
  }
102
102
 
103
- function loadErrorFailover (statusCode) {
103
+ function loadErrorFailover (opts) {
104
104
  const errorCase = () => { DebugTool.info('No more CDNs available for subtitle failover'); };
105
105
 
106
106
  if ((liveSubtitles && loadErrorLimit()) || !liveSubtitles) {
107
107
  stop();
108
108
  segments = [];
109
- mediaSources.failoverSubtitles(start, errorCase, statusCode);
109
+ mediaSources.failoverSubtitles(start, errorCase, opts);
110
110
  }
111
111
  }
112
112
 
@@ -1,4 +1,4 @@
1
- import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-0a969f9e.js';
1
+ import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-bf9fddfc.js';
2
2
 
3
3
  /**
4
4
  * Safely checks if an attribute exists on an element.
@@ -364,10 +364,10 @@ function LegacySubtitles (mediaPlayer, autoStart, parentElement, mediaSources) {
364
364
  createContainer(responseXML);
365
365
  }
366
366
  },
367
- onError: (statusCode) => {
367
+ onError: ({statusCode, ...rest} = {}) => {
368
368
  const errorCase = () => { DebugTool.info('Failed to load from subtitles file from all available CDNs'); };
369
369
  DebugTool.info('Error loading subtitles data: ' + statusCode);
370
- mediaSources.failoverSubtitles(loadSubtitles, errorCase, statusCode);
370
+ mediaSources.failoverSubtitles(loadSubtitles, errorCase, {statusCode, ...rest});
371
371
  },
372
372
  onTimeout: () => {
373
373
  DebugTool.info('Request timeout loading subtitles');
@@ -5730,12 +5730,12 @@ function StrategyPicker (windowType, isUHD) {
5730
5730
  return resolve(NativeStrategy)
5731
5731
  }
5732
5732
 
5733
- return import('./msestrategy-5a02d016.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5733
+ return import('./msestrategy-f8f8e9fc.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5734
5734
  .catch(() => {
5735
5735
  reject({error: 'strategyDynamicLoadError'});
5736
5736
  })
5737
5737
  } else if (window.bigscreenPlayer.playbackStrategy === PlaybackStrategy.MSE) {
5738
- return import('./msestrategy-5a02d016.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5738
+ return import('./msestrategy-f8f8e9fc.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5739
5739
  .catch(() => {
5740
5740
  reject({error: 'strategyDynamicLoadError'});
5741
5741
  })
@@ -6127,7 +6127,7 @@ function CallCallbacks (callbacks, data) {
6127
6127
  callbacks.forEach((callback) => DeferExceptions(() => callback(data)));
6128
6128
  }
6129
6129
 
6130
- var version = "5.5.2";
6130
+ var version = "5.5.3";
6131
6131
 
6132
6132
  var sourceList;
6133
6133
  var source;
@@ -6740,7 +6740,7 @@ function LoadUrl (url, opts) {
6740
6740
  }
6741
6741
  } else {
6742
6742
  if (opts.onError) {
6743
- opts.onError(xhr.status);
6743
+ opts.onError({errorType: 'NON_200_ERROR', statusCode: xhr.status});
6744
6744
  }
6745
6745
  }
6746
6746
  }
@@ -6757,9 +6757,9 @@ function LoadUrl (url, opts) {
6757
6757
  }
6758
6758
  }
6759
6759
  xhr.send(opts.data || null);
6760
- } catch (ex) {
6760
+ } catch ({ name }) {
6761
6761
  if (opts.onError) {
6762
- opts.onError(xhr.status);
6762
+ opts.onError({errorType: name, statusCode: xhr.status});
6763
6763
  }
6764
6764
  }
6765
6765
  }
@@ -6938,14 +6938,14 @@ function MediaSources () {
6938
6938
  }
6939
6939
  }
6940
6940
 
6941
- function failoverSubtitles (postFailoverAction, failoverErrorAction, statusCode) {
6941
+ function failoverSubtitles (postFailoverAction, failoverErrorAction, {statusCode, ...rest} = {}) {
6942
6942
  if (subtitlesSources.length > 1) {
6943
- Plugins.interface.onSubtitlesLoadError({status: statusCode, severity: PluginEnums.STATUS.FAILOVER, cdn: getCurrentSubtitlesCdn()});
6943
+ Plugins.interface.onSubtitlesLoadError({status: statusCode, severity: PluginEnums.STATUS.FAILOVER, cdn: getCurrentSubtitlesCdn(), subtitlesSources: subtitlesSources.length, ...rest});
6944
6944
  subtitlesSources.shift();
6945
6945
  updateDebugOutput();
6946
6946
  if (postFailoverAction) { postFailoverAction(); }
6947
6947
  } else {
6948
- Plugins.interface.onSubtitlesLoadError({status: statusCode, severity: PluginEnums.STATUS.FATAL, cdn: getCurrentSubtitlesCdn()});
6948
+ Plugins.interface.onSubtitlesLoadError({status: statusCode, severity: PluginEnums.STATUS.FATAL, cdn: getCurrentSubtitlesCdn(), subtitlesSources: subtitlesSources.length, ...rest});
6949
6949
  if (failoverErrorAction) { failoverErrorAction(); }
6950
6950
  }
6951
6951
  }
@@ -7307,14 +7307,14 @@ function Subtitles (mediaPlayer, autoStart, playbackElement, defaultStyleOpts, m
7307
7307
  let subtitlesContainer;
7308
7308
 
7309
7309
  if (useLegacySubs) {
7310
- import('./legacysubtitles-e57b714b.js').then(({default: LegacySubtitles}) => {
7310
+ import('./legacysubtitles-03f02149.js').then(({default: LegacySubtitles}) => {
7311
7311
  subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7312
7312
  callback(subtitlesEnabled);
7313
7313
  }).catch(() => {
7314
7314
  Plugins.interface.onSubtitlesDynamicLoadError();
7315
7315
  });
7316
7316
  } else {
7317
- import('./imscsubtitles-77b97c49.js').then(({default: IMSCSubtitles}) => {
7317
+ import('./imscsubtitles-7c1dc134.js').then(({default: IMSCSubtitles}) => {
7318
7318
  subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7319
7319
  callback(subtitlesEnabled);
7320
7320
  }).catch(() => {
package/dist/esm/main.js CHANGED
@@ -1 +1 @@
1
- export { B as BigscreenPlayer, c as LiveSupport, d as MediaKinds, M as MediaState, f as MockBigscreenPlayer, g as PauseTriggers, h as PlaybackStrategy, i as TransferFormat, T as TransportControlPosition, W as WindowTypes } from './main-0a969f9e.js';
1
+ export { B as BigscreenPlayer, c as LiveSupport, d as MediaKinds, M as MediaState, f as MockBigscreenPlayer, g as PauseTriggers, h as PlaybackStrategy, i as TransferFormat, T as TransportControlPosition, W as WindowTypes } from './main-bf9fddfc.js';
@@ -1,4 +1,4 @@
1
- import { U as Utils, D as DOMHelpers, W as WindowTypes, c as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, d as MediaKinds, b as TimeUtils, e as DynamicWindowUtils } from './main-0a969f9e.js';
1
+ import { U as Utils, D as DOMHelpers, W as WindowTypes, c as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, d as MediaKinds, b as TimeUtils, e as DynamicWindowUtils } from './main-bf9fddfc.js';
2
2
  import { MediaPlayer } from 'dashjs/index_mediaplayerOnly';
3
3
 
4
4
  function filter (manifest, representationOptions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigscreen-player",
3
- "version": "5.5.2",
3
+ "version": "5.5.3",
4
4
  "description": "Simplified media playback for bigscreen devices.",
5
5
  "main": "dist/esm/main.js",
6
6
  "browser": "dist/esm/main.js",