@mattebox/player 0.4.0 → 0.6.0

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.
Files changed (71) hide show
  1. package/README.md +9 -6
  2. package/dist/cdn/mattebox-player.min.js +105 -34
  3. package/dist/element.d.ts +17 -21
  4. package/dist/element.d.ts.map +1 -1
  5. package/dist/element.js +59 -41
  6. package/dist/element.js.map +1 -1
  7. package/dist/elements/spinner.d.ts +25 -0
  8. package/dist/elements/spinner.d.ts.map +1 -0
  9. package/dist/elements/spinner.js +80 -0
  10. package/dist/elements/spinner.js.map +1 -0
  11. package/dist/elements/start-button.d.ts.map +1 -1
  12. package/dist/elements/start-button.js +3 -2
  13. package/dist/elements/start-button.js.map +1 -1
  14. package/dist/elements/title.d.ts +19 -0
  15. package/dist/elements/title.d.ts.map +1 -0
  16. package/dist/elements/title.js +139 -0
  17. package/dist/elements/title.js.map +1 -0
  18. package/dist/entries/spinner.d.ts +5 -0
  19. package/dist/entries/spinner.d.ts.map +1 -0
  20. package/dist/entries/spinner.js +9 -0
  21. package/dist/entries/spinner.js.map +1 -0
  22. package/dist/entries/title.d.ts +5 -0
  23. package/dist/entries/title.d.ts.map +1 -0
  24. package/dist/entries/title.js +9 -0
  25. package/dist/entries/title.js.map +1 -0
  26. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/asyncToGenerator.js +1 -1
  27. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/defineProperty.js +1 -1
  28. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/objectSpread2.js +1 -1
  29. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPrimitive.js +1 -1
  30. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPropertyKey.js +1 -1
  31. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/typeof.js +1 -1
  32. package/dist/es2015/controls/menu.js +1 -1
  33. package/dist/es2015/element.js +47 -33
  34. package/dist/es2015/elements/spinner.js +84 -0
  35. package/dist/es2015/elements/start-button.js +6 -3
  36. package/dist/es2015/elements/title.js +151 -0
  37. package/dist/es2015/entries/spinner.js +7 -0
  38. package/dist/es2015/entries/title.js +7 -0
  39. package/dist/es2015/index.js +5 -3
  40. package/dist/es2015/presets.js +1 -1
  41. package/dist/es2015/style.js +13 -5
  42. package/dist/es2015/tags.js +3 -2
  43. package/dist/index.d.ts +6 -3
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +2 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/namespaces.d.ts +1 -1
  48. package/dist/style.d.ts +1 -1
  49. package/dist/style.d.ts.map +1 -1
  50. package/dist/style.js +13 -5
  51. package/dist/style.js.map +1 -1
  52. package/dist/tags.d.ts +2 -1
  53. package/dist/tags.d.ts.map +1 -1
  54. package/dist/tags.js +2 -1
  55. package/dist/tags.js.map +1 -1
  56. package/package.json +3 -3
  57. package/dist/compose.d.ts +0 -5
  58. package/dist/compose.d.ts.map +0 -1
  59. package/dist/compose.js +0 -31
  60. package/dist/compose.js.map +0 -1
  61. package/dist/elements/panels.d.ts +0 -15
  62. package/dist/elements/panels.d.ts.map +0 -1
  63. package/dist/elements/panels.js +0 -55
  64. package/dist/elements/panels.js.map +0 -1
  65. package/dist/entries/panels.d.ts +0 -5
  66. package/dist/entries/panels.d.ts.map +0 -1
  67. package/dist/entries/panels.js +0 -8
  68. package/dist/entries/panels.js.map +0 -1
  69. package/dist/es2015/compose.js +0 -33
  70. package/dist/es2015/elements/panels.js +0 -52
  71. package/dist/es2015/entries/panels.js +0 -7
