bigscreen-player 5.7.0 → 5.7.2

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.
package/README.md CHANGED
@@ -8,20 +8,20 @@
8
8
 
9
9
  _Bigscreen Player_ is an open source project developed by the BBC to simplify video and audio playback on a wide range of 'bigscreen' devices (TVs, set-top boxes, games consoles, and streaming devices).
10
10
 
11
- For documentation on using this library, please see our [Getting Started guide](https://bbc.github.io/bigscreen-player/api/tutorial-Getting%20Started.html).
11
+ For documentation on using this library, please see our [Getting Started guide](https://bbc.github.io/bigscreen-player/api/tutorial-00-getting-started.html).
12
12
 
13
13
  ## Running Locally
14
14
 
15
15
  Install dependencies:
16
16
 
17
17
  ```bash
18
- $ npm install
18
+ npm install
19
19
  ```
20
20
 
21
21
  You can run Bigscreen Player locally in a dev environment by running:
22
22
 
23
23
  ```bash
24
- $ npm run start
24
+ npm run start
25
25
  ```
26
26
 
27
27
  This will open a web page at `localhost:8080`.
@@ -31,7 +31,7 @@ This will open a web page at `localhost:8080`.
31
31
  The project is unit tested using [Jest](https://jestjs.io/). To run the tests:
32
32
 
33
33
  ```bash
34
- $ npm test
34
+ npm test
35
35
  ```
36
36
 
37
37
  This project currently has unit test coverage but no integration test suite. This is on our Roadmap to address.
@@ -50,7 +50,7 @@ This project currently has unit test coverage but no integration test suite. Thi
50
50
  Bigscreen Player uses JSDocs to autogenerate API documentation. To regenerate the documentation run:
51
51
 
52
52
  ```bash
53
- $ npm run docs
53
+ npm run docs
54
54
  ```
55
55
 
56
56
  ## Contributing
@@ -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-ed4ed68c.js';
2
+ import { f as findSegmentTemplate, L as LoadUrl, a as DebugTool, P as Plugins, U as Utils, D as DOMHelpers } from './main-2b49fbff.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-ed4ed68c.js';
1
+ import { D as DOMHelpers, a as DebugTool, P as Plugins, L as LoadUrl, T as TransportControlPosition } from './main-2b49fbff.js';
2
2
 
3
3
  /**
4
4
  * Safely checks if an attribute exists on an element.
@@ -5782,13 +5782,13 @@ function StrategyPicker(windowType, isUHD) {
5782
5782
  return resolve(NativeStrategy)
5783
5783
  }
5784
5784
 
5785
- return import('./msestrategy-d7ab33d6.js')
5785
+ return import('./msestrategy-d14fb443.js')
5786
5786
  .then(({ default: MSEStrategy }) => resolve(MSEStrategy))
5787
5787
  .catch(() => {
5788
5788
  reject({ error: "strategyDynamicLoadError" });
5789
5789
  })
5790
5790
  } else if (window.bigscreenPlayer.playbackStrategy === PlaybackStrategy.MSE) {
5791
- return import('./msestrategy-d7ab33d6.js')
5791
+ return import('./msestrategy-d14fb443.js')
5792
5792
  .then(({ default: MSEStrategy }) => resolve(MSEStrategy))
5793
5793
  .catch(() => {
5794
5794
  reject({ error: "strategyDynamicLoadError" });
@@ -6230,7 +6230,7 @@ function CallCallbacks(callbacks, data) {
6230
6230
  }
6231
6231
  }
6232
6232
 
6233
- var version = "5.7.0";
6233
+ var version = "5.7.2";
6234
6234
 
6235
6235
  var sourceList;
6236
6236
  var source;
@@ -7603,8 +7603,8 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7603
7603
  let subtitlesEnabled = autoStart;
7604
7604
  let subtitlesContainer;
7605
7605
 
7606
- if (useLegacySubs) {
7607
- import('./legacysubtitles-cd694760.js')
7606
+ if (useLegacySubs && available()) {
7607
+ import('./legacysubtitles-c12f62b2.js')
7608
7608
  .then(({ default: LegacySubtitles }) => {
7609
7609
  subtitlesContainer = LegacySubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7610
7610
  callback(subtitlesEnabled);
@@ -7612,8 +7612,17 @@ function Subtitles(mediaPlayer, autoStart, playbackElement, defaultStyleOpts, me
7612
7612
  .catch(() => {
7613
7613
  Plugins.interface.onSubtitlesDynamicLoadError();
7614
7614
  });
7615
+ } else if (useLegacySubs) {
7616
+ /* This is needed to deal with a race condition wherein the Subtitles Callback runs before the Subtitles object
7617
+ * has finished construction. This is leveraging a feature of the Javascript Event Loop, specifically how it interacts
7618
+ * with Promises, called Microtasks.
7619
+ *
7620
+ * For more information, please see:
7621
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
7622
+ */
7623
+ Promise.resolve().then(() => callback(subtitlesEnabled));
7615
7624
  } else {
7616
- import('./imscsubtitles-19fb764e.js')
7625
+ import('./imscsubtitles-15051f28.js')
7617
7626
  .then(({ default: IMSCSubtitles }) => {
7618
7627
  subtitlesContainer = IMSCSubtitles(mediaPlayer, autoStart, playbackElement, mediaSources, defaultStyleOpts);
7619
7628
  callback(subtitlesEnabled);
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-ed4ed68c.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-2b49fbff.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-ed4ed68c.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-2b49fbff.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.7.0",
3
+ "version": "5.7.2",
4
4
  "description": "Simplified media playback for bigscreen devices.",
5
5
  "main": "dist/esm/main.js",
6
6
  "browser": "dist/esm/main.js",
@@ -15,7 +15,9 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "prepare": "[ ! -d dist/ ] && npm run build || exit 0",
18
- "docs": "npx jsdoc -c jsdoc.conf.json",
18
+ "docs": "npm run docs:clean && npm run docs:build",
19
+ "docs:clean": "rm -r ./docs/api",
20
+ "docs:build": "jsdoc -c jsdoc.conf.json",
19
21
  "build": "npm run build:clean && npm run build:bundle",
20
22
  "build:clean": "rm -rf dist",
21
23
  "build:bundle": "rollup -c rollup.config.js",
@@ -42,7 +44,7 @@
42
44
  "@rollup/plugin-json": "^4.1.0",
43
45
  "@rollup/plugin-node-resolve": "^13.0.4",
44
46
  "babel-jest": "^27.0.6",
45
- "clean-jsdoc-theme": "^3.2.7",
47
+ "clean-jsdoc-theme": "^4.2.7",
46
48
  "eslint": "^8.27.0",
47
49
  "eslint-plugin-import": "^2.26.0",
48
50
  "eslint-plugin-jest": "^27.1.4",