bigscreen-player 6.0.2 → 6.0.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 { f as findSegmentTemplate, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-e14c09cf.js';
2
+ import { f as findSegmentTemplate, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-e9f1ce51.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 DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-e14c09cf.js';
1
+ import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-e9f1ce51.js';
2
2
 
3
3
  /**
4
4
  * Safely checks if an attribute exists on an element.
@@ -5771,7 +5771,7 @@ BasicStrategy.getLiveSupport = () => LiveSupport.SEEKABLE;
5771
5771
  function StrategyPicker() {
5772
5772
  return new Promise((resolve, reject) => {
5773
5773
  if (window.bigscreenPlayer.playbackStrategy === PlaybackStrategy.MSE) {
5774
- return import('./msestrategy-b880b00c.js')
5774
+ return import('./msestrategy-e2618304.js')
5775
5775
  .then(({ default: MSEStrategy }) => resolve(MSEStrategy))
5776
5776
  .catch(() => {
5777
5777
  reject({ error: "strategyDynamicLoadError" });
@@ -6217,7 +6217,7 @@ function CallCallbacks(callbacks, data) {
6217
6217
  }
6218
6218
  }
6219
6219
 
6220
- var version = "6.0.2";
6220
+ var version = "6.0.3";
6221
6221
 
6222
6222
  var sourceList;
6223
6223
  var source;
@@ -7591,7 +7591,7 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7591
7591
  let subtitlesContainer;
7592
7592
 
7593
7593
  if (useLegacySubs && available()) {
7594
- import('./legacysubtitles-32678af3.js')
7594
+ import('./legacysubtitles-b987cabe.js')
7595
7595
  .then(({ default: LegacySubtitles }) => {
7596
7596
  subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7597
7597
  callback(subtitlesEnabled);
@@ -7609,7 +7609,7 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7609
7609
  */
7610
7610
  Promise.resolve().then(() => callback(subtitlesEnabled));
7611
7611
  } else {
7612
- import('./imscsubtitles-aad19753.js')
7612
+ import('./imscsubtitles-4eeb4f23.js')
7613
7613
  .then(({ default: IMSCSubtitles }) => {
7614
7614
  subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7615
7615
  callback(subtitlesEnabled);
@@ -7722,7 +7722,7 @@ function BigscreenPlayer() {
7722
7722
  DebugTool$1.time(evt.data.currentTime);
7723
7723
  CallCallbacks(timeUpdateCallbacks, {
7724
7724
  currentTime: evt.data.currentTime,
7725
- endOfStream: endOfStream,
7725
+ endOfStream,
7726
7726
  });
7727
7727
  } else {
7728
7728
  let stateObject = { state: evt.data.state };
@@ -7768,11 +7768,7 @@ function BigscreenPlayer() {
7768
7768
  }
7769
7769
 
7770
7770
  function deviceTimeToDate(time) {
7771
- if (getWindowStartTime()) {
7772
- return new Date(convertVideoTimeSecondsToEpochMs(time))
7773
- } else {
7774
- return new Date(time * 1000)
7775
- }
7771
+ return getWindowStartTime() ? new Date(convertVideoTimeSecondsToEpochMs(time)) : new Date(time * 1000)
7776
7772
  }
7777
7773
 
7778
7774
  function convertVideoTimeSecondsToEpochMs(seconds) {
@@ -7838,7 +7834,7 @@ function BigscreenPlayer() {
7838
7834
  }
7839
7835
 
7840
7836
  function callSubtitlesCallbacks(enabled) {
7841
- CallCallbacks(subtitleCallbacks, { enabled: enabled });
7837
+ CallCallbacks(subtitleCallbacks, { enabled });
7842
7838
  }
7843
7839
 
7844
7840
  function setSubtitlesEnabled(enabled) {
@@ -7869,7 +7865,7 @@ function BigscreenPlayer() {
7869
7865
  * @param {boolean} enableSubtitles - Enable subtitles on initialisation
7870
7866
  * @param {InitCallbacks} callbacks
7871
7867
  */
7872
- init: (newPlaybackElement, bigscreenPlayerData, newWindowType, enableSubtitles, callbacks) => {
7868
+ init: (newPlaybackElement, bigscreenPlayerData, newWindowType, enableSubtitles, callbacks = {}) => {
7873
7869
  playbackElement = newPlaybackElement;
7874
7870
  Chronicle.init();
7875
7871
  resizer = Resizer();
@@ -7877,9 +7873,6 @@ function BigscreenPlayer() {
7877
7873
  DebugTool$1.keyValue({ key: "framework-version", value: version });
7878
7874
  windowType = newWindowType;
7879
7875
  serverDate = bigscreenPlayerData.serverDate;
7880
- if (!callbacks) {
7881
- callbacks = {};
7882
- }
7883
7876
 
7884
7877
  playerReadyCallback = callbacks.onSuccess;
7885
7878
  playerErrorCallback = callbacks.onError;
@@ -7895,15 +7888,6 @@ function BigscreenPlayer() {
7895
7888
 
7896
7889
  mediaSources = MediaSources();
7897
7890
 
7898
- // Backwards compatibility with Old API; to be removed on Major Version Update
7899
- if (bigscreenPlayerData.media && !bigscreenPlayerData.media.captions && bigscreenPlayerData.media.captionsUrl) {
7900
- bigscreenPlayerData.media.captions = [
7901
- {
7902
- url: bigscreenPlayerData.media.captionsUrl,
7903
- },
7904
- ];
7905
- }
7906
-
7907
7891
  mediaSources.init(bigscreenPlayerData.media, serverDate, windowType, getLiveSupport(), mediaSourceCallbacks);
7908
7892
  },
7909
7893
 
@@ -7912,7 +7896,7 @@ function BigscreenPlayer() {
7912
7896
  * @function
7913
7897
  * @name tearDown
7914
7898
  */
7915
- tearDown: function () {
7899
+ tearDown() {
7916
7900
  if (subtitles) {
7917
7901
  subtitles.tearDown();
7918
7902
  subtitles = undefined;
@@ -8013,7 +7997,7 @@ function BigscreenPlayer() {
8013
7997
  * @function
8014
7998
  * @param {Number} time - In seconds
8015
7999
  */
8016
- setCurrentTime: function (time) {
8000
+ setCurrentTime(time) {
8017
8001
  DebugTool$1.apicall("setCurrentTime");
8018
8002
  if (playerComponent) {
8019
8003
  // this flag must be set before calling into playerComponent.setCurrentTime - as this synchronously fires a WAITING event (when native strategy).
@@ -8063,7 +8047,7 @@ function BigscreenPlayer() {
8063
8047
  * @function
8064
8048
  * @returns {boolean} Returns true if media is initialised and playing a live stream within a tolerance of the end of the seekable range (10 seconds).
8065
8049
  */
8066
- isPlayingAtLiveEdge: function () {
8050
+ isPlayingAtLiveEdge() {
8067
8051
  return (
8068
8052
  !!playerComponent &&
8069
8053
  windowType !== WindowTypes.STATIC &&
@@ -8084,7 +8068,7 @@ function BigscreenPlayer() {
8084
8068
  windowStartTime: getWindowStartTime(),
8085
8069
  windowEndTime: getWindowEndTime(),
8086
8070
  initialPlaybackTime: initialPlaybackTimeEpoch,
8087
- serverDate: serverDate,
8071
+ serverDate,
8088
8072
  }
8089
8073
  },
8090
8074
 
@@ -8146,27 +8130,22 @@ function BigscreenPlayer() {
8146
8130
  * @function
8147
8131
  * @param {boolean} value
8148
8132
  */
8149
- setSubtitlesEnabled: setSubtitlesEnabled,
8133
+ setSubtitlesEnabled,
8150
8134
 
8151
8135
  /**
8152
8136
  * @function
8153
8137
  * @return if subtitles are currently enabled.
8154
8138
  */
8155
- isSubtitlesEnabled: isSubtitlesEnabled,
8139
+ isSubtitlesEnabled,
8156
8140
 
8157
8141
  /**
8158
8142
  * @function
8159
8143
  * @return Returns whether or not subtitles are currently enabled.
8160
8144
  */
8161
- isSubtitlesAvailable: isSubtitlesAvailable,
8145
+ isSubtitlesAvailable,
8162
8146
 
8163
- areSubtitlesCustomisable: () => {
8164
- return !(
8165
- window.bigscreenPlayer &&
8166
- window.bigscreenPlayer.overrides &&
8167
- window.bigscreenPlayer.overrides.legacySubtitles
8168
- )
8169
- },
8147
+ areSubtitlesCustomisable: () =>
8148
+ !(window.bigscreenPlayer && window.bigscreenPlayer.overrides && window.bigscreenPlayer.overrides.legacySubtitles),
8170
8149
 
8171
8150
  customiseSubtitles: (styleOpts) => {
8172
8151
  if (subtitles) {
@@ -8203,7 +8182,7 @@ function BigscreenPlayer() {
8203
8182
  * @function
8204
8183
  * @return Returns whether the current media asset is seekable.
8205
8184
  */
8206
- canSeek: function () {
8185
+ canSeek() {
8207
8186
  return (
8208
8187
  windowType === WindowTypes.STATIC ||
8209
8188
  DynamicWindowUtils.canSeek(getWindowStartTime(), getWindowEndTime(), getLiveSupport(), this.getSeekableRange())
@@ -8214,19 +8193,16 @@ function BigscreenPlayer() {
8214
8193
  * @function
8215
8194
  * @return Returns whether the current media asset is pausable.
8216
8195
  */
8217
- canPause: () => {
8218
- return (
8219
- windowType === WindowTypes.STATIC ||
8220
- DynamicWindowUtils.canPause(getWindowStartTime(), getWindowEndTime(), getLiveSupport())
8221
- )
8222
- },
8196
+ canPause: () =>
8197
+ windowType === WindowTypes.STATIC ||
8198
+ DynamicWindowUtils.canPause(getWindowStartTime(), getWindowEndTime(), getLiveSupport()),
8223
8199
 
8224
8200
  /**
8225
8201
  * Return a mock for in place testing.
8226
8202
  * @function
8227
8203
  * @param {*} opts
8228
8204
  */
8229
- mock: function (opts) {
8205
+ mock(opts) {
8230
8206
  MockBigscreenPlayer.mock(this, opts);
8231
8207
  },
8232
8208
 
@@ -8234,7 +8210,7 @@ function BigscreenPlayer() {
8234
8210
  * Unmock the player.
8235
8211
  * @function
8236
8212
  */
8237
- unmock: function () {
8213
+ unmock() {
8238
8214
  MockBigscreenPlayer.unmock(this);
8239
8215
  },
8240
8216
 
@@ -8243,7 +8219,7 @@ function BigscreenPlayer() {
8243
8219
  * @function
8244
8220
  * @param {*} opts
8245
8221
  */
8246
- mockJasmine: function (opts) {
8222
+ mockJasmine(opts) {
8247
8223
  MockBigscreenPlayer.mockJasmine(this, opts);
8248
8224
  },
8249
8225
 
@@ -8279,30 +8255,27 @@ function BigscreenPlayer() {
8279
8255
  * @param {Number} epochTime - Unix Epoch based time in milliseconds.
8280
8256
  * @return the time in seconds within the current sliding window.
8281
8257
  */
8282
- convertEpochMsToVideoTimeSeconds: (epochTime) => {
8283
- return getWindowStartTime() ? Math.floor((epochTime - getWindowStartTime()) / 1000) : null
8284
- },
8258
+ convertEpochMsToVideoTimeSeconds: (epochTime) =>
8259
+ getWindowStartTime() ? Math.floor((epochTime - getWindowStartTime()) / 1000) : null,
8285
8260
 
8286
8261
  /**
8287
8262
  * @function
8288
8263
  * @return The runtime version of the library.
8289
8264
  */
8290
- getFrameworkVersion: () => {
8291
- return version
8292
- },
8265
+ getFrameworkVersion: () => version,
8293
8266
 
8294
8267
  /**
8295
8268
  * @function
8296
8269
  * @param {Number} time - Seconds
8297
8270
  * @return the time in milliseconds within the current sliding window.
8298
8271
  */
8299
- convertVideoTimeSecondsToEpochMs: convertVideoTimeSecondsToEpochMs,
8272
+ convertVideoTimeSecondsToEpochMs,
8300
8273
 
8301
8274
  /**
8302
8275
  * Toggle the visibility of the debug tool overlay.
8303
8276
  * @function
8304
8277
  */
8305
- toggleDebug: toggleDebug,
8278
+ toggleDebug,
8306
8279
 
8307
8280
  /**
8308
8281
  * @function
package/dist/esm/main.js CHANGED
@@ -1 +1 @@
1
- export { B as BigscreenPlayer, b as LiveSupport, c as MediaKinds, M as MediaState, g as MockBigscreenPlayer, h as PauseTriggers, i as PlaybackStrategy, j as TransferFormat, T as TransportControlPosition, W as WindowTypes } from './main-e14c09cf.js';
1
+ export { B as BigscreenPlayer, b as LiveSupport, c as MediaKinds, M as MediaState, g as MockBigscreenPlayer, h as PauseTriggers, i as PlaybackStrategy, j as TransferFormat, T as TransportControlPosition, W as WindowTypes } from './main-e9f1ce51.js';
@@ -1,4 +1,4 @@
1
- import { U as Utils, D as DOMHelpers, W as WindowTypes, b as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, c as MediaKinds, d as TimeUtils, e as DynamicWindowUtils } from './main-e14c09cf.js';
1
+ import { U as Utils, D as DOMHelpers, W as WindowTypes, b as LiveSupport, M as MediaState, a as DebugTool, P as Plugins, c as MediaKinds, d as TimeUtils, e as DynamicWindowUtils } from './main-e9f1ce51.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": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "description": "Simplified media playback for bigscreen devices.",
5
5
  "main": "dist/esm/main.js",
6
6
  "browser": "dist/esm/main.js",