@@ -0,0 +1,151 @@
1
+ import { el } from "../dom.js";
2
+ import { Component } from "./component.js";
3
+ import { style } from "./shared.js";
4
+ //#region src/elements/title.ts
5
+ /**
6
+ * <mbx-title>: the heading, the subheading and the artwork of what plays,
7
+ * as a lower third across the picture above the bar: a scrim that fades
8
+ * upward, the artwork in the first column, the two lines in the second,
9
+ * so a heading alone sits on a band and never floats. The content comes
10
+ * from attributes, `heading`,
11
+ * `subheading` and `artwork`, because the stream carries none of it: a page
12
+ * writes what it knows, and a Cast receiver writes what the sender said.
13
+ * With none of the three the element draws nothing.
14
+ *
15
+ * Shown while the video is paused, which includes before the first play,
16
+ * and hidden while it plays. The element carries `playing` for that rule,
17
+ * so a page changes it in CSS: `mattebox-player[started] mbx-title
18
+ * { display: none }` keeps it to the time before the first play, like the
19
+ * poster, and `mattebox-player:hover mbx-title { display: flex }` brings it
20
+ * back on hover. The height of the bar's rows, its box less the fade it
21
+ * pads itself with, goes on the host as `--mbx-bar-rows`, so the text sits
22
+ * just above the seek row while the band runs under the bar to the bottom
23
+ * edge, one ramp with the bar's own fade. The scrim is the page's to
24
+ * override. Placed first among the screens, so the start button, the
25
+ * error screen and the spinner paint over its band.
26
+ */
27
+ const STYLE = `
28
+ :host {
29
+ position: absolute;
30
+ left: 0;
31
+ right: 0;
32
+ bottom: 0;
33
+ display: flex;
34
+ align-items: flex-end;
35
+ gap: 14px;
36
+ /* The band runs under the bar to the bottom edge, one ramp with the
37
+ bar's own fade, so there is no seam where the bar begins; the text
38
+ sits 12px above the bar's rows, inside the bar's fade. */
39
+ padding: 72px calc(var(--mbx-pad) + 8px) calc(var(--mbx-bar-rows, 0px) + 12px);
40
+ background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0));
41
+ color: var(--mbx-text);
42
+ font: 400 14px/1.35 var(--mbx-font);
43
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
44
+ pointer-events: none;
45
+ }
46
+ :host([playing]) { display: none; }
47
+ :host([empty]) { display: none; }
48
+ :host([hidden]) { display: none; }
49
+ [part~="artwork"] {
50
+ flex: none;
51
+ height: 72px;
52
+ width: auto;
53
+ max-width: 128px;
54
+ border-radius: var(--mbx-radius);
55
+ object-fit: cover;
56
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
57
+ }
58
+ [part~="artwork"][hidden] { display: none; }
59
+ [part~="text"] { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 60ch; }
60
+ [part~="heading"] {
61
+ font-size: 20px;
62
+ font-weight: 600;
63
+ letter-spacing: -0.01em;
64
+ line-height: 1.2;
65
+ white-space: nowrap;
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ }
69
+ [part~="subheading"] { color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
70
+ [part~="heading"]:empty, [part~="subheading"]:empty { display: none; }
71
+ `;
72
+ var MbxTitle = class extends Component {
73
+ static get observedAttributes() {
74
+ return [
75
+ "heading",
76
+ "subheading",
77
+ "artwork"
78
+ ];
79
+ }
80
+ constructor() {
81
+ super();
82
+ this.resizer = null;
83
+ const root = this.attachShadow({ mode: "open" });
84
+ this.artwork = el("img", "artwork");
85
+ this.artwork.alt = "";
86
+ this.artwork.hidden = true;
87
+ const text = el("div", "text");
88
+ this.heading = el("div", "heading");
89
+ this.subheading = el("div", "subheading");
90
+ text.append(this.heading, this.subheading);
91
+ root.append(style(STYLE), this.artwork, text);
92
+ }
93
+ attach(player) {
94
+ this.listen(player.video, [
95
+ "play",
96
+ "pause",
97
+ "ended",
98
+ "emptied"
99
+ ], () => {
100
+ this.state(player);
101
+ });
102
+ if (typeof ResizeObserver !== "undefined") {
103
+ this.resizer = new ResizeObserver(() => {
104
+ this.fit(player);
105
+ });
106
+ this.resizer.observe(player);
107
+ }
108
+ this.fit(player);
109
+ this.state(player);
110
+ this.render();
111
+ }
112
+ detach() {
113
+ var _this$resizer;
114
+ (_this$resizer = this.resizer) === null || _this$resizer === void 0 || _this$resizer.disconnect();
115
+ this.resizer = null;
116
+ this.removeAttribute("playing");
117
+ this.style.removeProperty("--mbx-bar-rows");
118
+ }
119
+ /** `playing` on the element, for its own stylesheet and the page's. */
120
+ state(player) {
121
+ this.toggleAttribute("playing", !player.video.paused);
122
+ }
123
+ /** The height of the bar's rows: its box less the padding above them, which is its fade. Zero without a bar. */
124
+ fit(player) {
125
+ const bar = player.querySelector("mbx-control-bar");
126
+ let rows = 0;
127
+ if (bar !== null) {
128
+ const top = Number.parseFloat(getComputedStyle(bar).paddingTop) || 0;
129
+ rows = Math.max(0, bar.getBoundingClientRect().height - top);
130
+ }
131
+ this.style.setProperty("--mbx-bar-rows", `${rows}px`);
132
+ }
133
+ render() {
134
+ var _this$getAttribute, _this$getAttribute2;
135
+ const heading = (_this$getAttribute = this.getAttribute("heading")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "";
136
+ const subheading = (_this$getAttribute2 = this.getAttribute("subheading")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : "";
137
+ const artwork = this.getAttribute("artwork");
138
+ this.heading.textContent = heading;
139
+ this.subheading.textContent = subheading;
140
+ if (artwork === null) {
141
+ this.artwork.removeAttribute("src");
142
+ this.artwork.hidden = true;
143
+ } else {
144
+ this.artwork.src = artwork;
145
+ this.artwork.hidden = false;
146
+ }
147
+ this.toggleAttribute("empty", heading === "" && subheading === "" && artwork === null);
148
+ }
149
+ };
150
+ //#endregion
151
+ export { MbxTitle };
@@ -0,0 +1,7 @@
1
+ import { SPINNER } from "../tags.js";
2
+ import "../element-entry.js";
3
+ import { MbxSpinner } from "../elements/spinner.js";
4
+ //#region src/entries/spinner.ts
5
+ if (customElements.get("mbx-spinner") === void 0) customElements.define(SPINNER, MbxSpinner);
6
+ //#endregion
7
+ export { MbxSpinner };
@@ -0,0 +1,7 @@
1
+ import { TITLE } from "../tags.js";
2
+ import "../element-entry.js";
3
+ import { MbxTitle } from "../elements/title.js";
4
+ //#region src/entries/title.ts
5
+ if (customElements.get("mbx-title") === void 0) customElements.define(TITLE, MbxTitle);
6
+ //#endregion
7
+ export { MbxTitle };
@@ -22,8 +22,6 @@ import { MbxLiveButton } from "./elements/live-button.js";
22
22
  import "./entries/live-button.js";
23
23
  import { MbxMuteButton } from "./elements/mute-button.js";
24
24
  import "./entries/mute-button.js";
25
- import { MbxPanels } from "./elements/panels.js";
26
- import "./entries/panels.js";
27
25
  import { MbxPipButton } from "./elements/pip-button.js";
28
26
  import "./entries/pip-button.js";
29
27
  import { MbxPlayButton } from "./elements/play-button.js";
@@ -40,12 +38,16 @@ import { MbxSpacer } from "./elements/spacer.js";
40
38
  import "./entries/spacer.js";
41
39
  import { MbxSpeedMenu } from "./elements/speed-menu.js";
42
40
  import "./entries/speed-menu.js";
41
+ import { MbxSpinner } from "./elements/spinner.js";
42
+ import "./entries/spinner.js";
43
43
  import { MbxStartButton } from "./elements/start-button.js";
44
44
  import "./entries/start-button.js";
45
45
  import { MbxSubtitlesMenu } from "./elements/subtitles-menu.js";
46
46
  import "./entries/subtitles-menu.js";
47
+ import { MbxTitle } from "./elements/title.js";
48
+ import "./entries/title.js";
47
49
  import { MbxVolumeSlider } from "./elements/volume-slider.js";
48
50
  import "./entries/volume-slider.js";
49
51
  import { MbxVolume } from "./elements/volume.js";
50
52
  import "./entries/volume.js";
51
- export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMuteButton, MbxPanels, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxSeekBar, MbxSkipButton, MbxSpacer, MbxSpeedMenu, MbxStartButton, MbxSubtitlesMenu, MbxVolume, MbxVolumeSlider };
53
+ export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMuteButton, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxSeekBar, MbxSkipButton, MbxSpacer, MbxSpeedMenu, MbxSpinner, MbxStartButton, MbxSubtitlesMenu, MbxTitle, MbxVolume, MbxVolumeSlider };
@@ -1,4 +1,4 @@
1
- import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/asyncToGenerator.js";
1
+ import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/asyncToGenerator.js";
2
2
  //#region src/presets.ts
