@mattebox/player 0.8.0 → 0.9.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 (86) hide show
  1. package/dist/cdn/mattebox-player.min.js +3 -3
  2. package/dist/controls/icons.d.ts +5 -30
  3. package/dist/controls/icons.d.ts.map +1 -1
  4. package/dist/controls/icons.js +38 -29
  5. package/dist/controls/icons.js.map +1 -1
  6. package/dist/controls/menu.d.ts +11 -0
  7. package/dist/controls/menu.d.ts.map +1 -1
  8. package/dist/controls/menu.js +31 -5
  9. package/dist/controls/menu.js.map +1 -1
  10. package/dist/element.d.ts +36 -2
  11. package/dist/element.d.ts.map +1 -1
  12. package/dist/element.js +140 -24
  13. package/dist/element.js.map +1 -1
  14. package/dist/elements/audio-menu.d.ts.map +1 -1
  15. package/dist/elements/audio-menu.js +3 -1
  16. package/dist/elements/audio-menu.js.map +1 -1
  17. package/dist/elements/component.d.ts.map +1 -1
  18. package/dist/elements/component.js +10 -0
  19. package/dist/elements/component.js.map +1 -1
  20. package/dist/elements/control-bar.d.ts +2 -0
  21. package/dist/elements/control-bar.d.ts.map +1 -1
  22. package/dist/elements/control-bar.js +23 -7
  23. package/dist/elements/control-bar.js.map +1 -1
  24. package/dist/elements/current-time.d.ts.map +1 -1
  25. package/dist/elements/current-time.js +1 -1
  26. package/dist/elements/current-time.js.map +1 -1
  27. package/dist/elements/drm-badge.js +1 -1
  28. package/dist/elements/duration.d.ts.map +1 -1
  29. package/dist/elements/duration.js +6 -2
  30. package/dist/elements/duration.js.map +1 -1
  31. package/dist/elements/error-screen.js +1 -1
  32. package/dist/elements/live-button.js +1 -1
  33. package/dist/elements/marker-button.d.ts +3 -3
  34. package/dist/elements/marker-button.d.ts.map +1 -1
  35. package/dist/elements/marker-button.js +18 -22
  36. package/dist/elements/marker-button.js.map +1 -1
  37. package/dist/elements/quality-menu.js +1 -1
  38. package/dist/elements/quality-menu.js.map +1 -1
  39. package/dist/elements/scan-button.js +1 -1
  40. package/dist/elements/seek-bar.d.ts.map +1 -1
  41. package/dist/elements/seek-bar.js +5 -4
  42. package/dist/elements/seek-bar.js.map +1 -1
  43. package/dist/elements/shared.js +3 -3
  44. package/dist/elements/skip-button.js +2 -2
  45. package/dist/elements/skip-button.js.map +1 -1
  46. package/dist/elements/spinner.js +1 -1
  47. package/dist/elements/start-button.d.ts +5 -0
  48. package/dist/elements/start-button.d.ts.map +1 -1
  49. package/dist/elements/start-button.js +15 -2
  50. package/dist/elements/start-button.js.map +1 -1
  51. package/dist/elements/subtitles-menu.d.ts +5 -1
  52. package/dist/elements/subtitles-menu.d.ts.map +1 -1
  53. package/dist/elements/subtitles-menu.js +29 -11
  54. package/dist/elements/subtitles-menu.js.map +1 -1
  55. package/dist/elements/title.d.ts.map +1 -1
  56. package/dist/elements/title.js +3 -1
  57. package/dist/elements/title.js.map +1 -1
  58. package/dist/elements/volume-slider.js +1 -1
  59. package/dist/elements/volume.js +1 -1
  60. package/dist/es2015/controls/icons.js +38 -29
  61. package/dist/es2015/controls/menu.js +32 -5
  62. package/dist/es2015/element.js +142 -28
  63. package/dist/es2015/elements/audio-menu.js +4 -1
  64. package/dist/es2015/elements/component.js +10 -0
  65. package/dist/es2015/elements/control-bar.js +23 -7
  66. package/dist/es2015/elements/current-time.js +1 -1
  67. package/dist/es2015/elements/drm-badge.js +1 -1
  68. package/dist/es2015/elements/duration.js +6 -2
  69. package/dist/es2015/elements/error-screen.js +1 -1
  70. package/dist/es2015/elements/live-button.js +1 -1
  71. package/dist/es2015/elements/marker-button.js +19 -23
  72. package/dist/es2015/elements/quality-menu.js +1 -1
  73. package/dist/es2015/elements/scan-button.js +1 -1
  74. package/dist/es2015/elements/seek-bar.js +5 -4
  75. package/dist/es2015/elements/shared.js +3 -3
  76. package/dist/es2015/elements/skip-button.js +2 -2
  77. package/dist/es2015/elements/spinner.js +1 -1
  78. package/dist/es2015/elements/start-button.js +15 -2
  79. package/dist/es2015/elements/subtitles-menu.js +35 -17
  80. package/dist/es2015/elements/title.js +3 -1
  81. package/dist/es2015/elements/volume-slider.js +1 -1
  82. package/dist/es2015/elements/volume.js +1 -1
  83. package/dist/es2015/style.js +1 -1
  84. package/dist/style.js +1 -1
  85. package/package.json +4 -5
  86. package/NOTICE +0 -24
