@mattebox/player 0.8.0 → 0.9.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.
- package/dist/cdn/mattebox-player.min.js +3 -3
- package/dist/controls/cues.d.ts.map +1 -1
- package/dist/controls/cues.js +11 -5
- package/dist/controls/cues.js.map +1 -1
- package/dist/controls/icons.d.ts +5 -30
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/icons.js +38 -29
- package/dist/controls/icons.js.map +1 -1
- package/dist/controls/menu.d.ts +20 -0
- package/dist/controls/menu.d.ts.map +1 -1
- package/dist/controls/menu.js +83 -14
- package/dist/controls/menu.js.map +1 -1
- package/dist/element.d.ts +36 -2
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +140 -24
- package/dist/element.js.map +1 -1
- package/dist/elements/audio-menu.d.ts.map +1 -1
- package/dist/elements/audio-menu.js +3 -1
- package/dist/elements/audio-menu.js.map +1 -1
- package/dist/elements/component.d.ts.map +1 -1
- package/dist/elements/component.js +10 -0
- package/dist/elements/component.js.map +1 -1
- package/dist/elements/control-bar.d.ts +2 -0
- package/dist/elements/control-bar.d.ts.map +1 -1
- package/dist/elements/control-bar.js +23 -7
- package/dist/elements/control-bar.js.map +1 -1
- package/dist/elements/current-time.d.ts.map +1 -1
- package/dist/elements/current-time.js +1 -1
- package/dist/elements/current-time.js.map +1 -1
- package/dist/elements/drm-badge.js +1 -1
- package/dist/elements/duration.d.ts.map +1 -1
- package/dist/elements/duration.js +6 -2
- package/dist/elements/duration.js.map +1 -1
- package/dist/elements/error-screen.js +1 -1
- package/dist/elements/live-button.js +1 -1
- package/dist/elements/marker-button.d.ts +3 -3
- package/dist/elements/marker-button.d.ts.map +1 -1
- package/dist/elements/marker-button.js +18 -22
- package/dist/elements/marker-button.js.map +1 -1
- package/dist/elements/menu-element.d.ts.map +1 -1
- package/dist/elements/menu-element.js +2 -1
- package/dist/elements/menu-element.js.map +1 -1
- package/dist/elements/quality-menu.js +1 -1
- package/dist/elements/quality-menu.js.map +1 -1
- package/dist/elements/scan-button.js +1 -1
- package/dist/elements/seek-bar.d.ts.map +1 -1
- package/dist/elements/seek-bar.js +5 -4
- package/dist/elements/seek-bar.js.map +1 -1
- package/dist/elements/shared.js +3 -3
- package/dist/elements/skip-button.js +2 -2
- package/dist/elements/skip-button.js.map +1 -1
- package/dist/elements/spinner.js +1 -1
- package/dist/elements/start-button.d.ts +8 -0
- package/dist/elements/start-button.d.ts.map +1 -1
- package/dist/elements/start-button.js +18 -2
- package/dist/elements/start-button.js.map +1 -1
- package/dist/elements/subtitles-menu.d.ts +5 -1
- package/dist/elements/subtitles-menu.d.ts.map +1 -1
- package/dist/elements/subtitles-menu.js +29 -11
- package/dist/elements/subtitles-menu.js.map +1 -1
- package/dist/elements/title.d.ts.map +1 -1
- package/dist/elements/title.js +3 -1
- package/dist/elements/title.js.map +1 -1
- package/dist/elements/volume-slider.js +1 -1
- package/dist/elements/volume.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/controls/chapters.js +1 -1
- package/dist/es2015/controls/cues.js +11 -5
- package/dist/es2015/controls/icons.js +38 -29
- package/dist/es2015/controls/menu.js +89 -17
- package/dist/es2015/element.js +144 -30
- package/dist/es2015/elements/audio-menu.js +4 -1
- package/dist/es2015/elements/component.js +10 -0
- package/dist/es2015/elements/control-bar.js +23 -7
- package/dist/es2015/elements/current-time.js +1 -1
- package/dist/es2015/elements/drm-badge.js +1 -1
- package/dist/es2015/elements/duration.js +6 -2
- package/dist/es2015/elements/error-screen.js +1 -1
- package/dist/es2015/elements/live-button.js +1 -1
- package/dist/es2015/elements/marker-button.js +19 -23
- package/dist/es2015/elements/menu-element.js +2 -1
- package/dist/es2015/elements/quality-menu.js +1 -1
- package/dist/es2015/elements/scan-button.js +1 -1
- package/dist/es2015/elements/seek-bar.js +5 -4
- package/dist/es2015/elements/shared.js +3 -3
- package/dist/es2015/elements/skip-button.js +2 -2
- package/dist/es2015/elements/spinner.js +1 -1
- package/dist/es2015/elements/start-button.js +18 -2
- package/dist/es2015/elements/subtitles-menu.js +35 -17
- package/dist/es2015/elements/title.js +3 -1
- package/dist/es2015/elements/volume-slider.js +1 -1
- package/dist/es2015/elements/volume.js +1 -1
- package/dist/es2015/presets.js +1 -1
- package/dist/es2015/style.js +1 -1
- package/dist/style.js +1 -1
- package/package.json +4 -5
- package/NOTICE +0 -24
|
@@ -1,37 +1,46 @@
|
|
|
1
1
|
//#region src/controls/icons.ts
|
|
2
2
|
/**
|
|
3
3
|
* Each glyph's subpaths joined into one `d`. The path is drawn even-odd:
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* a frame, a ring or a letter cuts its hole with a nested subpath, and no
|
|
5
|
+
* two filled subpaths overlap.
|
|
6
6
|
*/
|
|
7
7
|
const PATHS = {
|
|
8
|
-
play: "
|
|
9
|
-
pause: "M8
|
|
10
|
-
replay: "
|
|
11
|
-
mute: "
|
|
12
|
-
"volume-low": "
|
|
13
|
-
"volume-high": "
|
|
14
|
-
fullscreen: "
|
|
15
|
-
"fullscreen-exit": "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"lock-closed": "
|
|
21
|
-
"seek-backward": "
|
|
22
|
-
"seek-forward": "
|
|
23
|
-
"seek-backward-
|
|
24
|
-
"seek-forward-
|
|
25
|
-
"seek-backward-
|
|
26
|
-
"seek-forward-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
8
|
+
play: "M9 5L26 16L9 27z",
|
|
9
|
+
pause: "M8 6h5.5v20h-5.5zM18.5 6h5.5v20h-5.5z",
|
|
10
|
+
replay: "M16 6.75A10.25 10.25 0 1 1 7.12 11.88L9.29 13.12A7.75 7.75 0 1 0 16 9.25zM16 3.5L16 12.5L10 8z",
|
|
11
|
+
mute: "M4 12L9 12L16 6L16 26L9 20L4 20zM24 17.77L20.99 20.77L19.23 19.01L22.23 16L19.23 12.99L20.99 11.23L24 14.23L27.01 11.23L28.77 12.99L25.77 16L28.77 19.01L27.01 20.77z",
|
|
12
|
+
"volume-low": "M4 12L9 12L16 6L16 26L9 20L4 20zM21.13 10.87A7.25 7.25 0 0 1 21.13 21.13L19.36 19.36A4.75 4.75 0 0 0 19.36 12.64z",
|
|
13
|
+
"volume-high": "M4 12L9 12L16 6L16 26L9 20L4 20zM21.13 10.87A7.25 7.25 0 0 1 21.13 21.13L19.36 19.36A4.75 4.75 0 0 0 19.36 12.64zM24.31 7.69A11.75 11.75 0 0 1 24.31 24.31L22.54 22.54A9.25 9.25 0 0 0 22.54 9.46z",
|
|
14
|
+
fullscreen: "M5 5L14 5L11 8L8 8L8 11L5 14zM18 5L27 5L27 14L24 11L24 8L21 8zM5 18L8 21L8 24L11 24L14 27L5 27zM27 18L27 27L18 27L21 24L24 24L24 21z",
|
|
15
|
+
"fullscreen-exit": "M13 4L13 13L4 13L7 10L10 10L10 7zM19 4L22 7L22 10L25 10L28 13L19 13zM4 19L13 19L13 28L10 25L10 22L7 22zM19 19L28 19L25 22L22 22L22 25L19 28z",
|
|
16
|
+
quality: "M5 22L10 18.1L10 27L5 27zM13.5 15.4L18.5 11.6L18.5 27L13.5 27zM22 8.9L27 5L27 27L22 27z",
|
|
17
|
+
audio: "M4.75 13h2.5v6h-2.5zM9.75 9h2.5v14h-2.5zM14.75 5h2.5v22h-2.5zM19.75 10.5h2.5v11h-2.5zM24.75 13.5h2.5v5h-2.5z",
|
|
18
|
+
subtitles: "M4 6h20l4 4v16H4zM6.5 8.5H22.96L25.5 11.04V23.5H6.5zM9 14h8v2.5h-8zM19 14h4v2.5h-4zM9 18.5h4v2.5h-4zM15 18.5h8v2.5h-8z",
|
|
19
|
+
"subtitles-on": "M4 6h20l4 4v16H4zM9 14h8v2.5h-8zM19 14h4v2.5h-4zM9 18.5h4v2.5h-4zM15 18.5h8v2.5h-8z",
|
|
20
|
+
"lock-closed": "M7 14h18v13H7zM14.75 18.5v4.5h2.5v-4.5zM9.75 14V11A6.25 6.25 0 0 1 22.25 11V14H19.75V11A3.75 3.75 0 0 0 12.25 11V14z",
|
|
21
|
+
"seek-backward": "M16 6.75A10.25 10.25 0 1 1 7.12 11.88L9.29 13.12A7.75 7.75 0 1 0 16 9.25zM16 3.5L16 12.5L10 8z",
|
|
22
|
+
"seek-forward": "M24.88 11.88A10.25 10.25 0 1 1 16 6.75L16 9.25A7.75 7.75 0 1 0 22.71 13.12zM16 3.5L22 8L16 12.5z",
|
|
23
|
+
"seek-backward-5": "M16 6.75A10.25 10.25 0 1 1 7.12 11.88L9.29 13.12A7.75 7.75 0 1 0 16 9.25zM16 3.5L16 12.5L10 8zM13 13.5h6v2h-6zM13 15.5h2v0.5h-2zM13 16h6v2h-6zM17 18h2v0.5h-2zM13 18.5h6v2h-6z",
|
|
24
|
+
"seek-forward-5": "M24.88 11.88A10.25 10.25 0 1 1 16 6.75L16 9.25A7.75 7.75 0 1 0 22.71 13.12zM16 3.5L22 8L16 12.5zM13 13.5h6v2h-6zM13 15.5h2v0.5h-2zM13 16h6v2h-6zM17 18h2v0.5h-2zM13 18.5h6v2h-6z",
|
|
25
|
+
"seek-backward-10": "M16 6.75A10.25 10.25 0 1 1 7.12 11.88L9.29 13.12A7.75 7.75 0 1 0 16 9.25zM16 3.5L16 12.5L10 8zM11.5 13.5h2.2v7h-2.2zM15.5 13.5h5.5v7h-5.5zM17.6 15.6v2.8h1.3v-2.8z",
|
|
26
|
+
"seek-forward-10": "M24.88 11.88A10.25 10.25 0 1 1 16 6.75L16 9.25A7.75 7.75 0 1 0 22.71 13.12zM16 3.5L22 8L16 12.5zM11.5 13.5h2.2v7h-2.2zM15.5 13.5h5.5v7h-5.5zM17.6 15.6v2.8h1.3v-2.8z",
|
|
27
|
+
"seek-backward-15": "M16 6.75A10.25 10.25 0 1 1 7.12 11.88L9.29 13.12A7.75 7.75 0 1 0 16 9.25zM16 3.5L16 12.5L10 8zM10.5 13.5h2.2v7h-2.2zM14.7 13.5h5.8v2h-5.8zM14.7 15.5h2v0.5h-2zM14.7 16h5.8v2h-5.8zM18.5 18h2v0.5h-2zM14.7 18.5h5.8v2h-5.8z",
|
|
28
|
+
"seek-forward-15": "M24.88 11.88A10.25 10.25 0 1 1 16 6.75L16 9.25A7.75 7.75 0 1 0 22.71 13.12zM16 3.5L22 8L16 12.5zM10.5 13.5h2.2v7h-2.2zM14.7 13.5h5.8v2h-5.8zM14.7 15.5h2v0.5h-2zM14.7 16h5.8v2h-5.8zM18.5 18h2v0.5h-2zM14.7 18.5h5.8v2h-5.8z",
|
|
29
|
+
"seek-backward-30": "M16 6.75A10.25 10.25 0 1 1 7.12 11.88L9.29 13.12A7.75 7.75 0 1 0 16 9.25zM16 3.5L16 12.5L10 8zM13 13.5h2v7h-2zM10 13.5h3v2h-3zM11 16h2v2h-2zM10 18.5h3v2h-3zM16.5 13.5h5.5v7h-5.5zM18.6 15.6v2.8h1.3v-2.8z",
|
|
30
|
+
"seek-forward-30": "M24.88 11.88A10.25 10.25 0 1 1 16 6.75L16 9.25A7.75 7.75 0 1 0 22.71 13.12zM16 3.5L22 8L16 12.5zM13 13.5h2v7h-2zM10 13.5h3v2h-3zM11 16h2v2h-2zM10 18.5h3v2h-3zM16.5 13.5h5.5v7h-5.5zM18.6 15.6v2.8h1.3v-2.8z",
|
|
31
|
+
"playback-speed": "M7.69 26.31A11.75 11.75 0 1 1 24.31 26.31L22.54 24.54A9.25 9.25 0 1 0 9.46 24.54zM16.41 20.31L21.14 11.87L13.66 17.99z",
|
|
32
|
+
"picture-in-picture": "M4 6h24v20H4zM6.5 8.5v15h19v-15zM15 15h8v6h-8z",
|
|
33
|
+
"picture-in-picture-exit": "M4 6h24v20H4zM6.5 8.5v15h19v-15zM9.5 11.5L16 11.5L9.5 18zM13.63 13.87L19.29 19.52L17.52 21.29L11.87 15.63z",
|
|
34
|
+
airplay: "M4 6H28V23.25H23V20.75H25.5V8.5H6.5V20.75H9V23.25H4zM16 17.5L23.5 27L8.5 27z",
|
|
35
|
+
"airplay-active": "M4 6H28V23.25H22.1L16 15.5L9.9 23.25H4zM16 17.5L23.5 27L8.5 27z",
|
|
36
|
+
chapters: "M5 6.5h4v4h-4zM12 7.25h15v2.5h-15zM5 14h4v4h-4zM12 14.75h15v2.5h-15zM5 21.5h4v4h-4zM12 22.25h15v2.5h-15z",
|
|
37
|
+
"fast-forward": "M4 7L15 16L4 25zM16 7L27 16L16 25z",
|
|
38
|
+
"fast-backward": "M28 7L17 16L28 25zM16 7L5 16L16 25z",
|
|
39
|
+
"audio-description": "M1.5 23L4.8 9h2.6L10.7 23H8.4l-.75-3.2H4.55L3.8 23zM5.1 17.4h2L6.1 12.9zM12.2 9h2.8a7 7 0 0 1 0 14h-2.8zM14.6 11.4v9.2h.4a4.6 4.6 0 0 0 0-9.2zM24.2 9.96A9.4 9.4 0 0 1 24.2 22.04L22.82 20.89A7.6 7.6 0 0 0 22.82 11.11zM27.11 7.52A13.2 13.2 0 0 1 27.11 24.48L25.73 23.33A11.4 11.4 0 0 0 25.73 8.67z",
|
|
40
|
+
sdh: "M9.7 13.2L10.3 10.4L11.6 8.5L13.6 7.2L16 6.8L18.7 7.3L20.8 8.6L22.2 10.6L22.7 13L22.5 14.9L21.8 16.3L20.8 17.5L19.6 18.7L18.5 19.9L17.9 21.3L17.5 22.5L17.1 23.5L16.7 24.5L16 25.2L15.2 25.6L14.3 25.7L13.3 25.6L12.6 25.1L12 24.4L11.7 23.4L9.3 24.2L9.8 25.7L10.9 27L12.5 27.9L14.3 28.3L16 28L17.6 27.2L18.7 26L19.5 24.5L19.8 23.3L20.2 22.2L20.6 21.3L21.4 20.3L22.6 19.2L23.9 17.7L24.9 15.7L25.3 13L24.6 9.5L22.6 6.7L19.6 4.9L16 4.2L12.7 4.9L9.9 6.6L7.9 9.4L7.3 12.8zM13.7 13.2L13.9 12.1L14.4 11.4L15.1 10.9L16 10.8L16.9 10.9L17.6 11.4L18.1 12.1L18.3 13.2L20.7 12.8L20.4 11.1L19.4 9.6L17.9 8.6L16 8.2L14.1 8.6L12.6 9.6L11.6 11.1L11.3 12.8z",
|
|
41
|
+
"closed-captions": "M14.24 20.24A6 6 0 1 1 14.24 11.76L12.47 13.53A3.5 3.5 0 1 0 12.47 18.47zM26.24 20.24A6 6 0 1 1 26.24 11.76L24.47 13.53A3.5 3.5 0 1 0 24.47 18.47z",
|
|
42
|
+
"text-size": "M2.5 23L5.9 13L8.1 13L11.5 23zM7 16.53L7.64 18.4L6.36 18.4zM5.65 20.5L8.35 20.5L9.2 23L4.8 23zM12.5 23L19.5 6L22.5 6L29.5 23zM21 9.64L23.45 15.6L18.55 15.6zM17.48 18.2L24.52 18.2L26.5 23L15.5 23z",
|
|
43
|
+
"text-background": "M4 6h24v20h-24zM9 22.5L14.6 9.5L17.4 9.5L23 22.5zM16 12.75L17.66 16.6L14.34 16.6zM13.35 18.9L18.65 18.9L20.2 22.5L11.8 22.5z"
|
|
35
44
|
};
|
|
36
45
|
const SVG = "http://www.w3.org/2000/svg";
|
|
37
46
|
/** A glyph, hidden from the accessibility tree: the button it sits in carries the name. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, setChildren, state } from "../dom.js";
|
|
2
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
//#region src/controls/menu.ts
|
|
4
4
|
/**
|
|
5
5
|
* The menu primitive the quality, audio, subtitles and speed menus share: a
|
|
@@ -26,11 +26,11 @@ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.152.0/helpers/es
|
|
|
26
26
|
/** Air between the popup's top and the picture's. */
|
|
27
27
|
const AIR = 8;
|
|
28
28
|
/**
|
|
29
|
-
* The tallest a popup grows, in pixels: about seven and a half rows, so
|
|
29
|
+
* The tallest a popup grows, in pixels: the title and about seven and a half rows, so
|
|
30
30
|
* the half row at the foot says the list goes on. A page sets its own
|
|
31
31
|
* with `--mbx-menu-max-height`.
|
|
32
32
|
*/
|
|
33
|
-
const MAX_HEIGHT =
|
|
33
|
+
const MAX_HEIGHT = 22;
|
|
34
34
|
/** An item's picture. Decorative: the item's text names it. Loaded when the popup first shows it. */
|
|
35
35
|
function picture(url) {
|
|
36
36
|
const node = el("img", "item-image");
|
|
@@ -50,12 +50,31 @@ function menu(options) {
|
|
|
50
50
|
button.setAttribute("aria-haspopup", "menu");
|
|
51
51
|
button.setAttribute("aria-expanded", "false");
|
|
52
52
|
const popup = el("div", "popup");
|
|
53
|
-
popup.addEventListener("scroll", () => {
|
|
54
|
-
more();
|
|
55
|
-
});
|
|
56
53
|
popup.setAttribute("role", "menu");
|
|
57
54
|
popup.hidden = true;
|
|
55
|
+
const backdrop = el("div", "backdrop");
|
|
56
|
+
backdrop.hidden = true;
|
|
57
|
+
backdrop.addEventListener("click", () => {
|
|
58
|
+
close();
|
|
59
|
+
});
|
|
58
60
|
let open = false;
|
|
61
|
+
/**
|
|
62
|
+
* While the menu is open it follows its player: a change of tier draws
|
|
63
|
+
* the page again, as a popup or as a sheet, and a change of size places
|
|
64
|
+
* it again. A page that resizes with a menu open sees it keep up.
|
|
65
|
+
*/
|
|
66
|
+
const tiers = typeof MutationObserver === "undefined" ? null : new MutationObserver(() => {
|
|
67
|
+
var _ref, _checked;
|
|
68
|
+
if (!open) return;
|
|
69
|
+
const held = popup.contains(focused());
|
|
70
|
+
render();
|
|
71
|
+
if (held) (_ref = (_checked = checked()) !== null && _checked !== void 0 ? _checked : items()[0]) === null || _ref === void 0 || _ref.focus();
|
|
72
|
+
});
|
|
73
|
+
const sizes = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => {
|
|
74
|
+
if (open) fit();
|
|
75
|
+
});
|
|
76
|
+
/** Whether the page drawn last was drawn for a compact player. */
|
|
77
|
+
let drawnCompact = false;
|
|
59
78
|
let name = "";
|
|
60
79
|
let first = [];
|
|
61
80
|
/** The pages opened, the first being the menu itself. */
|
|
@@ -80,19 +99,31 @@ function menu(options) {
|
|
|
80
99
|
* left of its right edge.
|
|
81
100
|
*/
|
|
82
101
|
function fit() {
|
|
83
|
-
|
|
102
|
+
var _options$frame$getBou, _options$frame;
|
|
103
|
+
const compact = host.getAttribute("layout") === "compact";
|
|
104
|
+
const picture = compact ? (_options$frame$getBou = (_options$frame = options.frame()) === null || _options$frame === void 0 ? void 0 : _options$frame.getBoundingClientRect()) !== null && _options$frame$getBou !== void 0 ? _options$frame$getBou : null : options.picture();
|
|
105
|
+
backdrop.hidden = !(open && compact && picture !== null);
|
|
106
|
+
for (const node of [popup, backdrop]) node.style.left = node.style.bottom = node.style.width = "";
|
|
107
|
+
backdrop.style.height = "";
|
|
84
108
|
if (picture === null) return;
|
|
109
|
+
if (compact) {
|
|
110
|
+
const box = host.getBoundingClientRect();
|
|
111
|
+
for (const node of [popup, backdrop]) {
|
|
112
|
+
node.style.left = `${picture.left - box.left}px`;
|
|
113
|
+
node.style.bottom = `${box.bottom - picture.bottom}px`;
|
|
114
|
+
node.style.width = `${picture.width}px`;
|
|
115
|
+
}
|
|
116
|
+
backdrop.style.height = `${picture.height}px`;
|
|
117
|
+
popup.style.maxHeight = `${Math.max(0, Math.floor(picture.height - AIR))}px`;
|
|
118
|
+
popup.style.maxWidth = "";
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
85
121
|
const room = button.getBoundingClientRect().top - picture.top - AIR;
|
|
86
|
-
const most = Number.parseFloat(getComputedStyle(host).getPropertyValue("--mbx-menu-max-height")) || MAX_HEIGHT;
|
|
122
|
+
const most = Number.parseFloat(getComputedStyle(host).getPropertyValue("--mbx-menu-max-height")) || MAX_HEIGHT * (Number.parseFloat(getComputedStyle(host).fontSize) || 16);
|
|
87
123
|
popup.style.maxHeight = `${Math.max(0, Math.floor(Math.min(most, room)))}px`;
|
|
88
|
-
more();
|
|
89
124
|
const wide = host.getBoundingClientRect().right - picture.left - AIR;
|
|
90
125
|
popup.style.maxWidth = `${Math.max(0, Math.floor(wide))}px`;
|
|
91
126
|
}
|
|
92
|
-
/** `more` on the popup while rows wait below its foot, which then fades out. */
|
|
93
|
-
function more() {
|
|
94
|
-
popup.toggleAttribute("more", popup.scrollTop + popup.clientHeight < popup.scrollHeight - 1);
|
|
95
|
-
}
|
|
96
127
|
function clear() {
|
|
97
128
|
for (const item of items()) {
|
|
98
129
|
const handler = handlers.get(item);
|
|
@@ -114,6 +145,20 @@ function menu(options) {
|
|
|
114
145
|
const page = stack[stack.length - 1];
|
|
115
146
|
if (page === void 0) return;
|
|
116
147
|
let tab = true;
|
|
148
|
+
drawnCompact = host.getAttribute("layout") === "compact";
|
|
149
|
+
if (stack.length === 1 && name !== "" && drawnCompact) {
|
|
150
|
+
const leave = item("item back-item", name, () => {
|
|
151
|
+
close();
|
|
152
|
+
button.focus();
|
|
153
|
+
});
|
|
154
|
+
leave.setAttribute("role", "menuitem");
|
|
155
|
+
leave.setAttribute("aria-label", options.back(name));
|
|
156
|
+
popup.append(leave);
|
|
157
|
+
} else if (stack.length === 1 && name !== "") {
|
|
158
|
+
const title = el("div", "title", name);
|
|
159
|
+
title.setAttribute("aria-hidden", "true");
|
|
160
|
+
popup.append(title);
|
|
161
|
+
}
|
|
117
162
|
if (stack.length > 1) {
|
|
118
163
|
const back = item("item back-item", page.label, () => {
|
|
119
164
|
var _items$;
|
|
@@ -135,6 +180,11 @@ function menu(options) {
|
|
|
135
180
|
});
|
|
136
181
|
link.setAttribute("role", "menuitem");
|
|
137
182
|
link.setAttribute("aria-haspopup", "menu");
|
|
183
|
+
if (entry.glyph !== void 0) {
|
|
184
|
+
link.prepend(entry.glyph());
|
|
185
|
+
state(link, `item page-item ${entry.name}-item`, { "glyph-item": true });
|
|
186
|
+
}
|
|
187
|
+
if (entry.detail !== void 0) link.append(el("span", "item-detail", entry.detail));
|
|
138
188
|
popup.append(link);
|
|
139
189
|
continue;
|
|
140
190
|
}
|
|
@@ -142,7 +192,7 @@ function menu(options) {
|
|
|
142
192
|
section.setAttribute("role", "group");
|
|
143
193
|
if (entry.label !== void 0) {
|
|
144
194
|
section.setAttribute("aria-label", entry.label);
|
|
145
|
-
section.append(el("div", `section-label ${entry.name}-label`, entry.label));
|
|
195
|
+
if (entry.hideLabel !== true) section.append(el("div", `section-label ${entry.name}-label`, entry.label));
|
|
146
196
|
}
|
|
147
197
|
for (const [id, text, detail, image, badges] of entry.items) {
|
|
148
198
|
const choice = item(`item ${entry.name}-item`, text, () => {
|
|
@@ -150,7 +200,18 @@ function menu(options) {
|
|
|
150
200
|
button.focus();
|
|
151
201
|
entry.onSelect(id);
|
|
152
202
|
});
|
|
153
|
-
for (const badge of badges !== null && badges !== void 0 ? badges : [])
|
|
203
|
+
for (const badge of badges !== null && badges !== void 0 ? badges : []) {
|
|
204
|
+
var _entry$badgeGlyphs;
|
|
205
|
+
const glyph = (_entry$badgeGlyphs = entry.badgeGlyphs) === null || _entry$badgeGlyphs === void 0 ? void 0 : _entry$badgeGlyphs[badge];
|
|
206
|
+
if (glyph === void 0) {
|
|
207
|
+
choice.append(el("span", "item-badge", badge));
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
const drawn = el("span", "item-badge item-glyph");
|
|
211
|
+
drawn.title = badge;
|
|
212
|
+
drawn.append(glyph(), el("span", "badge-text", badge));
|
|
213
|
+
choice.append(drawn);
|
|
214
|
+
}
|
|
154
215
|
if (detail !== void 0) choice.append(el("span", "item-detail", detail));
|
|
155
216
|
if (image !== void 0) {
|
|
156
217
|
const [, ...rest] = choice.childNodes;
|
|
@@ -175,7 +236,10 @@ function menu(options) {
|
|
|
175
236
|
function close() {
|
|
176
237
|
if (!open) return;
|
|
177
238
|
open = false;
|
|
239
|
+
tiers === null || tiers === void 0 || tiers.disconnect();
|
|
240
|
+
sizes === null || sizes === void 0 || sizes.disconnect();
|
|
178
241
|
popup.hidden = true;
|
|
242
|
+
backdrop.hidden = true;
|
|
179
243
|
button.setAttribute("aria-expanded", "false");
|
|
180
244
|
host.removeAttribute("open");
|
|
181
245
|
document.removeEventListener("pointerdown", outside, true);
|
|
@@ -185,15 +249,22 @@ function menu(options) {
|
|
|
185
249
|
}
|
|
186
250
|
}
|
|
187
251
|
function show() {
|
|
188
|
-
var
|
|
252
|
+
var _ref2, _checked2;
|
|
189
253
|
if (open) return;
|
|
190
254
|
open = true;
|
|
255
|
+
if (host.getAttribute("layout") === "compact" !== drawnCompact) render();
|
|
191
256
|
popup.hidden = false;
|
|
192
257
|
button.setAttribute("aria-expanded", "true");
|
|
193
258
|
host.setAttribute("open", "");
|
|
194
259
|
document.addEventListener("pointerdown", outside, true);
|
|
260
|
+
tiers === null || tiers === void 0 || tiers.observe(host, {
|
|
261
|
+
attributes: true,
|
|
262
|
+
attributeFilter: ["layout"]
|
|
263
|
+
});
|
|
264
|
+
const frame = options.frame();
|
|
265
|
+
if (frame !== null) sizes === null || sizes === void 0 || sizes.observe(frame);
|
|
195
266
|
fit();
|
|
196
|
-
(
|
|
267
|
+
(_ref2 = (_checked2 = checked()) !== null && _checked2 !== void 0 ? _checked2 : items()[0]) === null || _ref2 === void 0 || _ref2.focus();
|
|
197
268
|
}
|
|
198
269
|
function toggle() {
|
|
199
270
|
if (open) close();
|
|
@@ -240,6 +311,7 @@ function menu(options) {
|
|
|
240
311
|
return {
|
|
241
312
|
button,
|
|
242
313
|
popup,
|
|
314
|
+
backdrop,
|
|
243
315
|
label(text) {
|
|
244
316
|
name = text;
|
|
245
317
|
button.setAttribute("aria-label", text);
|
package/dist/es2015/element.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createMarkers } from "./controls/markers.js";
|
|
2
2
|
import { namespaces } from "./namespaces.js";
|
|
3
|
-
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/asyncToGenerator.js";
|
|
4
4
|
import { drmGuard, resolvePreset } from "./presets.js";
|
|
5
5
|
import { STYLE } from "./style.js";
|
|
6
6
|
import { errorSurface } from "./surface.js";
|
|
7
7
|
import { PLAYER } from "./tags.js";
|
|
8
|
-
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.
|
|
8
|
+
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/objectSpread2.js";
|
|
9
9
|
import { createPlayer, inferType, matteboxHandler, nativeHandler, preferNativeHls } from "@mattebox/player-core";
|
|
10
10
|
//#region src/element.ts
|
|
11
11
|
/**
|
|
@@ -21,13 +21,15 @@ const FORWARDED = [
|
|
|
21
21
|
"poster",
|
|
22
22
|
"crossorigin"
|
|
23
23
|
];
|
|
24
|
+
const LICENSE_URL = "license-url";
|
|
25
|
+
const CERTIFICATE_URL = "certificate-url";
|
|
24
26
|
/** Everything else the element watches. Changing any of them reloads. */
|
|
25
27
|
const OWN = [
|
|
26
28
|
"src",
|
|
27
29
|
"type",
|
|
28
30
|
"preset",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
LICENSE_URL,
|
|
32
|
+
CERTIFICATE_URL,
|
|
31
33
|
"thumbnails",
|
|
32
34
|
NATIVE_HLS
|
|
33
35
|
];
|
|
@@ -55,6 +57,27 @@ const CONTROLS = "controls";
|
|
|
55
57
|
* control the page placed shows. Changing it never reloads.
|
|
56
58
|
*/
|
|
57
59
|
const PLAYSINLINE = "playsinline";
|
|
60
|
+
/**
|
|
61
|
+
* The size tier the controls draw for: `compact` on a small player, such
|
|
62
|
+
* as a phone held upright, `wide` on a large one, such as a TV or
|
|
63
|
+
* fullscreen, and `regular` between. The element measures itself and sets
|
|
64
|
+
* the attribute, so a stylesheet matches `mattebox-player[layout="compact"]`.
|
|
65
|
+
* A page that writes one of the three values fixes it, and removing the
|
|
66
|
+
* attribute hands it back. The player's own box decides, not the screen:
|
|
67
|
+
* a small embed on a desktop is compact, and a phone in fullscreen is not.
|
|
68
|
+
*/
|
|
69
|
+
const LAYOUT = "layout";
|
|
70
|
+
const LAYOUTS = [
|
|
71
|
+
"compact",
|
|
72
|
+
"regular",
|
|
73
|
+
"wide"
|
|
74
|
+
];
|
|
75
|
+
/** Under either, the player is compact. */
|
|
76
|
+
const COMPACT_WIDTH = 480;
|
|
77
|
+
const COMPACT_HEIGHT = 320;
|
|
78
|
+
/** From both, the player is wide. */
|
|
79
|
+
const WIDE_WIDTH = 1280;
|
|
80
|
+
const WIDE_HEIGHT = 700;
|
|
58
81
|
/** The video's state, as attributes on the element, read on the events the video fires for it. */
|
|
59
82
|
const STATE_EVENTS = [
|
|
60
83
|
"play",
|
|
@@ -93,7 +116,8 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
93
116
|
...OWN,
|
|
94
117
|
CONTROLS,
|
|
95
118
|
CHAPTERS,
|
|
96
|
-
PLAYSINLINE
|
|
119
|
+
PLAYSINLINE,
|
|
120
|
+
LAYOUT
|
|
97
121
|
];
|
|
98
122
|
}
|
|
99
123
|
/**
|
|
@@ -108,14 +132,18 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
108
132
|
}
|
|
109
133
|
constructor(options) {
|
|
110
134
|
super();
|
|
111
|
-
this.
|
|
135
|
+
this.own = options !== null && options !== void 0 ? options : null;
|
|
112
136
|
this.focusable = false;
|
|
113
137
|
this.track = null;
|
|
114
138
|
this.given = null;
|
|
139
|
+
this.list = null;
|
|
140
|
+
this.tried = "";
|
|
115
141
|
this.core = null;
|
|
116
142
|
this.current = null;
|
|
117
143
|
this.failure = null;
|
|
118
144
|
this.reflecting = false;
|
|
145
|
+
this.sizes = null;
|
|
146
|
+
this.fixed = false;
|
|
119
147
|
this.started = false;
|
|
120
148
|
this.waiting = false;
|
|
121
149
|
this.offs = [];
|
|
@@ -134,7 +162,11 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
134
162
|
this.marks = createMarkers(this.media, (name, detail) => this.emit(name, detail));
|
|
135
163
|
this.stage = document.createElement("div");
|
|
136
164
|
this.stage.setAttribute("part", "stage");
|
|
137
|
-
|
|
165
|
+
const slot = document.createElement("slot");
|
|
166
|
+
slot.addEventListener("slotchange", () => {
|
|
167
|
+
if (this.current === null && JSON.stringify(this.wanted()) !== this.tried) this.reload();
|
|
168
|
+
});
|
|
169
|
+
this.stage.append(slot);
|
|
138
170
|
this.surface = errorSurface(() => {
|
|
139
171
|
this.reload();
|
|
140
172
|
});
|
|
@@ -151,6 +183,19 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
151
183
|
get markers() {
|
|
152
184
|
return this.marks;
|
|
153
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* The sources to try in order, set from script. The `src` attribute wins
|
|
188
|
+
* over them, and they win over the `<source>` children. Setting them
|
|
189
|
+
* loads, and null returns to the children.
|
|
190
|
+
*/
|
|
191
|
+
get sources() {
|
|
192
|
+
return this.list;
|
|
193
|
+
}
|
|
194
|
+
set sources(value) {
|
|
195
|
+
this.list = value;
|
|
196
|
+
if (this.marks.list.length > 0) this.marks.set([]);
|
|
197
|
+
this.reload();
|
|
198
|
+
}
|
|
154
199
|
/** The core, or null until the first source has been set up: resolving a preset is asynchronous. */
|
|
155
200
|
get player() {
|
|
156
201
|
return this.core;
|
|
@@ -173,8 +218,28 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
173
218
|
if (this.media.parentNode !== this) this.append(this.media);
|
|
174
219
|
for (const name of FORWARDED) this.forward(name);
|
|
175
220
|
this.reflect();
|
|
221
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
222
|
+
this.sizes = new ResizeObserver(() => {
|
|
223
|
+
this.measure();
|
|
224
|
+
});
|
|
225
|
+
this.sizes.observe(this);
|
|
226
|
+
}
|
|
227
|
+
this.measure();
|
|
176
228
|
this.reload();
|
|
177
229
|
}
|
|
230
|
+
/** Sets `layout` from the element's box, unless the page fixed it. */
|
|
231
|
+
measure() {
|
|
232
|
+
if (this.fixed) return;
|
|
233
|
+
const width = this.clientWidth;
|
|
234
|
+
const height = this.clientHeight;
|
|
235
|
+
if (width === 0 || height === 0) return;
|
|
236
|
+
const layout = width < COMPACT_WIDTH || height < COMPACT_HEIGHT ? "compact" : width >= WIDE_WIDTH && height >= WIDE_HEIGHT ? "wide" : "regular";
|
|
237
|
+
if (this.getAttribute(LAYOUT) === layout) return;
|
|
238
|
+
this.reflecting = true;
|
|
239
|
+
this.setAttribute(LAYOUT, layout);
|
|
240
|
+
this.reflecting = false;
|
|
241
|
+
this.emit("layoutchange", layout);
|
|
242
|
+
}
|
|
178
243
|
/** The two states the video does not hold: whether it has played once, and whether it waits for data. */
|
|
179
244
|
note(event) {
|
|
180
245
|
if (event === "playing") {
|
|
@@ -216,6 +281,9 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
216
281
|
return (type === null || type === void 0 ? void 0 : type.startsWith("audio/")) === true;
|
|
217
282
|
}
|
|
218
283
|
disconnectedCallback() {
|
|
284
|
+
var _this$sizes;
|
|
285
|
+
(_this$sizes = this.sizes) === null || _this$sizes === void 0 || _this$sizes.disconnect();
|
|
286
|
+
this.sizes = null;
|
|
219
287
|
this.enqueue(() => this.teardown());
|
|
220
288
|
}
|
|
221
289
|
attributeChangedCallback(name) {
|
|
@@ -231,6 +299,14 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
231
299
|
this.chapters();
|
|
232
300
|
return;
|
|
233
301
|
}
|
|
302
|
+
if (name === LAYOUT) {
|
|
303
|
+
if (this.reflecting) return;
|
|
304
|
+
const value = this.getAttribute(LAYOUT);
|
|
305
|
+
this.fixed = value !== null && LAYOUTS.includes(value);
|
|
306
|
+
if (this.fixed) this.emit("layoutchange", value);
|
|
307
|
+
else this.measure();
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
234
310
|
if (name === PLAYSINLINE) {
|
|
235
311
|
this.media.toggleAttribute(PLAYSINLINE, this.getAttribute(PLAYSINLINE) !== "false");
|
|
236
312
|
return;
|
|
@@ -331,32 +407,56 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
331
407
|
return _asyncToGenerator(function* () {
|
|
332
408
|
_this.unmount();
|
|
333
409
|
if (!_this.isConnected) return;
|
|
334
|
-
const
|
|
335
|
-
|
|
410
|
+
const sources = _this.wanted();
|
|
411
|
+
_this.tried = JSON.stringify(sources);
|
|
412
|
+
if (sources.length === 0) return;
|
|
336
413
|
const core = yield _this.ensure();
|
|
337
|
-
const type = _this.getAttribute("type");
|
|
338
|
-
const source = type === null ? { url } : {
|
|
339
|
-
url,
|
|
340
|
-
type
|
|
341
|
-
};
|
|
342
414
|
_this.failure = null;
|
|
343
415
|
_this.surface.clear();
|
|
344
|
-
let session;
|
|
345
416
|
try {
|
|
346
|
-
|
|
417
|
+
yield core.load(sources);
|
|
347
418
|
} catch (_unused) {
|
|
348
419
|
return;
|
|
349
420
|
}
|
|
350
|
-
if (!_this.isConnected)
|
|
351
|
-
yield core.unload();
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
_this.current = session;
|
|
355
|
-
_this.given = null;
|
|
356
|
-
_this.configure(session);
|
|
357
|
-
_this.chapters();
|
|
421
|
+
if (!_this.isConnected) yield core.unload();
|
|
358
422
|
})();
|
|
359
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* What to load, ranked as a video ranks them: the `src` attribute, then
|
|
426
|
+
* the `sources` property, then the `<source>` children in their order.
|
|
427
|
+
* A child carries its own `license-url` and `certificate-url`.
|
|
428
|
+
*/
|
|
429
|
+
wanted() {
|
|
430
|
+
const url = this.getAttribute("src");
|
|
431
|
+
if (url !== null) {
|
|
432
|
+
const type = this.getAttribute("type");
|
|
433
|
+
return [type === null ? { url } : {
|
|
434
|
+
url,
|
|
435
|
+
type
|
|
436
|
+
}];
|
|
437
|
+
}
|
|
438
|
+
const eme = drmGuard().without === void 0;
|
|
439
|
+
if (this.list !== null) return eme ? this.list : this.list.map(({ url, type }) => type === void 0 ? { url } : {
|
|
440
|
+
url,
|
|
441
|
+
type
|
|
442
|
+
});
|
|
443
|
+
const found = [];
|
|
444
|
+
for (const child of Array.from(this.children)) {
|
|
445
|
+
const src = child.localName === "source" ? child.getAttribute("src") : null;
|
|
446
|
+
if (src === null) continue;
|
|
447
|
+
const type = child.getAttribute("type");
|
|
448
|
+
const license = child.getAttribute(LICENSE_URL);
|
|
449
|
+
const certificate = child.getAttribute(CERTIFICATE_URL);
|
|
450
|
+
found.push(_objectSpread2(_objectSpread2({ url: src }, type === null ? {} : { type }), !eme || license === null && certificate === null ? {} : { drm: _objectSpread2(_objectSpread2({}, license === null ? {} : { licenseUrl: license }), certificate === null ? {} : { certificateUrl: certificate }) }));
|
|
451
|
+
}
|
|
452
|
+
return found;
|
|
453
|
+
}
|
|
454
|
+
/** Sets a session up. It runs for every session, the one that replaces a failed source included. */
|
|
455
|
+
adopt(session) {
|
|
456
|
+
this.given = null;
|
|
457
|
+
this.configure(session);
|
|
458
|
+
this.chapters();
|
|
459
|
+
}
|
|
360
460
|
ensure() {
|
|
361
461
|
var _this2 = this;
|
|
362
462
|
return _asyncToGenerator(function* () {
|
|
@@ -364,6 +464,7 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
364
464
|
const core = createPlayer(_this2.media, { handlers: yield _this2.chain() });
|
|
365
465
|
_this2.offs.push(core.on("sourcechange", (session) => {
|
|
366
466
|
_this2.current = session;
|
|
467
|
+
if (session !== null && _this2.isConnected) _this2.adopt(session);
|
|
367
468
|
_this2.emit("sourcechange", session);
|
|
368
469
|
}), core.on("error", (error) => {
|
|
369
470
|
_this2.report(error);
|
|
@@ -372,6 +473,15 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
372
473
|
return core;
|
|
373
474
|
})();
|
|
374
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* Read at each use, not once in the constructor. Importing the package
|
|
478
|
+
* registers the element, and the parser's elements are constructed then,
|
|
479
|
+
* before the page's own `define()` call can run.
|
|
480
|
+
*/
|
|
481
|
+
get options() {
|
|
482
|
+
var _this$own;
|
|
483
|
+
return (_this$own = this.own) !== null && _this$own !== void 0 ? _this$own : defaults;
|
|
484
|
+
}
|
|
375
485
|
chain() {
|
|
376
486
|
var _this3 = this;
|
|
377
487
|
return _asyncToGenerator(function* () {
|
|
@@ -410,8 +520,8 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
410
520
|
drm(stages) {
|
|
411
521
|
if (drmGuard().without !== void 0) return void 0;
|
|
412
522
|
const keySystems = stages().filter((stage) => KEY_SYSTEMS.includes(stage.name));
|
|
413
|
-
const license = this.getAttribute(
|
|
414
|
-
const certificate = this.getAttribute(
|
|
523
|
+
const license = this.getAttribute(LICENSE_URL);
|
|
524
|
+
const certificate = this.getAttribute(CERTIFICATE_URL);
|
|
415
525
|
const page = this.options.drm;
|
|
416
526
|
if (keySystems.length === 0 && license === null && page === void 0) return void 0;
|
|
417
527
|
return _objectSpread2(_objectSpread2(_objectSpread2({ keySystems }, page), license === null ? {} : { licenseUrl: license }), certificate === null ? {} : { certificateUrl: certificate });
|
|
@@ -422,10 +532,14 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
422
532
|
const engine = session.engine;
|
|
423
533
|
if (engine === null) return;
|
|
424
534
|
const optional = namespaces(engine);
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
535
|
+
const own = session.source.drm;
|
|
536
|
+
const license = this.getAttribute(LICENSE_URL);
|
|
537
|
+
if (license !== null && (own === null || own === void 0 ? void 0 : own.licenseUrl) === void 0) (_optional$drm = optional.drm) === null || _optional$drm === void 0 || _optional$drm.setLicenseUrl(license);
|
|
538
|
+
const certificate = this.getAttribute(CERTIFICATE_URL);
|
|
539
|
+
if (certificate !== null && (own === null || own === void 0 ? void 0 : own.certificateUrl) === void 0) {
|
|
540
|
+
var _optional$drm2;
|
|
541
|
+
(_optional$drm2 = optional.drm) === null || _optional$drm2 === void 0 || _optional$drm2.setCertificateUrl(certificate);
|
|
542
|
+
}
|
|
429
543
|
const track = this.getAttribute("thumbnails");
|
|
430
544
|
if (track !== null && optional.thumbnails !== void 0) optional.thumbnails.load(track).catch(() => void 0);
|
|
431
545
|
}
|