bigscreen-player 5.4.2 → 5.4.5

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-5a3f2039.js';
2
+ import { b as TimeUtils, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-92ec262f.js';
3
3
 
4
4
  function IMSCSubtitles (mediaPlayer, autoStart, parentElement, mediaSources, defaultStyleOpts) {
5
5
  const SEGMENTS_TO_KEEP = 3;
@@ -1,4 +1,4 @@
1
- import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-5a3f2039.js';
1
+ import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-92ec262f.js';
2
2
 
3
3
  /**
4
4
  * Safely checks if an attribute exists on an element.
@@ -2357,22 +2357,15 @@ function Html5 () {
2357
2357
  readyToCache = true;
2358
2358
  }, 250);
2359
2359
 
2360
- cachedSeekableRange = {
2361
- start: mediaElement.seekable.start(0),
2362
- end: mediaElement.seekable.end(0)
2363
- };
2360
+ cachedSeekableRange = getElementSeekableRange();
2364
2361
  }
2365
2362
 
2366
- function getSeekableRange () {
2363
+ function getElementSeekableRange () {
2367
2364
  if (mediaElement) {
2368
2365
  if (isReadyToPlayFrom() && mediaElement.seekable && mediaElement.seekable.length > 0) {
2369
- if (window.bigscreenPlayer.overrides && window.bigscreenPlayer.overrides.cacheSeekableRange) {
2370
- return getCachedSeekableRange()
2371
- } else {
2372
- return {
2373
- start: mediaElement.seekable.start(0),
2374
- end: mediaElement.seekable.end(0)
2375
- }
2366
+ return {
2367
+ start: mediaElement.seekable.start(0),
2368
+ end: mediaElement.seekable.end(0)
2376
2369
  }
2377
2370
  } else if (mediaElement.duration !== undefined) {
2378
2371
  return {
@@ -2381,7 +2374,14 @@ function Html5 () {
2381
2374
  }
2382
2375
  }
2383
2376
  }
2384
- return undefined
2377
+ }
2378
+
2379
+ function getSeekableRange () {
2380
+ if (window.bigscreenPlayer.overrides && window.bigscreenPlayer.overrides.cacheSeekableRange) {
2381
+ return getCachedSeekableRange()
2382
+ } else {
2383
+ return getElementSeekableRange()
2384
+ }
2385
2385
  }
2386
2386
 
2387
2387
  function onFinishedBuffering () {
@@ -5711,12 +5711,12 @@ function StrategyPicker (windowType, isUHD) {
5711
5711
  return resolve(NativeStrategy)
5712
5712
  }
5713
5713
 
5714
- return import('./msestrategy-7485a9bd.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5714
+ return import('./msestrategy-50af41ca.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5715
5715
  .catch(() => {
5716
5716
  reject({error: 'strategyDynamicLoadError'});
5717
5717
  })
5718
5718
  } else if (window.bigscreenPlayer.playbackStrategy === PlaybackStrategy.MSE) {
5719
- return import('./msestrategy-7485a9bd.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5719
+ return import('./msestrategy-50af41ca.js').then(({default: MSEStrategy}) => resolve(MSEStrategy))
5720
5720
  .catch(() => {
5721
5721
  reject({error: 'strategyDynamicLoadError'});
5722
5722
  })
@@ -6096,7 +6096,7 @@ function CallCallbacks (callbacks, data) {
6096
6096
  callbacks.forEach((callback) => DeferExceptions(() => callback(data)));
6097
6097
  }
6098
6098
 
6099
- var version = "5.4.2";
6099
+ var version = "5.4.5";
6100
6100
 
6101
6101
  var sourceList;
6102
6102
  var source;
@@ -6292,33 +6292,27 @@ var mockFunctions = {
6292
6292
  return callback
6293
6293
  },
6294
6294
  unregisterForTimeUpdates: function (callback) {
6295
- var indexOf = timeUpdateCallbacks.indexOf(callback);
6296
-
6297
- if (indexOf !== -1) {
6298
- timeUpdateCallbacks.splice(indexOf, 1);
6299
- }
6295
+ timeUpdateCallbacks = timeUpdateCallbacks.filter(function (existingCallback) {
6296
+ return callback !== existingCallback
6297
+ });
6300
6298
  },
6301
6299
  registerForSubtitleChanges: function (callback) {
6302
6300
  subtitleCallbacks.push(callback);
6303
6301
  return callback
6304
6302
  },
6305
6303
  unregisterForSubtitleChanges: function (callback) {
6306
- var indexOf = subtitleCallbacks.indexOf(callback);
6307
-
6308
- if (indexOf !== -1) {
6309
- subtitleCallbacks.splice(indexOf, 1);
6310
- }
6304
+ subtitleCallbacks = subtitleCallbacks.filter(function (existingCallback) {
6305
+ return callback !== existingCallback
6306
+ });
6311
6307
  },
6312
6308
  registerForStateChanges: function (callback) {
6313
6309
  stateChangeCallbacks.push(callback);
6314
6310
  return callback
6315
6311
  },
6316
6312
  unregisterForStateChanges: function (callback) {
6317
- var indexOf = stateChangeCallbacks.indexOf(callback);
6318
-
6319
- if (indexOf !== -1) {
6320
- stateChangeCallbacks.splice(indexOf, 1);
6321
- }
6313
+ stateChangeCallbacks = stateChangeCallbacks.filter(function (existingCallback) {
6314
+ return callback !== existingCallback
6315
+ });
6322
6316
  },
6323
6317
  setCurrentTime: function (time) {
6324
6318
  currentTime = time;
@@ -7282,14 +7276,14 @@ function Subtitles (mediaPlayer, autoStart, playbackElement, defaultStyleOpts, m
7282
7276
  let subtitlesContainer;
7283
7277
 
7284
7278
  if (useLegacySubs) {
7285
- import('./legacysubtitles-249d3851.js').then(({default: LegacySubtitles}) => {
7279
+ import('./legacysubtitles-3264a5f7.js').then(({default: LegacySubtitles}) => {
7286
7280
  subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7287
7281
  callback(subtitlesEnabled);
7288
7282
  }).catch(() => {
7289
7283
  Plugins.interface.onSubtitlesDynamicLoadError();
7290
7284
  });
7291
7285
  } else {
7292
- import('./imscsubtitles-f57c0961.js').then(({default: IMSCSubtitles}) => {
7286
+ import('./imscsubtitles-08f96c36.js').then(({default: IMSCSubtitles}) => {
7293
7287
  subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7294
7288
  callback(subtitlesEnabled);
7295
7289
  }).catch(() => {
@@ -7623,10 +7617,9 @@ function BigscreenPlayer () {
7623
7617
  * @param {Function} callback
7624
7618
  */
7625
7619
  unregisterForStateChanges: (callback) => {
7626
- const indexOf = stateChangeCallbacks.indexOf(callback);
7627
- if (indexOf !== -1) {
7628
- stateChangeCallbacks.splice(indexOf, 1);
7629
- }
7620
+ stateChangeCallbacks = stateChangeCallbacks.filter(function (existingCallback) {
7621
+ return callback !== existingCallback
7622
+ });
7630
7623
  },
7631
7624
 
7632
7625
  /**
@@ -7645,11 +7638,9 @@ function BigscreenPlayer () {
7645
7638
  * @param {Function} callback
7646
7639
  */
7647
7640
  unregisterForTimeUpdates: (callback) => {
7648
- const indexOf = timeUpdateCallbacks.indexOf(callback);
7649
-
7650
- if (indexOf !== -1) {
7651
- timeUpdateCallbacks.splice(indexOf, 1);
7652
- }
7641
+ timeUpdateCallbacks = timeUpdateCallbacks.filter(function (existingCallback) {
7642
+ return callback !== existingCallback
7643
+ });
7653
7644
  },
7654
7645
 
7655
7646
  /**
@@ -7668,10 +7659,9 @@ function BigscreenPlayer () {
7668
7659
  * @param {Function} callback
7669
7660
  */
7670
7661
  unregisterForSubtitleChanges: (callback) => {
7671
- const indexOf = subtitleCallbacks.indexOf(callback);
7672
- if (indexOf !== -1) {
7673
- subtitleCallbacks.splice(indexOf, 1);
7674
- }
7662
+ subtitleCallbacks = subtitleCallbacks.filter(function (existingCallback) {
7663
+ return callback !== existingCallback
7664
+ });
7675
7665
  },
7676
7666
 
7677
7667
  /**
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-5a3f2039.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-92ec262f.js';
@@ -1,4 +1,4 @@
1
- import { D as DOMHelpers, W as WindowTypes, c as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, d as MediaKinds, U as Utils, b as TimeUtils, e as DynamicWindowUtils } from './main-5a3f2039.js';
1
+ import { D as DOMHelpers, W as WindowTypes, c as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, d as MediaKinds, U as Utils, b as TimeUtils, e as DynamicWindowUtils } from './main-92ec262f.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.4.2",
3
+ "version": "5.4.5",
4
4
  "description": "Simplified media playback for bigscreen devices.",
5
5
  "main": "dist/esm/main.js",
6
6
  "browser": "dist/esm/main.js",