3
3
  /** eme-core's teardown calls `element.setMediaKeys(null)` unguarded, so a build without EME throws out of `detach`. */
4
4
  const DRM_STAGES = [
@@ -36,8 +36,7 @@ const STYLE = `
36
36
  --mbx-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
37
37
  }
38
38
  /* The stage is a column as tall as the host, so the picture is centred
39
- in whatever height the page gives, and the panels row under native
40
- controls keeps its place below the picture. The height comes from the
39
+ in whatever height the page gives. The height comes from the
41
40
  page, or from the browser in fullscreen, and not from a display on the
42
41
  host: a page's own "mattebox-player { display: block }" beats a :host()
43
42
  rule, so nothing here may depend on one. */
@@ -60,12 +59,21 @@ const STYLE = `
60
59
  object-fit: contain;
61
60
  aspect-ratio: auto 16 / 9;
62
61
  }
62
+ /* The casting attribute is set by @mattebox/player-cast while a receiver
63
+ plays: its screen has the controls, and the bar and the start button
64
+ would drive a paused video nobody watches. The attribute is the whole
65
+ coupling. */
66
+ :host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }
67
+ /* controls="none" hides every child but the video, so a page keeps its
68
+ composition in place and turns it off with one attribute. A normal rule
69
+ from the page still wins over this one, the way it does over any rule
70
+ here. */
71
+ :host([controls="none"]) ::slotted(:not(video)) { display: none; }
63
72
  :host(:focus-visible) [part~="stage"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
64
73
  /* Fullscreen goes on the host, so every control the page placed inside
65
74
  comes along. The browser gives the host the whole screen with
66
- !important; the picture takes what the panels row leaves. The error
67
- surface, which sits under the stage in the page, goes over its foot
68
- instead. */
75
+ !important; the picture takes all of it. The error surface, which sits
76
+ under the stage in the page, goes over its foot instead. */
69
77
  :host(:fullscreen) ::slotted(video) { flex: 1; }
70
78
  :host(:fullscreen) [part~="error"] { position: absolute; left: 0; right: 0; bottom: 0; }
71
79
  :host(:-webkit-full-screen) ::slotted(video) { flex: 1; }
@@ -12,6 +12,8 @@ const AIRPLAY_BUTTON = "mbx-airplay-button";
12
12
  const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
13
13
  const START_BUTTON = "mbx-start-button";
14
14
  const ERROR_SCREEN = "mbx-error-screen";
15
+ const SPINNER = "mbx-spinner";
16
+ const TITLE = "mbx-title";
15
17
  const CURRENT_TIME = "mbx-current-time";
16
18
  const DURATION = "mbx-duration";
17
19
  const REMAINING_TIME = "mbx-remaining-time";
@@ -22,8 +24,7 @@ const QUALITY_MENU = "mbx-quality-menu";
22
24
  const AUDIO_MENU = "mbx-audio-menu";
23
25
  const SUBTITLES_MENU = "mbx-subtitles-menu";
24
26
  const DRM_BADGE = "mbx-drm-badge";
25
- const PANELS = "mbx-panels";
26
27
  const VOLUME = "mbx-volume";
27
28
  const CHAPTERS_MENU = "mbx-chapters-menu";
28
29
  //#endregion
29
- export { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, MUTE_BUTTON, PANELS, PIP_BUTTON, PLAYER, PLAY_BUTTON, QUALITY_MENU, REMAINING_TIME, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, START_BUTTON, SUBTITLES_MENU, VOLUME, VOLUME_SLIDER };
30
+ export { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, MUTE_BUTTON, PIP_BUTTON, PLAYER, PLAY_BUTTON, QUALITY_MENU, REMAINING_TIME, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, SPINNER, START_BUTTON, SUBTITLES_MENU, TITLE, VOLUME, VOLUME_SLIDER };
package/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ import type { MbxErrorScreen } from './entries/error-screen.js';
16
16
  import type { MbxFullscreenButton } from './entries/fullscreen-button.js';
17
17
  import type { MbxLiveButton } from './entries/live-button.js';
18
18
  import type { MbxMuteButton } from './entries/mute-button.js';
19
- import type { MbxPanels } from './entries/panels.js';
20
19
  import type { MbxPipButton } from './entries/pip-button.js';
21
20
  import type { MbxPlayButton } from './entries/play-button.js';
22
21
  import type { MbxQualityMenu } from './entries/quality-menu.js';
@@ -25,8 +24,10 @@ import type { MbxSeekBar } from './entries/seek-bar.js';
25
24
  import type { MbxSkipButton } from './entries/skip-button.js';
26
25
  import type { MbxSpacer } from './entries/spacer.js';
27
26
  import type { MbxSpeedMenu } from './entries/speed-menu.js';
27
+ import type { MbxSpinner } from './entries/spinner.js';
28
28
  import type { MbxStartButton } from './entries/start-button.js';
29
29
  import type { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
30
+ import type { MbxTitle } from './entries/title.js';
30
31
  import type { MbxVolume } from './entries/volume.js';
31
32
  import type { MbxVolumeSlider } from './entries/volume-slider.js';
32
33
  export type { MatteboxPlayerOptions } from './element-entry.js';
@@ -42,7 +43,6 @@ export { MbxErrorScreen } from './entries/error-screen.js';
42
43
  export { MbxFullscreenButton } from './entries/fullscreen-button.js';
43
44
  export { MbxLiveButton } from './entries/live-button.js';
44
45
  export { MbxMuteButton } from './entries/mute-button.js';
45
- export { MbxPanels } from './entries/panels.js';
46
46
  export { MbxPipButton } from './entries/pip-button.js';
47
47
  export { MbxPlayButton } from './entries/play-button.js';
48
48
  export { MbxQualityMenu } from './entries/quality-menu.js';
@@ -51,8 +51,10 @@ export { MbxSeekBar } from './entries/seek-bar.js';
51
51
  export { MbxSkipButton } from './entries/skip-button.js';
52
52
  export { MbxSpacer } from './entries/spacer.js';
53
53
  export { MbxSpeedMenu } from './entries/speed-menu.js';
54
+ export { MbxSpinner } from './entries/spinner.js';
54
55
  export { MbxStartButton } from './entries/start-button.js';
55
56
  export { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
57
+ export { MbxTitle } from './entries/title.js';
56
58
  export { MbxVolume } from './entries/volume.js';
57
59
  export { MbxVolumeSlider } from './entries/volume-slider.js';
58
60
  export type { PlayerHost } from './host.js';
@@ -70,6 +72,8 @@ declare global {
70
72
  'mbx-fullscreen-button': MbxFullscreenButton;
71
73
  'mbx-start-button': MbxStartButton;
72
74
  'mbx-error-screen': MbxErrorScreen;
75
+ 'mbx-spinner': MbxSpinner;
76
+ 'mbx-title': MbxTitle;
73
77
  'mbx-current-time': MbxCurrentTime;
74
78
  'mbx-duration': MbxDuration;
75
79
  'mbx-remaining-time': MbxRemainingTime;
@@ -82,7 +86,6 @@ declare global {
82
86
  'mbx-subtitles-menu': MbxSubtitlesMenu;
83
87
  'mbx-drm-badge': MbxDrmBadge;
84
88
  'mbx-chapters-menu': MbxChaptersMenu;
85
- 'mbx-panels': MbxPanels;
86
89
  }
87
90
  }
88
91
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EA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en.js';
10
10
  export { MbxFullscreenButton } from './entries/fullscreen-button.js';
11
11
  export { MbxLiveButton } from './entries/live-button.js';
12
12
  export { MbxMuteButton } from './entries/mute-button.js';
13
- export { MbxPanels } from './entries/panels.js';
14
13
  export { MbxPipButton } from './entries/pip-button.js';
15
14
  export { MbxPlayButton } from './entries/play-button.js';
16
15
  export { MbxQualityMenu } from './entries/quality-menu.js';
@@ -19,8 +18,10 @@ export { MbxSeekBar } from './entries/seek-bar.js';
19
18
  export { MbxSkipButton } from './entries/skip-button.js';
20
19
  export { MbxSpacer } from './entries/spacer.js';
21
20
  export { MbxSpeedMenu } from './entries/speed-menu.js';
21
+ export { MbxSpinner } from './entries/spinner.js';
22
22
  export { MbxStartButton } from './entries/start-button.js';
23
23
  export { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
24
+ export { MbxTitle } from './entries/title.js';
24
25
  export { MbxVolume } from './entries/volume.js';
25
26
  export { MbxVolumeSlider } from './entries/volume-slider.js';
26
27
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,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W,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * only through a `declare module` merge in the stage that contributes it,
7
7
  * and of the three a player shows, one merge is unreachable and one does not
8
8
  * exist. So the casts live here, once, and the
9
- * panels read a plain optional shape.
9
+ * controls read a plain optional shape.
10
10
  */
11
11
  import type { Mattebox } from 'mattebox';
12
12
  import type { DrmApi } from 'mattebox/stages/eme-core';
package/dist/style.d.ts CHANGED
@@ -17,5 +17,5 @@
17
17
  * Selectors stay at one attribute, and every element is reached through its
18
18
  * `part`, so the names in the stylesheet are the names the page uses.
19
19
  */
20
- export declare const STYLE = "\n:host {\n display: block;\n position: relative;\n outline: none;\n background: #000;\n --mbx-surface: #101114;\n --mbx-text: #f2f3f5;\n --mbx-muted: #9aa0a6;\n --mbx-accent: #5b8cff;\n --mbx-error: #ffb4ab;\n --mbx-live: #ff4d4d;\n --mbx-radius: 4px;\n --mbx-gap: 10px;\n --mbx-pad: 8px;\n --mbx-font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n}\n/* The stage is a column as tall as the host, so the picture is centred\n in whatever height the page gives, and the panels row under native\n controls keeps its place below the picture. The height comes from the\n page, or from the browser in fullscreen, and not from a display on the\n host: a page's own \"mattebox-player { display: block }\" beats a :host()\n rule, so nothing here may depend on one. */\n[part~=\"stage\"] {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n}\n/* 16:9 until the media says otherwise: a bare video measures 300 by 150 and\n would jump to its size on metadata. Auto first, so the natural ratio wins\n once it is known. Capped at the stage, and contained, so a box shorter\n than the picture letterboxes it and a narrower one pillarboxes it. */\n::slotted(video) {\n display: block;\n width: 100%;\n min-height: 0;\n max-height: 100%;\n object-fit: contain;\n aspect-ratio: auto 16 / 9;\n}\n:host(:focus-visible) [part~=\"stage\"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n/* Fullscreen goes on the host, so every control the page placed inside\n comes along. The browser gives the host the whole screen with\n !important; the picture takes what the panels row leaves. The error\n surface, which sits under the stage in the page, goes over its foot\n instead. */\n:host(:fullscreen) ::slotted(video) { flex: 1; }\n:host(:fullscreen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n:host(:-webkit-full-screen) ::slotted(video) { flex: 1; }\n:host(:-webkit-full-screen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n[part~=\"error\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--mbx-gap);\n padding: var(--mbx-pad);\n background: var(--mbx-surface);\n color: var(--mbx-error);\n font: 400 13px/1.4 var(--mbx-font);\n}\n[part~=\"value\"] { color: var(--mbx-accent); }\n[part~=\"button\"] {\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid currentColor;\n border-radius: var(--mbx-radius);\n padding: 2px 6px;\n}\n[hidden] { display: none; }\n";
20
+ export declare const STYLE = "\n:host {\n display: block;\n position: relative;\n outline: none;\n background: #000;\n --mbx-surface: #101114;\n --mbx-text: #f2f3f5;\n --mbx-muted: #9aa0a6;\n --mbx-accent: #5b8cff;\n --mbx-error: #ffb4ab;\n --mbx-live: #ff4d4d;\n --mbx-radius: 4px;\n --mbx-gap: 10px;\n --mbx-pad: 8px;\n --mbx-font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n}\n/* The stage is a column as tall as the host, so the picture is centred\n in whatever height the page gives. The height comes from the\n page, or from the browser in fullscreen, and not from a display on the\n host: a page's own \"mattebox-player { display: block }\" beats a :host()\n rule, so nothing here may depend on one. */\n[part~=\"stage\"] {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n}\n/* 16:9 until the media says otherwise: a bare video measures 300 by 150 and\n would jump to its size on metadata. Auto first, so the natural ratio wins\n once it is known. Capped at the stage, and contained, so a box shorter\n than the picture letterboxes it and a narrower one pillarboxes it. */\n::slotted(video) {\n display: block;\n width: 100%;\n min-height: 0;\n max-height: 100%;\n object-fit: contain;\n aspect-ratio: auto 16 / 9;\n}\n/* The casting attribute is set by @mattebox/player-cast while a receiver\n plays: its screen has the controls, and the bar and the start button\n would drive a paused video nobody watches. The attribute is the whole\n coupling. */\n:host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }\n/* controls=\"none\" hides every child but the video, so a page keeps its\n composition in place and turns it off with one attribute. A normal rule\n from the page still wins over this one, the way it does over any rule\n here. */\n:host([controls=\"none\"]) ::slotted(:not(video)) { display: none; }\n:host(:focus-visible) [part~=\"stage\"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n/* Fullscreen goes on the host, so every control the page placed inside\n comes along. The browser gives the host the whole screen with\n !important; the picture takes all of it. The error surface, which sits\n under the stage in the page, goes over its foot instead. */\n:host(:fullscreen) ::slotted(video) { flex: 1; }\n:host(:fullscreen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n:host(:-webkit-full-screen) ::slotted(video) { flex: 1; }\n:host(:-webkit-full-screen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n[part~=\"error\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--mbx-gap);\n padding: var(--mbx-pad);\n background: var(--mbx-surface);\n color: var(--mbx-error);\n font: 400 13px/1.4 var(--mbx-font);\n}\n[part~=\"value\"] { color: var(--mbx-accent); }\n[part~=\"button\"] {\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid currentColor;\n border-radius: var(--mbx-radius);\n padding: 2px 6px;\n}\n[hidden] { display: none; }\n";
21
21
  //# sourceMappingURL=style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,8iFAwEjB,CAAC"}
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,0lGAgFjB,CAAC"}
package/dist/style.js CHANGED
@@ -35,8 +35,7 @@ export const STYLE = `
35
35
  --mbx-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
36
36
  }
37
37
  /* The stage is a column as tall as the host, so the picture is centred
38
- in whatever height the page gives, and the panels row under native
39
- controls keeps its place below the picture. The height comes from the
38
+ in whatever height the page gives. The height comes from the
40
39
  page, or from the browser in fullscreen, and not from a display on the
41
40
  host: a page's own "mattebox-player { display: block }" beats a :host()
42
41
  rule, so nothing here may depend on one. */
@@ -59,12 +58,21 @@ export const STYLE = `
59
58
  object-fit: contain;
60
59
  aspect-ratio: auto 16 / 9;
61
60
  }
61
+ /* The casting attribute is set by @mattebox/player-cast while a receiver
62
+ plays: its screen has the controls, and the bar and the start button
63
+ would drive a paused video nobody watches. The attribute is the whole
64
+ coupling. */
65
+ :host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }
66
+ /* controls="none" hides every child but the video, so a page keeps its
67
+ composition in place and turns it off with one attribute. A normal rule
68
+ from the page still wins over this one, the way it does over any rule
69
+ here. */
70
+ :host([controls="none"]) ::slotted(:not(video)) { display: none; }
62
71
  :host(:focus-visible) [part~="stage"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
63
72
  /* Fullscreen goes on the host, so every control the page placed inside
64
73
  comes along. The browser gives the host the whole screen with
65
- !important; the picture takes what the panels row leaves. The error
66
- surface, which sits under the stage in the page, goes over its foot
67
- instead. */
74
+ !important; the picture takes all of it. The error surface, which sits
75
+ under the stage in the page, goes over its foot instead. */
68
76
  :host(:fullscreen) ::slotted(video) { flex: 1; }
69
77
  :host(:fullscreen) [part~="error"] { position: absolute; left: 0; right: 0; bottom: 0; }
70
78
  :host(:-webkit-full-screen) ::slotted(video) { flex: 1; }
package/dist/style.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEpB,CAAC"}
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFpB,CAAC"}
package/dist/tags.d.ts CHANGED
@@ -11,6 +11,8 @@ export declare const AIRPLAY_BUTTON = "mbx-airplay-button";
11
11
  export declare const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
12
12
  export declare const START_BUTTON = "mbx-start-button";
13
13
  export declare const ERROR_SCREEN = "mbx-error-screen";
14
+ export declare const SPINNER = "mbx-spinner";
15
+ export declare const TITLE = "mbx-title";
14
16
  export declare const CURRENT_TIME = "mbx-current-time";
15
17
  export declare const DURATION = "mbx-duration";
16
18
  export declare const REMAINING_TIME = "mbx-remaining-time";
@@ -21,7 +23,6 @@ export declare const QUALITY_MENU = "mbx-quality-menu";
21
23
  export declare const AUDIO_MENU = "mbx-audio-menu";
22
24
  export declare const SUBTITLES_MENU = "mbx-subtitles-menu";
23
25
  export declare const DRM_BADGE = "mbx-drm-badge";
24
- export declare const PANELS = "mbx-panels";
25
26
  export declare const VOLUME = "mbx-volume";
26
27
  export declare const CHAPTERS_MENU = "mbx-chapters-menu";
27
28
  //# sourceMappingURL=tags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,MAAM,eAAe,CAAC;AACnC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,iBAAiB,0BAA0B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MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,SAAS,kBAAkB,CAAC;AACzC,eAAO,MAAM,MAAM,eAAe,CAAC;AACnC,eAAO,MAAM,aAAa,sBAAsB,CAAC"}
package/dist/tags.js CHANGED
@@ -11,6 +11,8 @@ export const AIRPLAY_BUTTON = 'mbx-airplay-button';
11
11
  export const FULLSCREEN_BUTTON = 'mbx-fullscreen-button';
12
12
  export const START_BUTTON = 'mbx-start-button';
13
13
  export const ERROR_SCREEN = 'mbx-error-screen';
14
+ export const SPINNER = 'mbx-spinner';
15
+ export const TITLE = 'mbx-title';
14
16
  export const CURRENT_TIME = 'mbx-current-time';
15
17
  export const DURATION = 'mbx-duration';
16
18
  export const REMAINING_TIME = 'mbx-remaining-time';
@@ -21,7 +23,6 @@ export const QUALITY_MENU = 'mbx-quality-menu';
21
23
  export const AUDIO_MENU = 'mbx-audio-menu';
22
24
  export const SUBTITLES_MENU = 'mbx-subtitles-menu';
23
25
  export const DRM_BADGE = 'mbx-drm-badge';
24
- export const PANELS = 'mbx-panels';
25
26
  export const VOLUME = 'mbx-volume';
26
27
  export const CHAPTERS_MENU = 'mbx-chapters-menu';
27
28
  //# sourceMappingURL=tags.js.map
package/dist/tags.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tags.js","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC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AAC;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AACnC,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mattebox/player",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "A <mattebox-player> custom element over @mattebox/player-core.",
5
5
  "author": "Josep Boix Requesens",
6
6
  "repository": {
@@ -70,9 +70,9 @@
70
70
  "release:ci": "semantic-release"
71
71
  },
72
72
  "dependencies": {
73
- "@mattebox/player-core": "^0.2.0"
73
+ "@mattebox/player-core": "^0.3.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "mattebox": "^0.5.0"
76
+ "mattebox": "^0.6.0"
77
77
  }
78
78
  }
package/dist/compose.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /** The screens and the bar. */
2
- export declare function composeBar(): HTMLElement[];
3
- /** The row under the video. */
4
- export declare function composePanels(): HTMLElement[];
5
- //# sourceMappingURL=compose.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AA2CA,+BAA+B;AAC/B,wBAAgB,UAAU,IAAI,WAAW,EAAE,CAW1C;AAED,+BAA+B;AAC/B,wBAAgB,aAAa,IAAI,WAAW,EAAE,CAM7C"}
package/dist/compose.js DELETED
@@ -1,31 +0,0 @@
1
- /**
2
- * The default compositions: what a player gets when the page wrote none of
3
- * its own. Under `controls="custom"` the screens and the bar, appended
4
- * when there is no `<mbx-control-bar>` child; under `native` and `none`
5
- * the panels row under the video, appended when there is no
6
- * `<mbx-panels>` child. Built by tag, so this module needs no element
7
- * class, and appended to the player's light DOM, where the page can see
8
- * it and style it the way it would its own.
9
- */
10
- import { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, PANELS, PIP_BUTTON, PLAY_BUTTON, QUALITY_MENU, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, START_BUTTON, SUBTITLES_MENU, VOLUME, } from './tags.js';
11
- function skip(seconds) {
12
- const node = document.createElement(SKIP_BUTTON);
13
- node.setAttribute('seconds', String(seconds));
14
- return node;
15
- }
16
- function each(...tags) {
17
- return tags.map((tag) => document.createElement(tag));
18
- }
19
- /** The screens and the bar. */
20
- export function composeBar() {
21
- const bar = document.createElement(CONTROL_BAR);
22
- bar.append(...each(CURRENT_TIME, SEEK_BAR, DURATION, LIVE_BUTTON), skip(-10), document.createElement(PLAY_BUTTON), skip(10), ...each(VOLUME, SPACER, SPEED_MENU, CHAPTERS_MENU, SUBTITLES_MENU, AUDIO_MENU), ...each(QUALITY_MENU, AIRPLAY_BUTTON, PIP_BUTTON, FULLSCREEN_BUTTON));
23
- return [...each(START_BUTTON, ERROR_SCREEN), bar];
24
- }
25
- /** The row under the video. */
26
- export function composePanels() {
27
- const row = document.createElement(PANELS);
28
- row.append(...each(QUALITY_MENU, AUDIO_MENU, SUBTITLES_MENU, CHAPTERS_MENU, LIVE_BUTTON, DRM_BADGE));
29
- return [row];
30
- }
31
- //# sourceMappingURL=compose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,UAAU,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,MAAM,EACN,UAAU,EACV,YAAY,EACZ,cAAc,EACd,MAAM,GACP,MAAM,WAAW,CAAC;AAEnB,SAAS,IAAI,CAAC,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 -1,15 +0,0 @@
1
- /**
2
- * <mbx-panels>: the row under the video for what native controls cannot
3
- * show. It sits in the player beside the video, in flow, so it lands
4
- * under the picture, and lays its children out in a row: the quality,
5
- * audio and subtitles menus, the live button, the lock. Each child hides
6
- * itself when its session has nothing for it, and the row hides when
7
- * every child has, so a native session shows no strip at all.
8
- */
9
- import { Component } from './component.js';
10
- export declare class MbxPanels extends Component {
11
- constructor();
12
- private empty;
13
- protected attach(): void;
14
- }
15
- //# sourceMappingURL=panels.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/elements/panels.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAiB3C,qBAAa,SAAU,SAAQ,SAAS;;IAOtC,OAAO,CAAC,KAAK;cAIM,MAAM,IAAI,IAAI;CAoBlC"}
@@ -1,55 +0,0 @@
1
- /**
2
- * <mbx-panels>: the row under the video for what native controls cannot
3
- * show. It sits in the player beside the video, in flow, so it lands
4
- * under the picture, and lays its children out in a row: the quality,
5
- * audio and subtitles menus, the live button, the lock. Each child hides
6
- * itself when its session has nothing for it, and the row hides when
7
- * every child has, so a native session shows no strip at all.
8
- */
9
- import { Component } from './component.js';
10
- import { style } from './shared.js';
11
- const STYLE = `
12
- :host {
13
- display: flex;
14
- flex-wrap: wrap;
15
- align-items: center;
16
- gap: var(--mbx-gap);
17
- padding: var(--mbx-pad);
18
- background: var(--mbx-surface);
19
- color: var(--mbx-text);
20
- font: 400 13px/1.4 var(--mbx-font);
21
- }
22
- :host([hidden]) { display: none; }
23
- `;
24
- export class MbxPanels extends Component {
25
- constructor() {
26
- super();
27
- const root = this.attachShadow({ mode: 'open' });
28
- root.append(style(STYLE), document.createElement('slot'));
29
- }
30
- empty() {
31
- return ![...this.children].some((child) => !child.hidden);
32
- }
33
- attach() {
34
- const tick = () => {
35
- const empty = this.empty();
36
- // Only on a change: the observer sees the row's own attribute too, and
37
- // a write it did not need would wake it again without end.
38
- if (this.hidden !== empty)
39
- this.hidden = empty;
40
- };
41
- // The children say `hidden` on themselves; the row follows the last of them.
42
- const observer = new MutationObserver(tick);
43
- observer.observe(this, {
44
- childList: true,
45
- subtree: true,
46
- attributes: true,
47
- attributeFilter: ['hidden'],
48
- });
49
- this.keep(() => {
50
- observer.disconnect();
51
- });
52
- tick();
53
- }
54
- }
55
- //# sourceMappingURL=panels.js.map