@@ -1 +1 @@
1
- {"version":3,"file":"title.js","names":[],"sources":["../../src/elements/title.ts"],"sourcesContent":["/**\n * <mbx-title>: the heading, the subheading and the artwork of what plays,\n * as a lower third across the picture above the bar: a scrim that fades\n * upward, the artwork in the first column, the two lines in the second,\n * so a heading alone sits on a band and never floats. The content comes\n * from attributes, `heading`,\n * `subheading` and `artwork`, because the stream carries none of it: a page\n * writes what it knows, and a Cast receiver writes what the sender said.\n * With none of the three the element draws nothing.\n *\n * Shown while the video is paused, which includes before the first play,\n * and hidden while it plays. The element carries `playing` for that rule,\n * so a page changes it in CSS: `mattebox-player[started] mbx-title\n * { display: none }` keeps it to the time before the first play, like the\n * poster, and `mattebox-player:hover mbx-title { display: flex }` brings it\n * back on hover. The height of the bar's rows, its box less the fade it\n * pads itself with, goes on the host as `--mbx-bar-rows`, so the text sits\n * just above the seek row while the band runs under the bar to the bottom\n * edge, one ramp with the bar's own fade. The scrim is the page's to\n * override. Placed first among the screens, so the start button, the\n * error screen and the spinner paint over its band.\n */\nimport { el } from '../dom.js';\nimport type { PlayerHost } from '../host.js';\nimport { Component } from './component.js';\nimport { style } from './shared.js';\nimport STYLE from './title.css?inline';\n\nexport class MbxTitle extends Component {\n static get observedAttributes(): readonly string[] {\n return ['heading', 'subheading', 'artwork'];\n }\n\n declare private readonly artwork: HTMLImageElement;\n declare private readonly heading: HTMLElement;\n declare private readonly subheading: HTMLElement;\n /** Watches the player's box: the height of the bar's rows decides where the text sits. */\n declare private resizer: ResizeObserver | null;\n\n constructor() {\n super();\n this.resizer = null;\n const root = this.attachShadow({ mode: 'open' });\n this.artwork = el('img', 'artwork');\n this.artwork.alt = '';\n this.artwork.hidden = true;\n const text = el('div', 'text');\n this.heading = el('div', 'heading');\n this.subheading = el('div', 'subheading');\n text.append(this.heading, this.subheading);\n root.append(style(STYLE), this.artwork, text);\n }\n\n protected override attach(player: PlayerHost): void {\n this.listen(player.video, ['play', 'pause', 'ended', 'emptied'], () => {\n this.state(player);\n });\n if (typeof ResizeObserver !== 'undefined') {\n this.resizer = new ResizeObserver(() => {\n this.fit(player);\n });\n this.resizer.observe(player);\n }\n this.fit(player);\n this.state(player);\n this.render();\n }\n\n protected override detach(): void {\n this.resizer?.disconnect();\n this.resizer = null;\n this.removeAttribute('playing');\n this.style.removeProperty('--mbx-bar-rows');\n }\n\n /** `playing` on the element, for its own stylesheet and the page's. */\n private state(player: PlayerHost): void {\n this.toggleAttribute('playing', !player.video.paused);\n }\n\n /** The height of the bar's rows: its box less the padding above them, which is its fade. Zero without a bar. */\n private fit(player: PlayerHost): void {\n const bar = player.querySelector('mbx-control-bar');\n let rows = 0;\n if (bar !== null) {\n const top = Number.parseFloat(getComputedStyle(bar).paddingTop) || 0;\n rows = Math.max(0, bar.getBoundingClientRect().height - top);\n }\n this.style.setProperty('--mbx-bar-rows', `${rows}px`);\n }\n\n protected override render(): void {\n const heading = this.getAttribute('heading') ?? '';\n const subheading = this.getAttribute('subheading') ?? '';\n const artwork = this.getAttribute('artwork');\n this.heading.textContent = heading;\n this.subheading.textContent = subheading;\n if (artwork === null) {\n this.artwork.removeAttribute('src');\n this.artwork.hidden = true;\n } else {\n this.artwork.src = artwork;\n this.artwork.hidden = false;\n }\n this.toggleAttribute('empty', heading === '' && subheading === '' && artwork === null);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAA,QAAA;AAEA,IAAA,WAAA,cAAA,UAAA;CACA,WAAA,qBAAA;EACA,OAAA;GAAA;GAAA;GAAA;EAAA;CACA;CAQA,cAAA;EACA,MAAA;EACA,KAAA,UAAA;EACA,MAAA,OAAA,KAAA,aAAA,EAAA,MAAA,OAAA,CAAA;EACA,KAAA,UAAA,GAAA,OAAA,SAAA;EACA,KAAA,QAAA,MAAA;EACA,KAAA,QAAA,SAAA;EACA,MAAA,OAAA,GAAA,OAAA,MAAA;EACA,KAAA,UAAA,GAAA,OAAA,SAAA;EACA,KAAA,aAAA,GAAA,OAAA,YAAA;EACA,KAAA,OAAA,KAAA,SAAA,KAAA,UAAA;EACA,KAAA,OAAA,MAAA,KAAA,GAAA,KAAA,SAAA,IAAA;CACA;CAEA,OAAA,QAAA;EACA,KAAA,OAAA,OAAA,OAAA;GAAA;GAAA;GAAA;GAAA;EAAA,SAAA;GACA,KAAA,MAAA,MAAA;EACA,CAAA;EACA,IAAA,OAAA,mBAAA,aAAA;GACA,KAAA,UAAA,IAAA,qBAAA;IACA,KAAA,IAAA,MAAA;GACA,CAAA;GACA,KAAA,QAAA,QAAA,MAAA;EACA;EACA,KAAA,IAAA,MAAA;EACA,KAAA,MAAA,MAAA;EACA,KAAA,OAAA;CACA;CAEA,SAAA;EACA,KAAA,SAAA,WAAA;EACA,KAAA,UAAA;EACA,KAAA,gBAAA,SAAA;EACA,KAAA,MAAA,eAAA,gBAAA;CACA;;CAGA,MAAA,QAAA;EACA,KAAA,gBAAA,WAAA,CAAA,OAAA,MAAA,MAAA;CACA;;CAGA,IAAA,QAAA;EACA,MAAA,MAAA,OAAA,cAAA,iBAAA;EACA,IAAA,OAAA;EACA,IAAA,QAAA,MAAA;GACA,MAAA,MAAA,OAAA,WAAA,iBAAA,GAAA,CAAA,CAAA,UAAA,KAAA;GACA,OAAA,KAAA,IAAA,GAAA,IAAA,sBAAA,CAAA,CAAA,SAAA,GAAA;EACA;EACA,KAAA,MAAA,YAAA,kBAAA,GAAA,KAAA,GAAA;CACA;CAEA,SAAA;EACA,MAAA,UAAA,KAAA,aAAA,SAAA,KAAA;EACA,MAAA,aAAA,KAAA,aAAA,YAAA,KAAA;EACA,MAAA,UAAA,KAAA,aAAA,SAAA;EACA,KAAA,QAAA,cAAA;EACA,KAAA,WAAA,cAAA;EACA,IAAA,YAAA,MAAA;GACA,KAAA,QAAA,gBAAA,KAAA;GACA,KAAA,QAAA,SAAA;EACA,OAAA;GACA,KAAA,QAAA,MAAA;GACA,KAAA,QAAA,SAAA;EACA;EACA,KAAA,gBAAA,SAAA,YAAA,MAAA,eAAA,MAAA,YAAA,IAAA;CACA;AACA"}
1
+ {"version":3,"file":"title.js","names":[],"sources":["../../src/elements/title.ts"],"sourcesContent":["/**\n * <mbx-title>: the heading, the subheading and the artwork of what plays,\n * as a lower third across the picture above the bar: a scrim that fades\n * upward, the artwork in the first column, the two lines in the second,\n * so a heading alone sits on a band and never floats. The content comes\n * from attributes, `heading`,\n * `subheading` and `artwork`, because the stream carries none of it: a page\n * writes what it knows, and a Cast receiver writes what the sender said.\n * With none of the three the element draws nothing.\n *\n * Shown while the video is paused, which includes before the first play,\n * and hidden while it plays. The element carries `playing` for that rule,\n * so a page changes it in CSS: `mattebox-player[started] mbx-title\n * { display: none }` keeps it to the time before the first play, like the\n * poster, and `mattebox-player:hover mbx-title { display: flex }` brings it\n * back on hover. The height of the bar's rows, its box less the fade it\n * pads itself with, goes on the host as `--mbx-bar-rows`, so the text sits\n * just above the seek row while the band runs under the bar to the bottom\n * edge, one ramp with the bar's own fade. The scrim is the page's to\n * override. Placed first among the screens, so the start button, the\n * error screen and the spinner paint over its band.\n */\nimport { el } from '../dom.js';\nimport type { PlayerHost } from '../host.js';\nimport { Component } from './component.js';\nimport { style } from './shared.js';\nimport STYLE from './title.css?inline';\n\nexport class MbxTitle extends Component {\n static get observedAttributes(): readonly string[] {\n return ['heading', 'subheading', 'artwork'];\n }\n\n declare private readonly artwork: HTMLImageElement;\n declare private readonly heading: HTMLElement;\n declare private readonly subheading: HTMLElement;\n /** Watches the player's box: the height of the bar's rows decides where the text sits. */\n declare private resizer: ResizeObserver | null;\n\n constructor() {\n super();\n this.resizer = null;\n const root = this.attachShadow({ mode: 'open' });\n this.artwork = el('img', 'artwork');\n this.artwork.alt = '';\n this.artwork.hidden = true;\n const text = el('div', 'text');\n this.heading = el('div', 'heading');\n this.subheading = el('div', 'subheading');\n text.append(this.heading, this.subheading);\n root.append(style(STYLE), this.artwork, text);\n }\n\n protected override attach(player: PlayerHost): void {\n this.listen(player.video, ['play', 'pause', 'ended', 'emptied'], () => {\n this.state(player);\n });\n if (typeof ResizeObserver !== 'undefined') {\n this.resizer = new ResizeObserver(() => {\n this.fit(player);\n });\n this.resizer.observe(player);\n // The bar's rows change height with the player's size tier, without\n // the player's box changing.\n const bar = player.querySelector('mbx-control-bar');\n if (bar !== null) this.resizer.observe(bar);\n }\n this.fit(player);\n this.state(player);\n this.render();\n }\n\n protected override detach(): void {\n this.resizer?.disconnect();\n this.resizer = null;\n this.removeAttribute('playing');\n this.style.removeProperty('--mbx-bar-rows');\n }\n\n /** `playing` on the element, for its own stylesheet and the page's. */\n private state(player: PlayerHost): void {\n this.toggleAttribute('playing', !player.video.paused);\n }\n\n /** The height of the bar's rows: its box less the padding above them, which is its fade. Zero without a bar. */\n private fit(player: PlayerHost): void {\n const bar = player.querySelector('mbx-control-bar');\n let rows = 0;\n if (bar !== null) {\n const top = Number.parseFloat(getComputedStyle(bar).paddingTop) || 0;\n rows = Math.max(0, bar.getBoundingClientRect().height - top);\n }\n this.style.setProperty('--mbx-bar-rows', `${rows}px`);\n }\n\n protected override render(): void {\n const heading = this.getAttribute('heading') ?? '';\n const subheading = this.getAttribute('subheading') ?? '';\n const artwork = this.getAttribute('artwork');\n this.heading.textContent = heading;\n this.subheading.textContent = subheading;\n if (artwork === null) {\n this.artwork.removeAttribute('src');\n this.artwork.hidden = true;\n } else {\n this.artwork.src = artwork;\n this.artwork.hidden = false;\n }\n this.toggleAttribute('empty', heading === '' && subheading === '' && artwork === null);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAA,QAAA;AAEA,IAAA,WAAA,cAAA,UAAA;CACA,WAAA,qBAAA;EACA,OAAA;GAAA;GAAA;GAAA;EAAA;CACA;CAQA,cAAA;EACA,MAAA;EACA,KAAA,UAAA;EACA,MAAA,OAAA,KAAA,aAAA,EAAA,MAAA,OAAA,CAAA;EACA,KAAA,UAAA,GAAA,OAAA,SAAA;EACA,KAAA,QAAA,MAAA;EACA,KAAA,QAAA,SAAA;EACA,MAAA,OAAA,GAAA,OAAA,MAAA;EACA,KAAA,UAAA,GAAA,OAAA,SAAA;EACA,KAAA,aAAA,GAAA,OAAA,YAAA;EACA,KAAA,OAAA,KAAA,SAAA,KAAA,UAAA;EACA,KAAA,OAAA,MAAA,KAAA,GAAA,KAAA,SAAA,IAAA;CACA;CAEA,OAAA,QAAA;EACA,KAAA,OAAA,OAAA,OAAA;GAAA;GAAA;GAAA;GAAA;EAAA,SAAA;GACA,KAAA,MAAA,MAAA;EACA,CAAA;EACA,IAAA,OAAA,mBAAA,aAAA;GACA,KAAA,UAAA,IAAA,qBAAA;IACA,KAAA,IAAA,MAAA;GACA,CAAA;GACA,KAAA,QAAA,QAAA,MAAA;GAGA,MAAA,MAAA,OAAA,cAAA,iBAAA;GACA,IAAA,QAAA,MAAA,KAAA,QAAA,QAAA,GAAA;EACA;EACA,KAAA,IAAA,MAAA;EACA,KAAA,MAAA,MAAA;EACA,KAAA,OAAA;CACA;CAEA,SAAA;EACA,KAAA,SAAA,WAAA;EACA,KAAA,UAAA;EACA,KAAA,gBAAA,SAAA;EACA,KAAA,MAAA,eAAA,gBAAA;CACA;;CAGA,MAAA,QAAA;EACA,KAAA,gBAAA,WAAA,CAAA,OAAA,MAAA,MAAA;CACA;;CAGA,IAAA,QAAA;EACA,MAAA,MAAA,OAAA,cAAA,iBAAA;EACA,IAAA,OAAA;EACA,IAAA,QAAA,MAAA;GACA,MAAA,MAAA,OAAA,WAAA,iBAAA,GAAA,CAAA,CAAA,UAAA,KAAA;GACA,OAAA,KAAA,IAAA,GAAA,IAAA,sBAAA,CAAA,CAAA,SAAA,GAAA;EACA;EACA,KAAA,MAAA,YAAA,kBAAA,GAAA,KAAA,GAAA;CACA;CAEA,SAAA;EACA,MAAA,UAAA,KAAA,aAAA,SAAA,KAAA;EACA,MAAA,aAAA,KAAA,aAAA,YAAA,KAAA;EACA,MAAA,UAAA,KAAA,aAAA,SAAA;EACA,KAAA,QAAA,cAAA;EACA,KAAA,WAAA,cAAA;EACA,IAAA,YAAA,MAAA;GACA,KAAA,QAAA,gBAAA,KAAA;GACA,KAAA,QAAA,SAAA;EACA,OAAA;GACA,KAAA,QAAA,MAAA;GACA,KAAA,QAAA,SAAA;EACA;EACA,KAAA,gBAAA,SAAA,YAAA,MAAA,eAAA,MAAA,YAAA,IAAA;CACA;AACA"}
@@ -2,7 +2,7 @@ import { Component } from "./component.js";
2
2
  import { SLIDER_STYLE, number, style } from "./shared.js";
3
3
  import { slider } from "../controls/slider.js";
4
4
  //#region src/elements/volume-slider.ts
5
- const VOLUME_SLIDER_CSS = ":host{flex:none;width:80px}";
5
+ const VOLUME_SLIDER_CSS = ":host{flex:none;width:5em}";
6
6
  const STEP = .05;
7
7
  const PAGE = .2;
8
8
  var MbxVolumeSlider = class extends Component {
@@ -15,7 +15,7 @@ import { style } from "./shared.js";
15
15
  * stuck. So the group carries `pointer` from a pointer press until a key
16
16
  * is pressed or focus leaves, and focus unfolds the slider only without it.
17
17
  */
18
- const STYLE = ":host{align-items:center;display:inline-flex}:host([hidden]){display:none}::slotted(mbx-volume-slider){opacity:0;width:0;transition:width .2s,opacity .2s;overflow:hidden}::slotted(mbx-volume-slider[collapsed]){display:none}:host(:hover) ::slotted(mbx-volume-slider),:host(:focus-within:not([pointer])) ::slotted(mbx-volume-slider){opacity:1;width:80px}@media (prefers-reduced-motion:reduce){::slotted(mbx-volume-slider){transition:none}}";
18
+ const STYLE = ":host{align-items:center;display:inline-flex}:host([hidden]){display:none}::slotted(mbx-volume-slider){opacity:0;width:0;transition:width .2s,opacity .2s;overflow:hidden}::slotted(mbx-volume-slider[collapsed]){display:none}:host(:hover) ::slotted(mbx-volume-slider),:host(:focus-within:not([pointer])) ::slotted(mbx-volume-slider){opacity:1;width:5em}@media (prefers-reduced-motion:reduce){::slotted(mbx-volume-slider){transition:none}}";
19
19
  var MbxVolume = class extends Component {
20
20
  constructor() {
21
21
  super();
@@ -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
- * the gear, the note, the captions and the lock cut holes with a nested
5
- * subpath, and the rest have disjoint subpaths, where the rule is moot.
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: "M10.667 6.655a.667.667 0 0 1 1.063-.536l12.647 9.344c.36.267.36.806 0 1.073L11.73 25.88a.667.667 0 0 1-1.063-.536z",
9
- pause: "M8.667 6.667A.667.667 0 0 0 8 7.333v17.334c0 .368.298.666.667.666h4a.667.667 0 0 0 .666-.666V7.333a.667.667 0 0 0-.666-.666zm10.666 0a.667.667 0 0 0-.666.666v17.334c0 .368.298.666.666.666h4a.667.667 0 0 0 .667-.666V7.333a.667.667 0 0 0-.667-.666z",
10
- replay: "M15.604 12.215a.667.667 0 0 0 1.063-.536v-1.5c0-.079.068-.14.146-.131a6.669 6.669 0 1 1-7.448 7.284c-.036-.367-.331-.666-.7-.666H6.667c-.369 0-.67.3-.645.667.343 5.212 4.68 9.334 9.978 9.334 5.523 0 10-4.478 10-10 0-5.257-4.056-9.566-9.208-9.97a.135.135 0 0 1-.125-.133V4.988a.667.667 0 0 0-1.063-.536l-4.527 3.345a.667.667 0 0 0 0 1.073z",
11
- mute: "M17.51 24.66a.667.667 0 0 1-1.064.536l-6.998-5.17a.13.13 0 0 0-.079-.027H4.667A.667.667 0 0 1 4 19.333v-6.667c0-.368.298-.667.667-.667H9.37q.044 0 .08-.026l6.995-5.17a.667.667 0 0 1 1.063.537zm11.352-11.018a.667.667 0 0 0 0-.943l-.943-.942a.667.667 0 0 0-.942 0l-2.264 2.263a.134.134 0 0 1-.188 0l-2.263-2.263a.667.667 0 0 0-.943 0l-.943.943a.667.667 0 0 0 0 .942l2.263 2.263a.133.133 0 0 1 0 .189l-2.262 2.262a.667.667 0 0 0 0 .943l.943.943c.26.26.682.26.942 0l2.263-2.262a.133.133 0 0 1 .188 0l2.263 2.262c.26.26.683.26.943 0l.943-.943a.667.667 0 0 0 0-.943l-2.263-2.262a.133.133 0 0 1 0-.189z",
12
- "volume-low": "M17.51 24.66a.667.667 0 0 1-1.064.536l-6.998-5.17a.13.13 0 0 0-.079-.027H4.667A.667.667 0 0 1 4 19.332v-6.666c0-.368.298-.667.667-.667H9.37q.044 0 .08-.026l6.995-5.17a.667.667 0 0 1 1.063.537zm5.332-11.993a.667.667 0 0 0-.666-.667h-1.334a.667.667 0 0 0-.666.667v6.666c0 .369.298.667.666.667h1.334a.667.667 0 0 0 .666-.667z",
13
- "volume-high": "M17.51 24.66a.667.667 0 0 1-1.064.536l-6.998-5.17a.13.13 0 0 0-.079-.027H4.667A.667.667 0 0 1 4 19.333v-6.667c0-.368.298-.667.667-.667H9.37q.044 0 .08-.026l6.995-5.17a.667.667 0 0 1 1.063.537zm10-15.327c.367 0 .666.299.666.667v12a.667.667 0 0 1-.667.667h-1.333a.667.667 0 0 1-.667-.667V10c0-.368.299-.667.667-.667zM22.175 12c.368 0 .666.299.666.667v6.666a.667.667 0 0 1-.666.667h-1.334a.667.667 0 0 1-.666-.667v-6.666c0-.368.298-.667.666-.667z",
14
- fullscreen: "M25.33 7.265a.667.667 0 0 0-.663-.598h-5.334a.667.667 0 0 0-.666.666v2c0 .369.298.667.666.667h2.534c.073 0 .133.06.133.133v2.534c0 .368.299.666.667.666h2a.667.667 0 0 0 .666-.666V7.333zM22 21.867c0 .073-.06.133-.133.133h-2.534a.667.667 0 0 0-.666.667v2c0 .368.298.666.666.666h5.334a.667.667 0 0 0 .666-.666v-5.334a.667.667 0 0 0-.666-.666h-2a.667.667 0 0 0-.667.666zM12.667 22h-2.534a.133.133 0 0 1-.133-.133v-2.534a.667.667 0 0 0-.667-.666h-2a.667.667 0 0 0-.666.666v5.334c0 .368.298.666.666.666h5.334a.667.667 0 0 0 .666-.666v-2a.667.667 0 0 0-.666-.667M10 12.667v-2.534c0-.073.06-.133.133-.133h2.534a.667.667 0 0 0 .666-.667v-2a.667.667 0 0 0-.666-.666H7.333a.667.667 0 0 0-.666.666v5.334c0 .368.298.666.666.666h2a.667.667 0 0 0 .667-.666",
15
- "fullscreen-exit": "M19.333 13.333a.667.667 0 0 1-.666-.666V7.333c0-.368.298-.666.666-.666h2c.369 0 .667.298.667.666v2.534c0 .073.06.133.133.133h2.534c.368 0 .666.299.666.667v2a.667.667 0 0 1-.666.666zm-6 6a.667.667 0 0 0-.666-.666H7.333a.667.667 0 0 0-.666.666v2c0 .369.298.667.666.667h2.534c.073 0 .133.06.133.133v2.534c0 .368.299.666.667.666h2a.667.667 0 0 0 .666-.666zm5.334 5.334c0 .368.298.666.666.666h2a.667.667 0 0 0 .667-.666v-2.534c0-.073.06-.133.133-.133h2.534a.667.667 0 0 0 .666-.667v-2a.667.667 0 0 0-.666-.666h-5.334a.667.667 0 0 0-.666.666zm-8-11.334h2a.667.667 0 0 0 .666-.666V7.333a.667.667 0 0 0-.666-.666h-2a.667.667 0 0 0-.667.666v2.534c0 .073-.06.133-.133.133H7.333a.667.667 0 0 0-.666.667v2c0 .368.298.666.666.666z",
16
- settings: "M13.572 5.333c-.33 0-.61.24-.659.566l-.507 3.32a.13.13 0 0 1-.068.098q-.15.08-.294.17a.14.14 0 0 1-.119.01l-3.13-1.22a.67.67 0 0 0-.819.288L5.55 12.769a.67.67 0 0 0 .16.853l2.624 2.1a.14.14 0 0 1 .05.109 8 8 0 0 0 0 .337.14.14 0 0 1-.05.108L5.71 18.379a.67.67 0 0 0-.16.853l2.427 4.204a.67.67 0 0 0 .82.288l3.129-1.221a.14.14 0 0 1 .119.01q.144.088.293.17c.037.02.062.056.068.097l.507 3.32c.05.326.33.566.66.566h4.853c.33 0 .61-.24.66-.566l.507-3.319a.14.14 0 0 1 .069-.098q.15-.08.294-.17a.14.14 0 0 1 .12-.01l3.127 1.22a.67.67 0 0 0 .82-.287l2.427-4.204a.67.67 0 0 0-.16-.854l-2.622-2.1a.14.14 0 0 1-.05-.108 7 7 0 0 0 0-.338.14.14 0 0 1 .05-.109l2.622-2.099a.67.67 0 0 0 .161-.854l-2.427-4.204a.67.67 0 0 0-.82-.287l-3.128 1.22a.14.14 0 0 1-.12-.011 8 8 0 0 0-.294-.171.14.14 0 0 1-.069-.098L19.085 5.9a.67.67 0 0 0-.659-.566zM16 20.285a4.286 4.286 0 1 0 0-8.572 4.286 4.286 0 0 0 0 8.572",
17
- music: "M26.667 6A.667.667 0 0 0 26 5.333H11.333a.667.667 0 0 0-.666.667v11.571a.138.138 0 0 1-.193.125A4.667 4.667 0 1 0 13.334 22V8.667c0-.369.298-.667.666-.667h9.333c.369 0 .667.298.667.667v6.238a.138.138 0 0 1-.192.125 4.667 4.667 0 1 0 2.86 4.304zM22 21.333a2 2 0 1 0 0-4 2 2 0 0 0 0 4M8.667 24a2 2 0 1 0 0-4 2 2 0 0 0 0 4",
18
- "closed-captions": "M4.666 6.667A.667.667 0 0 0 4 7.334v17.333c0 .368.299.667.667.667h22.667a.667.667 0 0 0 .666-.667V7.334a.667.667 0 0 0-.666-.667zm4 14.666A.667.667 0 0 1 8 20.667v-9.334c0-.368.298-.666.667-.666H14c.368 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666h-3.2a.133.133 0 0 0-.133.134v5.066c0 .074.06.134.133.134H14c.368 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666zm9.334 0a.667.667 0 0 1-.667-.666v-9.334c0-.368.299-.666.667-.666h5.333c.369 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666h-3.2a.133.133 0 0 0-.133.134v5.066c0 .074.06.134.133.134h3.2c.369 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666z",
19
- "closed-captions-on": "M8 28c0-.368.298-.666.667-.666h14.666c.369 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666H8.667A.667.667 0 0 1 8 29.334zM4.666 6.667a.667.667 0 0 0-.667.667v17.333c0 .368.299.667.667.667h22.667a.667.667 0 0 0 .666-.667V7.334a.667.667 0 0 0-.666-.667zm4 14.666A.667.667 0 0 1 8 20.667v-9.334c0-.368.298-.666.667-.666H14c.368 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666h-3.2a.133.133 0 0 0-.133.134v5.066c0 .074.06.134.133.134H14c.368 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666zm9.334 0a.667.667 0 0 1-.667-.666v-9.334c0-.368.299-.666.667-.666h5.333c.368 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666h-3.2a.133.133 0 0 0-.133.134v5.066c0 .074.06.134.133.134h3.2c.368 0 .667.298.667.666v1.334a.667.667 0 0 1-.667.666z",
20
- "lock-closed": "M16 4a6.667 6.667 0 0 1 6.665 6.533.136.136 0 0 0 .135.134h1.867c.368 0 .666.298.666.666V26a.667.667 0 0 1-.666.667H7.333A.667.667 0 0 1 6.667 26V11.333c0-.368.298-.666.666-.666H9.2c.074 0 .133-.06.135-.134A6.667 6.667 0 0 1 16 4m-3.998 6.533a.13.13 0 0 0 .131.134h7.734a.13.13 0 0 0 .13-.134 4 4 0 0 0-7.995 0M9.333 14c0-.368.299-.667.667-.667h12c.368 0 .667.299.667.667v9.333A.667.667 0 0 1 22 24H10a.667.667 0 0 1-.667-.667z",
21
- "seek-backward": "M15.604 12.215a.667.667 0 0 0 1.063-.536v-1.5c0-.079.068-.14.146-.131a6.669 6.669 0 1 1-7.448 7.284c-.036-.367-.331-.666-.7-.666H6.667c-.369 0-.67.3-.645.667.343 5.212 4.68 9.334 9.978 9.334 5.523 0 10-4.478 10-10 0-5.257-4.056-9.566-9.208-9.97a.135.135 0 0 1-.125-.133V4.988a.667.667 0 0 0-1.063-.536l-4.527 3.345a.667.667 0 0 0 0 1.073z",
22
- "seek-forward": "M16.417 12.215a.667.667 0 0 1-1.063-.536v-1.5a.13.13 0 0 0-.147-.131 6.668 6.668 0 1 0 7.448 7.284c.037-.367.332-.666.7-.666h1.999c.368 0 .669.3.645.667-.343 5.212-4.68 9.334-9.978 9.334-5.523 0-10-4.478-10-10 0-5.257 4.055-9.566 9.208-9.97a.135.135 0 0 0 .125-.133V4.988a.667.667 0 0 1 1.063-.536l4.527 3.345c.36.267.36.806 0 1.073z",
23
- "seek-backward-10": "M16.667 10.345a.667.667 0 0 1-1.063.536l-4.527-3.345a.667.667 0 0 1 0-1.072l4.527-3.345a.667.667 0 0 1 1.063.536v1.572c0 .07.055.129.126.134 5.89.407 10.54 5.313 10.54 11.306C27.333 22.926 22.26 28 16 28 9.965 28 5.031 23.283 4.686 17.334a.64.64 0 0 1 .647-.667h2c.369 0 .664.3.694.667a8 8 0 1 0 8.784-8.627.132.132 0 0 0-.144.132zm.42 9.334q.552.36 1.313.36.765 0 1.313-.357.55-.36.85-1.043.297-.681.298-1.642.003-.954-.296-1.625-.299-.67-.852-1.02Q19.163 14 18.4 14q-.761 0-1.312.352-.549.35-.847 1.02-.295.668-.298 1.625t.295 1.64q.3.678.85 1.042m2.05-1.253q-.282.463-.737.463a.78.78 0 0 1-.53-.204q-.231-.208-.359-.628-.125-.42-.122-1.06.003-.943.281-1.397.28-.458.73-.458.304 0 .532.202.227.201.355.613.128.41.128 1.04.003.963-.279 1.43m-5.362 1.472c.073 0 .133-.06.133-.134v-5.551a.133.133 0 0 0-.133-.133h-1.133a.13.13 0 0 0-.07.02l-1.34.832a.13.13 0 0 0-.063.114v.904c0 .104.114.168.203.114l1.092-.668a.027.027 0 0 1 .04.023v4.345c0 .074.06.134.134.134z",
24
- "seek-forward-10": "M15.333 10.345c0 .547.623.862 1.063.536l4.527-3.345a.667.667 0 0 0 0-1.072l-4.527-3.345a.667.667 0 0 0-1.063.536v1.572c0 .07-.055.129-.126.134-5.89.407-10.54 5.313-10.54 11.306C4.667 22.926 9.74 28 16 28c6.035 0 10.969-4.717 11.314-10.666a.64.64 0 0 0-.647-.667h-2c-.369 0-.664.3-.694.667a8 8 0 1 1-8.784-8.627.132.132 0 0 1 .144.132zm1.755 9.334q.551.36 1.312.36.765 0 1.313-.357.55-.36.85-1.043.297-.681.298-1.642.003-.954-.296-1.625-.299-.67-.852-1.02Q19.163 14 18.4 14q-.761 0-1.312.352-.549.35-.847 1.02-.295.668-.298 1.625t.295 1.64q.3.678.85 1.042m2.048-1.253q-.281.463-.736.463a.78.78 0 0 1-.53-.204q-.231-.208-.359-.628-.125-.42-.122-1.06.003-.943.281-1.397.28-.458.73-.458.304 0 .532.202.227.201.355.613.128.41.128 1.04.003.963-.279 1.43m-5.361 1.472c.073 0 .133-.06.133-.134v-5.551a.133.133 0 0 0-.133-.133h-1.133a.13.13 0 0 0-.07.02l-1.34.832a.13.13 0 0 0-.063.114v.904c0 .104.114.168.203.114l1.092-.668a.027.027 0 0 1 .04.023v4.345c0 .074.06.134.134.134z",
25
- "seek-backward-30": "M16.667 10.345a.667.667 0 0 1-1.063.536l-4.527-3.345a.667.667 0 0 1 0-1.072l4.527-3.345a.667.667 0 0 1 1.063.536v1.572c0 .07.055.129.126.134 5.89.407 10.54 5.313 10.54 11.306C27.333 22.926 22.26 28 16 28 9.965 28 5.031 23.283 4.686 17.334a.64.64 0 0 1 .647-.667h2c.369 0 .664.3.694.667a8 8 0 1 0 8.784-8.627.132.132 0 0 0-.144.132zm-5.083 9.405a2.9 2.9 0 0 0 1.18.227q.681 0 1.207-.221.528-.225.824-.614.298-.391.298-.898a1.23 1.23 0 0 0-.344-.895q-.337-.351-.997-.434a.026.026 0 0 1-.023-.026q.002-.021.023-.026.49-.078.804-.389.324-.318.321-.81 0-.474-.264-.849a1.8 1.8 0 0 0-.739-.596 2.6 2.6 0 0 0-1.1-.219q-.626 0-1.118.225-.49.225-.773.622a1.53 1.53 0 0 0-.284.78.126.126 0 0 0 .129.134h1.08c.071 0 .129-.058.145-.128a.6.6 0 0 1 .1-.221.7.7 0 0 1 .299-.233q.19-.082.423-.082.221 0 .39.082a.62.62 0 0 1 .357.577.6.6 0 0 1-.108.358.7.7 0 0 1-.31.238q-.196.085-.454.085h-.432a.133.133 0 0 0-.133.134v.733c0 .074.06.134.133.134h.432q.295 0 .511.088a.77.77 0 0 1 .338.247q.12.159.117.363a.6.6 0 0 1-.105.364.74.74 0 0 1-.301.247 1 1 0 0 1-.44.088q-.251 0-.447-.082a.76.76 0 0 1-.31-.227.6.6 0 0 1-.103-.212c-.018-.07-.075-.127-.146-.127H10.61a.126.126 0 0 0-.128.135q.037.444.295.794.296.404.806.634m6.196-.071q.552.36 1.313.36.765 0 1.312-.357.551-.36.85-1.043.297-.681.298-1.642.003-.954-.296-1.625-.299-.67-.852-1.02-.55-.352-1.311-.352t-1.313.352q-.548.35-.847 1.02-.295.668-.298 1.625t.296 1.64q.298.678.85 1.042m2.048-1.253q-.28.463-.735.463a.78.78 0 0 1-.532-.204q-.23-.208-.358-.628-.125-.42-.122-1.06.003-.943.282-1.397.277-.458.73-.458.304 0 .53.202.227.201.356.613.128.41.128 1.04.003.963-.279 1.43",
26
- "seek-forward-30": "M15.333 10.345c0 .547.623.862 1.063.536l4.528-3.345a.667.667 0 0 0 0-1.072l-4.528-3.345a.667.667 0 0 0-1.063.536v1.572c0 .07-.055.129-.126.134-5.89.407-10.54 5.313-10.54 11.306C4.667 22.926 9.74 28 16 28c6.035 0 10.969-4.717 11.314-10.666a.64.64 0 0 0-.647-.667h-2c-.369 0-.664.3-.694.667a8 8 0 1 1-8.784-8.627.132.132 0 0 1 .144.132zm-3.748 9.405a2.9 2.9 0 0 0 1.178.227q.682 0 1.208-.221.528-.225.824-.614.298-.391.298-.898a1.23 1.23 0 0 0-.344-.895q-.337-.351-.997-.434a.026.026 0 0 1-.023-.026q.002-.021.023-.026.49-.078.804-.389.324-.318.321-.81 0-.474-.264-.849a1.8 1.8 0 0 0-.739-.596 2.6 2.6 0 0 0-1.1-.219q-.626 0-1.118.225-.49.225-.773.622a1.53 1.53 0 0 0-.284.78.126.126 0 0 0 .129.134h1.08c.071 0 .129-.058.145-.128a.6.6 0 0 1 .1-.221.7.7 0 0 1 .299-.233q.19-.082.423-.082.221 0 .39.082a.62.62 0 0 1 .357.577.6.6 0 0 1-.108.358.7.7 0 0 1-.31.238q-.196.085-.454.085h-.432a.133.133 0 0 0-.133.134v.733c0 .074.06.134.133.134h.432q.295 0 .511.088a.77.77 0 0 1 .338.247q.12.159.117.363a.6.6 0 0 1-.105.364.74.74 0 0 1-.301.247 1 1 0 0 1-.44.088q-.251 0-.447-.082a.76.76 0 0 1-.31-.227.6.6 0 0 1-.103-.212c-.018-.07-.075-.127-.146-.127H10.61a.126.126 0 0 0-.128.135q.037.444.295.794.296.404.806.634m6.195-.071q.552.36 1.313.36.765 0 1.312-.357.551-.36.85-1.043.297-.681.298-1.642.003-.954-.296-1.625-.299-.67-.852-1.02-.549-.352-1.31-.352t-1.313.352q-.548.35-.847 1.02-.295.668-.298 1.625t.296 1.64q.298.678.85 1.042m2.048-1.253q-.28.463-.735.463a.78.78 0 0 1-.532-.204q-.23-.208-.358-.628-.125-.42-.122-1.06.003-.943.282-1.397.277-.458.73-.458.304 0 .53.202.227.201.356.613.128.41.128 1.04.003.963-.279 1.43",
27
- "playback-speed": "M13.921 5.536c.394-.078.746.234.746.635v1.401c0 .326-.236.6-.553.677a8 8 0 0 0-3.905 2.257.71.71 0 0 1-.862.14l-1.206-.697c-.347-.2-.441-.661-.177-.963a10.66 10.66 0 0 1 5.957-3.45M5.89 12.59c.128-.38.575-.53.923-.33l1.199.693a.71.71 0 0 1 .31.816A8 8 0 0 0 8 16.026c0 .783.113 1.54.322 2.255a.71.71 0 0 1-.31.817l-1.185.684c-.346.2-.792.052-.922-.327A10.7 10.7 0 0 1 5.333 16c0-1.192.196-2.339.557-3.41m2.281 9.494c-.348.201-.442.664-.176.965a10.66 10.66 0 0 0 5.926 3.414c.394.078.746-.234.746-.635v-1.35c0-.325-.236-.6-.553-.677a8 8 0 0 1-3.905-2.257.71.71 0 0 0-.862-.139zm9.162 3.744c0 .401.353.713.746.635 4.896-.967 8.588-5.284 8.588-10.464s-3.692-9.497-8.588-10.464c-.393-.078-.746.234-.746.635v1.401c0 .326.237.6.553.677a8.003 8.003 0 0 1 0 15.553.71.71 0 0 0-.553.677zm-2.937-15.413a.667.667 0 0 0-1.063.537v10.094c0 .548.623.862 1.063.537l6.831-5.048a.667.667 0 0 0 0-1.073z",
28
- "picture-in-picture": "M16 15.333a.667.667 0 0 0-.667.667v4c0 .368.299.667.667.667h5.333A.667.667 0 0 0 22 20v-4a.667.667 0 0 0-.667-.667zm-10.667-8c0-.368.299-.666.667-.666h20c.368 0 .667.298.667.666v17.334a.667.667 0 0 1-.667.666H6a.667.667 0 0 1-.667-.666zM8 10c0-.368.298-.667.667-.667h14.666c.369 0 .667.299.667.667v12a.667.667 0 0 1-.667.667H8.667A.667.667 0 0 1 8 22z",
29
- "picture-in-picture-exit": "M5.333 26v-6.533c0-.074.06-.134.134-.134h2.4c.073 0 .133.06.133.134v3.866c0 .369.298.667.667.667h14.666a.667.667 0 0 0 .667-.667V8.667A.667.667 0 0 0 23.333 8h-3.866a.133.133 0 0 1-.134-.133v-2.4c0-.074.06-.134.134-.134H26c.368 0 .667.299.667.667v20a.667.667 0 0 1-.667.667H6A.667.667 0 0 1 5.333 26M14.01 8.424h-3.204a.133.133 0 0 0-.094.227l5.837 5.838c.26.26.26.682 0 .942l-1.226 1.226a.667.667 0 0 1-.942 0l-5.744-5.743a.133.133 0 0 0-.227.094v3.016a.667.667 0 0 1-.667.666H6.01a.667.667 0 0 1-.667-.666v-8c0-.369.299-.667.667-.667h8c.368 0 .666.298.666.667v1.733a.667.667 0 0 1-.666.667",
30
- airplay: "M5.333 6c0-.368.299-.667.667-.667h20c.368 0 .667.299.667.667v14.667a.667.667 0 0 1-.667.666h-2.293c-.211 0-.41-.1-.536-.27l-.985-1.333a.667.667 0 0 1 .536-1.063h.611A.667.667 0 0 0 24 18V8.667A.667.667 0 0 0 23.333 8H8.667A.667.667 0 0 0 8 8.667V18c0 .368.298.667.667.667h.627c.547 0 .86.622.536 1.063l-.985 1.333a.67.67 0 0 1-.537.27H6a.667.667 0 0 1-.667-.666zm3.452 19.604a.667.667 0 0 0 .536 1.063H22.68a.667.667 0 0 0 .536-1.063l-6.68-9.039a.667.667 0 0 0-1.072 0z",
31
- "airplay-active": "M5.333 6c0-.368.299-.667.667-.667h20c.368 0 .667.299.667.667v14.667a.667.667 0 0 1-.667.666H6a.667.667 0 0 1-.667-.666zm3.452 19.604a.667.667 0 0 0 .536 1.063H22.68a.667.667 0 0 0 .536-1.063l-6.68-9.039a.667.667 0 0 0-1.072 0z",
32
- chapters: "M16.693 25.335a.667.667 0 0 1-.667-.667V7.335c0-.369.299-.667.667-.667h2c.368 0 .666.298.666.667v17.333a.667.667 0 0 1-.666.667zm7.333 0a.667.667 0 0 1-.667-.667V7.335c0-.369.299-.667.667-.667h2c.368 0 .667.298.667.667v17.333a.667.667 0 0 1-.667.667zM5.481 23.94a.667.667 0 0 0 .472.816l1.931.518a.667.667 0 0 0 .817-.472L13.187 8.06a.667.667 0 0 0-.471-.817l-1.932-.517a.667.667 0 0 0-.817.47z",
33
- "fast-forward": "M16.125 8.119a.667.667 0 0 0-1.062.536v5.603a.134.134 0 0 1-.213.107L6.396 8.119a.667.667 0 0 0-1.063.536v14.69c0 .547.623.861 1.063.536l8.454-6.246a.133.133 0 0 1 .213.107v5.603c0 .547.622.861 1.062.536l9.941-7.345a.667.667 0 0 0 0-1.073z",
34
- "fast-backward": "M15.875 8.119a.667.667 0 0 1 1.063.536v5.603c0 .109.124.172.212.107l8.454-6.246a.667.667 0 0 1 1.063.536v14.69a.667.667 0 0 1-1.063.536l-8.454-6.246a.133.133 0 0 0-.212.107v5.603a.667.667 0 0 1-1.063.536l-9.941-7.345a.667.667 0 0 1 0-1.073z"
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. */
@@ -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 = 264;
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");
@@ -80,10 +80,16 @@ function menu(options) {
80
80
  * left of its right edge.
81
81
  */
82
82
  function fit() {
83
+ if (host.getAttribute("layout") === "compact") {
84
+ popup.style.maxHeight = "";
85
+ popup.style.maxWidth = "";
86
+ more();
87
+ return;
88
+ }
83
89
  const picture = options.picture();
84
90
  if (picture === null) return;
85
91
  const room = button.getBoundingClientRect().top - picture.top - AIR;
86
- const most = Number.parseFloat(getComputedStyle(host).getPropertyValue("--mbx-menu-max-height")) || MAX_HEIGHT;
92
+ const most = Number.parseFloat(getComputedStyle(host).getPropertyValue("--mbx-menu-max-height")) || MAX_HEIGHT * (Number.parseFloat(getComputedStyle(host).fontSize) || 16);
87
93
  popup.style.maxHeight = `${Math.max(0, Math.floor(Math.min(most, room)))}px`;
88
94
  more();
89
95
  const wide = host.getBoundingClientRect().right - picture.left - AIR;
@@ -114,6 +120,11 @@ function menu(options) {
114
120
  const page = stack[stack.length - 1];
115
121
  if (page === void 0) return;
116
122
  let tab = true;
123
+ if (stack.length === 1 && name !== "") {
124
+ const title = el("div", "title", name);
125
+ title.setAttribute("aria-hidden", "true");
126
+ popup.append(title);
127
+ }
117
128
  if (stack.length > 1) {
118
129
  const back = item("item back-item", page.label, () => {
119
130
  var _items$;
@@ -135,6 +146,11 @@ function menu(options) {
135
146
  });
136
147
  link.setAttribute("role", "menuitem");
137
148
  link.setAttribute("aria-haspopup", "menu");
149
+ if (entry.glyph !== void 0) {
150
+ link.prepend(entry.glyph());
151
+ state(link, `item page-item ${entry.name}-item`, { "glyph-item": true });
152
+ }
153
+ if (entry.detail !== void 0) link.append(el("span", "item-detail", entry.detail));
138
154
  popup.append(link);
139
155
  continue;
140
156
  }
@@ -142,7 +158,7 @@ function menu(options) {
142
158
  section.setAttribute("role", "group");
143
159
  if (entry.label !== void 0) {
144
160
  section.setAttribute("aria-label", entry.label);
145
- section.append(el("div", `section-label ${entry.name}-label`, entry.label));
161
+ if (entry.hideLabel !== true) section.append(el("div", `section-label ${entry.name}-label`, entry.label));
146
162
  }
147
163
  for (const [id, text, detail, image, badges] of entry.items) {
148
164
  const choice = item(`item ${entry.name}-item`, text, () => {
@@ -150,7 +166,18 @@ function menu(options) {
150
166
  button.focus();
151
167
  entry.onSelect(id);
152
168
  });
153
- for (const badge of badges !== null && badges !== void 0 ? badges : []) choice.append(el("span", "item-badge", badge));
169
+ for (const badge of badges !== null && badges !== void 0 ? badges : []) {
170
+ var _entry$badgeGlyphs;
171
+ const glyph = (_entry$badgeGlyphs = entry.badgeGlyphs) === null || _entry$badgeGlyphs === void 0 ? void 0 : _entry$badgeGlyphs[badge];
172
+ if (glyph === void 0) {
173
+ choice.append(el("span", "item-badge", badge));
174
+ continue;
175
+ }
176
+ const drawn = el("span", "item-badge item-glyph");
177
+ drawn.title = badge;
178
+ drawn.append(glyph(), el("span", "badge-text", badge));
179
+ choice.append(drawn);
180
+ }
154
181
  if (detail !== void 0) choice.append(el("span", "item-detail", detail));
155
182
  if (image !== void 0) {
156
183
  const [, ...rest] = choice.childNodes;
@@ -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
- "license-url",
30
- "certificate-url",
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.options = options !== null && options !== void 0 ? options : defaults;
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
- this.stage.append(document.createElement("slot"));
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 url = _this.getAttribute("src");
335
- if (url === null) return;
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
- session = yield core.load(source);
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("license-url");
414
- const certificate = this.getAttribute("certificate-url");
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 license = this.getAttribute("license-url");
426
- if (license !== null && optional.drm !== void 0) optional.drm.setLicenseUrl(license);
427
- const certificate = this.getAttribute("certificate-url");
428
- if (certificate !== null) (_optional$drm = optional.drm) === null || _optional$drm === void 0 || _optional$drm.setCertificateUrl(certificate);
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
  }
@@ -1,3 +1,4 @@
1
+ import { icon } from "../controls/icons.js";
1
2
  import { show } from "./shared.js";
2
3
  import { nativeTracks, onNativeTracks } from "../controls/native-tracks.js";
3
4
  import { layout, trackNames } from "../controls/track-names.js";
@@ -47,7 +48,7 @@ var MbxAudioMenu = class extends MenuElement {
47
48
  ];
48
49
  }
49
50
  constructor() {
50
- super(...single("music"));
51
+ super(...single("audio"));
51
52
  this.engine = null;
52
53
  show(this.slots, "default");
53
54
  }
@@ -79,6 +80,7 @@ var MbxAudioMenu = class extends MenuElement {
79
80
  return [entries, on === -1 ? null : String(on)];
80
81
  }
81
82
  render() {
83
+ var _this$getAttribute4;
82
84
  super.render();
83
85
  const engine = this.engine;
84
86
  const player = this.player;
@@ -95,6 +97,7 @@ var MbxAudioMenu = class extends MenuElement {
95
97
  this.menu.fill([{
96
98
  name: "track",
97
99
  items,
100
+ badgeGlyphs: { [(_this$getAttribute4 = this.getAttribute("label-ad")) !== null && _this$getAttribute4 !== void 0 ? _this$getAttribute4 : "AD"]: () => icon("audio-description") },
98
101
  value: active !== null && active !== void 0 ? active : "",
99
102
  onSelect: (value) => {
100
103
  if (tracks !== void 0) tracks.forEach((track, index) => {
@@ -18,6 +18,16 @@ var Component = class extends HTMLElement {
18
18
  customElements.upgrade(found);
19
19
  if (!("video" in found)) return;
20
20
  this.player = found;
21
+ const tier = () => {
22
+ const layout = found.getAttribute("layout");
23
+ if (layout === null) this.removeAttribute("layout");
24
+ else this.setAttribute("layout", layout);
25
+ };
26
+ this.listen(found, ["layoutchange"], () => {
27
+ tier();
28
+ this.render();
29
+ });
30
+ tier();
21
31
  this.attach(this.player);
22
32
  };
23
33
  if ("video" in found) attach();