@mattebox/player 0.7.0 → 0.8.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.
- package/dist/cdn/mattebox-player.min.js +3 -3
- package/dist/controls/icons.d.ts +3 -1
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/icons.js +27 -27
- package/dist/controls/icons.js.map +1 -1
- package/dist/controls/markers.d.ts +39 -0
- package/dist/controls/markers.d.ts.map +1 -0
- package/dist/controls/markers.js +38 -0
- package/dist/controls/markers.js.map +1 -0
- package/dist/controls/menu.d.ts +3 -2
- package/dist/controls/menu.d.ts.map +1 -1
- package/dist/controls/menu.js +23 -3
- package/dist/controls/menu.js.map +1 -1
- package/dist/controls/native-tracks.d.ts +28 -0
- package/dist/controls/native-tracks.d.ts.map +1 -0
- package/dist/controls/native-tracks.js +30 -0
- package/dist/controls/native-tracks.js.map +1 -0
- package/dist/controls/quality-names.d.ts +15 -0
- package/dist/controls/quality-names.d.ts.map +1 -0
- package/dist/controls/quality-names.js +62 -0
- package/dist/controls/quality-names.js.map +1 -0
- package/dist/controls/track-names.d.ts +40 -0
- package/dist/controls/track-names.d.ts.map +1 -0
- package/dist/controls/track-names.js +59 -0
- package/dist/controls/track-names.js.map +1 -0
- package/dist/element.d.ts +24 -0
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +47 -4
- package/dist/element.js.map +1 -1
- package/dist/elements/audio-menu.d.ts +19 -8
- package/dist/elements/audio-menu.d.ts.map +1 -1
- package/dist/elements/audio-menu.js +57 -18
- package/dist/elements/audio-menu.js.map +1 -1
- package/dist/elements/drm-badge.d.ts +3 -2
- package/dist/elements/drm-badge.d.ts.map +1 -1
- package/dist/elements/drm-badge.js +10 -8
- package/dist/elements/drm-badge.js.map +1 -1
- package/dist/elements/marker-button.d.ts +22 -0
- package/dist/elements/marker-button.d.ts.map +1 -0
- package/dist/elements/marker-button.js +99 -0
- package/dist/elements/marker-button.js.map +1 -0
- package/dist/elements/quality-menu.d.ts +4 -0
- package/dist/elements/quality-menu.d.ts.map +1 -1
- package/dist/elements/quality-menu.js +21 -7
- package/dist/elements/quality-menu.js.map +1 -1
- package/dist/elements/seek-bar.d.ts +6 -1
- package/dist/elements/seek-bar.d.ts.map +1 -1
- package/dist/elements/seek-bar.js +33 -22
- package/dist/elements/seek-bar.js.map +1 -1
- package/dist/elements/shared.js +1 -1
- package/dist/elements/subtitles-menu.d.ts +2 -0
- package/dist/elements/subtitles-menu.d.ts.map +1 -1
- package/dist/elements/subtitles-menu.js +33 -9
- package/dist/elements/subtitles-menu.js.map +1 -1
- package/dist/entries/marker-button.d.ts +5 -0
- package/dist/entries/marker-button.d.ts.map +1 -0
- package/dist/entries/marker-button.js +9 -0
- package/dist/entries/marker-button.js.map +1 -0
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/controls/chapters.js +1 -1
- package/dist/es2015/controls/icons.js +27 -27
- package/dist/es2015/controls/markers.js +36 -0
- package/dist/es2015/controls/menu.js +24 -4
- package/dist/es2015/controls/native-tracks.js +29 -0
- package/dist/es2015/controls/quality-names.js +67 -0
- package/dist/es2015/controls/track-names.js +57 -0
- package/dist/es2015/element.js +48 -6
- package/dist/es2015/elements/audio-menu.js +62 -19
- package/dist/es2015/elements/drm-badge.js +11 -8
- package/dist/es2015/elements/marker-button.js +100 -0
- package/dist/es2015/elements/quality-menu.js +22 -7
- package/dist/es2015/elements/seek-bar.js +38 -26
- package/dist/es2015/elements/shared.js +1 -1
- package/dist/es2015/elements/subtitles-menu.js +39 -11
- package/dist/es2015/entries/marker-button.js +7 -0
- package/dist/es2015/index.js +3 -1
- package/dist/es2015/presets.js +1 -1
- package/dist/es2015/style.js +1 -1
- package/dist/es2015/tags.js +2 -1
- package/dist/host.d.ts +3 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/style.js +1 -1
- package/dist/tags.d.ts +1 -0
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +2 -1
- package/dist/tags.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subtitles-menu.js","names":[],"sources":["../../src/elements/subtitles-menu.ts"],"sourcesContent":["/**\n * <mbx-subtitles-menu>: the text track over `engine.tracks`, with \"off\"\n * because a text selection is releasable and an audio one is not, and a\n * Settings page behind it with the size and the background. The glyph\n * says whether a track is on: `icon` or `icon-on`. Hidden without text\n * tracks, and for a native session.\n *\n * The looks are attributes on the player, `subtitle-size` and\n * `subtitle-background`, where the element's stylesheet turns them into\n * the cue rules; a page can set them in markup and persist them however\n * it likes. Every word the menu shows is an attribute: `label`,\n * `label-off`, `label-track`, `label-settings`, `label-size`,\n * `label-background`, one per size and one per background.\n */\nimport type { Mattebox } from 'mattebox';\nimport { icon } from '../controls/icons.js';\nimport type { MenuGroup } from '../controls/menu.js';\nimport type { PlayerHost } from '../host.js';\nimport { onTracks, trackItems } from './audio-menu.js';\nimport { MenuElement } from './menu-element.js';\nimport { show } from './shared.js';\n\nconst OFF = 'off';\nexport const SUBTITLE_SIZE = 'subtitle-size';\nexport const SUBTITLE_BACKGROUND = 'subtitle-background';\n\nconst SIZES: ReadonlyArray<readonly [string, string]> = [\n ['small', 'Small'],\n ['medium', 'Medium'],\n ['large', 'Large'],\n ['xlarge', 'Extra large'],\n];\nconst BACKGROUNDS: ReadonlyArray<readonly [string, string]> = [\n ['none', 'None'],\n ['dark', 'Dark'],\n ['solid', 'Solid'],\n];\n\ntype State = 'off' | 'on';\nconst STATES: readonly State[] = ['off', 'on'];\n\nexport class MbxSubtitlesMenu extends MenuElement<State> {\n static get observedAttributes(): readonly string[] {\n return [\n 'label',\n 'label-back',\n 'label-off',\n 'label-track',\n 'label-settings',\n 'label-size',\n 'label-background',\n ...SIZES.map(([id]) => `label-${id}`),\n ...BACKGROUNDS.map(([id]) => `label-${id}`),\n ];\n }\n\n declare private engine: Mattebox | null;\n\n constructor() {\n super(STATES, (state) => icon(state === 'on' ? 'closed-captions-on' : 'closed-captions'));\n this.engine = null;\n show(this.slots, 'off');\n }\n\n protected override name(): string {\n return 'Subtitles';\n }\n\n /** A look's group: the choices named from the attributes, the value from the player's. */\n private looks(\n player: PlayerHost,\n attribute: string,\n name: string,\n fallback: string,\n choices: ReadonlyArray<readonly [string, string]>,\n initial: string,\n ): MenuGroup {\n const set = player.getAttribute(attribute);\n const value = set !== null && choices.some(([id]) => id === set) ? set : initial;\n return {\n name,\n label: this.getAttribute(`label-${name}`) ?? fallback,\n items: choices.map(([id, text]) => [id, this.getAttribute(`label-${id}`) ?? text]),\n value,\n onSelect: (chosen) => {\n player.setAttribute(attribute, chosen);\n this.render();\n },\n };\n }\n\n protected override attach(player: PlayerHost): void {\n this.follow(player, (engine) => {\n this.engine = engine;\n this.render();\n if (engine === null) return undefined;\n return onTracks(engine, () => {\n this.render();\n });\n });\n }\n\n protected override render(): void {\n super.render();\n const engine = this.engine;\n const player = this.player;\n if (engine === null || player === null) {\n this.hidden = true;\n return;\n }\n const [tracks, active] = trackItems(engine, 'text');\n const items: Array<readonly [string, string]> = [\n [OFF, this.getAttribute('label-off') ?? 'Off'],\n ...tracks,\n ];\n this.menu.fill([\n {\n name: 'track',\n label: this.getAttribute('label-track') ?? 'Track',\n items,\n value: active ?? OFF,\n onSelect: (value) => {\n if (value === OFF) engine.tracks.deselect('text');\n else engine.tracks.select(value);\n this.render();\n },\n },\n {\n name: 'settings',\n label: this.getAttribute('label-settings') ?? 'Settings',\n entries: [\n this.looks(player, SUBTITLE_SIZE, 'size', 'Size', SIZES, 'medium'),\n this.looks(player, SUBTITLE_BACKGROUND, 'background', 'Background', BACKGROUNDS, 'dark'),\n ],\n },\n ]);\n show(this.slots, active === null ? 'off' : 'on');\n this.hidden = tracks.length === 0;\n }\n}\n"],"mappings":";;;;;AAsBA,MAAM,MAAM;AACZ,MAAa,gBAAgB;AAC7B,MAAa,sBAAsB;AAEnC,MAAM,QAAkD;CACtD,CAAC,SAAS,OAAO;CACjB,CAAC,UAAU,QAAQ;CACnB,CAAC,SAAS,OAAO;CACjB,CAAC,UAAU,aAAa;AAC1B;AACA,MAAM,cAAwD;CAC5D,CAAC,QAAQ,MAAM;CACf,CAAC,QAAQ,MAAM;CACf,CAAC,SAAS,OAAO;AACnB;AAGA,MAAM,SAA2B,CAAC,OAAO,IAAI;AAE7C,IAAa,mBAAb,cAAsC,YAAmB;CACvD,WAAW,qBAAwC;EACjD,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA,GAAG,MAAM,KAAK,CAAC,QAAQ,SAAS,IAAI;GACpC,GAAG,YAAY,KAAK,CAAC,QAAQ,SAAS,IAAI;EAC5C;CACF;CAIA,cAAc;EACZ,MAAM,SAAS,UAAU,KAAK,UAAU,OAAO,uBAAuB,iBAAiB,CAAC;EACxF,KAAK,SAAS;EACd,KAAK,KAAK,OAAO,KAAK;CACxB;CAEA,OAAkC;EAChC,OAAO;CACT;;CAGA,MACE,QACA,WACA,MACA,UACA,SACA,SACW;EACX,MAAM,MAAM,OAAO,aAAa,SAAS;E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AK,KAAK,OAAO,WAAW,OAAO,QAAQ,IAAI;EAC/C,KAAK,SAAS,OAAO,WAAW;CAClC;AACF"}
|
|
1
|
+
{"version":3,"file":"subtitles-menu.js","names":[],"sources":["../../src/elements/subtitles-menu.ts"],"sourcesContent":["/**\n * <mbx-subtitles-menu>: the text track over `engine.tracks`, or over the\n * video's `textTracks` of kind `subtitles` and `captions` for a native\n * session, with \"off\" because a text selection is releasable and an audio\n * one is not, and a Settings page behind it with the size and the\n * background. The glyph says whether a track is on: `icon` or `icon-on`.\n * Hidden without text tracks.\n *\n * The looks are attributes on the player, `subtitle-size` and\n * `subtitle-background`, where the element's stylesheet turns them into\n * the cue rules; a page can set them in markup and persist them however\n * it likes. Every word the menu shows is an attribute: `label`,\n * `label-off`, `label-track`, `label-settings`, `label-size`,\n * `label-background`, one per size and one per background, `label-sdh`\n * for the badge on subtitles for the deaf and hard of hearing, and\n * `label-cc` for the badge on closed captions carried in the video.\n * `label-track` also names a track that has no name and no language.\n *\n * Forced tracks are not listed. The engine's forced-subtitles stage shows\n * one while no subtitle is selected, so the menu reads Off then (guide\n * chapter 06). In a native session Safari shows them itself. A native\n * `captions` track carries the SDH badge: Safari gives that kind to the\n * subtitles that describe music and sound.\n */\nimport type { Mattebox } from 'mattebox';\nimport { isSdh } from 'mattebox';\nimport { icon } from '../controls/icons.js';\nimport type { MenuGroup } from '../controls/menu.js';\nimport { nativeTracks, onNativeTracks } from '../controls/native-tracks.js';\nimport type { TrackEntry } from '../controls/track-names.js';\nimport { trackNames } from '../controls/track-names.js';\nimport type { PlayerHost } from '../host.js';\nimport { onTracks, trackItems } from './audio-menu.js';\nimport { MenuElement } from './menu-element.js';\nimport { show } from './shared.js';\n\nconst OFF = 'off';\nexport const SUBTITLE_SIZE = 'subtitle-size';\nexport const SUBTITLE_BACKGROUND = 'subtitle-background';\n\nconst SIZES: ReadonlyArray<readonly [string, string]> = [\n ['small', 'Small'],\n ['medium', 'Medium'],\n ['large', 'Large'],\n ['xlarge', 'Extra large'],\n];\nconst BACKGROUNDS: ReadonlyArray<readonly [string, string]> = [\n ['none', 'None'],\n ['dark', 'Dark'],\n ['solid', 'Solid'],\n];\n\ntype State = 'off' | 'on';\nconst STATES: readonly State[] = ['off', 'on'];\n\nexport class MbxSubtitlesMenu extends MenuElement<State> {\n static get observedAttributes(): readonly string[] {\n return [\n 'label',\n 'label-back',\n 'label-off',\n 'label-track',\n 'label-settings',\n 'label-size',\n 'label-background',\n 'label-sdh',\n 'label-cc',\n ...SIZES.map(([id]) => `label-${id}`),\n ...BACKGROUNDS.map(([id]) => `label-${id}`),\n ];\n }\n\n declare private engine: Mattebox | null;\n\n constructor() {\n super(STATES, (state) => icon(state === 'on' ? 'closed-captions-on' : 'closed-captions'));\n this.engine = null;\n show(this.slots, 'off');\n }\n\n protected override name(): string {\n return 'Subtitles';\n }\n\n /** A look's group: the choices named from the attributes, the value from the player's. */\n private looks(\n player: PlayerHost,\n attribute: string,\n name: string,\n fallback: string,\n choices: ReadonlyArray<readonly [string, string]>,\n initial: string,\n ): MenuGroup {\n const set = player.getAttribute(attribute);\n const value = set !== null && choices.some(([id]) => id === set) ? set : initial;\n return {\n name,\n label: this.getAttribute(`label-${name}`) ?? fallback,\n items: choices.map(([id, text]) => [id, this.getAttribute(`label-${id}`) ?? text]),\n value,\n onSelect: (chosen) => {\n player.setAttribute(attribute, chosen);\n this.render();\n },\n };\n }\n\n protected override attach(player: PlayerHost): void {\n this.follow(player, (engine) => {\n this.engine = engine;\n this.render();\n const tick = (): void => {\n this.render();\n };\n return engine === null\n ? onNativeTracks(player.video, 'textTracks', tick)\n : onTracks(engine, tick);\n });\n }\n\n /** The native session's subtitle tracks as entries, and the showing one's. */\n private native(tracks: readonly TextTrack[]): [TrackEntry[], string | null] {\n const sdh = this.getAttribute('label-sdh') ?? 'SDH';\n const entries = tracks.map(\n (track, index): TrackEntry => [\n String(index),\n track.label,\n track.language,\n track.kind === 'captions' ? [sdh] : [],\n [],\n ],\n );\n const on = tracks.findIndex((track) => track.mode === 'showing');\n return [entries, on === -1 ? null : String(on)];\n }\n\n protected override render(): void {\n super.render();\n const engine = this.engine;\n const player = this.player;\n // The chapters track the element adds, and any metadata track, are not subtitles.\n const listed =\n engine === null && player !== null\n ? nativeTracks<TextTrack>(player, 'textTracks')?.filter(\n (track) => track.kind === 'subtitles' || track.kind === 'captions',\n )\n : undefined;\n if (player === null || (engine === null && listed === undefined)) {\n this.hidden = true;\n return;\n }\n const [tracks, active] =\n listed !== undefined\n ? this.native(listed)\n : trackItems(\n engine as Mattebox,\n 'text',\n (track) => [\n // A manifest names in-band captions by their channel (guide chapter 06).\n ...(track.instreamId !== undefined ? [this.getAttribute('label-cc') ?? 'CC'] : []),\n ...(isSdh(track) ? [this.getAttribute('label-sdh') ?? 'SDH'] : []),\n ],\n (track) => track.forced !== true,\n );\n const word = this.getAttribute('label-track');\n const items: MenuGroup['items'] = [\n [OFF, this.getAttribute('label-off') ?? 'Off'],\n ...trackNames(tracks, word),\n ];\n this.menu.fill([\n {\n name: 'track',\n label: word ?? 'Track',\n items,\n value: active ?? OFF,\n onSelect: (value) => {\n if (listed !== undefined) {\n // Off first, so two tracks never show at once.\n for (const track of listed) track.mode = 'disabled';\n const chosen = listed[Number(value)];\n if (chosen !== undefined) chosen.mode = 'showing';\n } else if (value === OFF) engine?.tracks.deselect('text');\n else engine?.tracks.select(value);\n this.render();\n },\n },\n {\n name: 'settings',\n label: this.getAttribute('label-settings') ?? 'Settings',\n entries: [\n this.looks(player, SUBTITLE_SIZE, 'size', 'Size', SIZES, 'medium'),\n this.looks(player, SUBTITLE_BACKGROUND, 'background', 'Background', BACKGROUNDS, 'dark'),\n ],\n },\n ]);\n show(this.slots, active === null ? 'off' : 'on');\n this.hidden = tracks.length === 0;\n }\n}\n"],"mappings":";;;;;;;;AAoCA,MAAM,MAAM;AACZ,MAAa,gBAAgB;AAC7B,MAAa,sBAAsB;AAEnC,MAAM,QAAkD;CACtD,CAAC,SAAS,OAAO;CACj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MAAM,SAAS,OAAO,OAAO,KAAK;KAClC,IAAI,WAAW,KAAA,GAAW,OAAO,OAAO;IAC1C,OAAO,IAAI,UAAU,KAAK,QAAQ,OAAO,SAAS,MAAM;SACnD,QAAQ,OAAO,OAAO,KAAK;IAChC,KAAK,OAAO;GACd;EACF,GACA;GACE,MAAM;GACN,OAAO,KAAK,aAAa,gBAAgB,KAAK;GAC9C,SAAS,CACP,KAAK,MAAM,QAAQ,eAAe,QAAQ,QAAQ,OAAO,QAAQ,GACjE,KAAK,MAAM,QAAQ,qBAAqB,cAAc,cAAc,aAAa,MAAM,CACzF;EACF,CACF,CAAC;EACD,KAAK,KAAK,OAAO,WAAW,OAAO,QAAQ,IAAI;EAC/C,KAAK,SAAS,OAAO,WAAW;CAClC;AACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** `@mattebox/player/elements/marker-button`: registers <mbx-marker-button>, and the player with it. */
|
|
2
|
+
import '../element-entry.js';
|
|
3
|
+
import { MbxMarkerButton } from '../elements/marker-button.js';
|
|
4
|
+
export { MbxMarkerButton };
|
|
5
|
+
//# sourceMappingURL=marker-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker-button.d.ts","sourceRoot":"","sources":["../../src/entries/marker-button.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAM/D,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MARKER_BUTTON } from "../tags.js";
|
|
2
|
+
import "../element-entry.js";
|
|
3
|
+
import { MbxMarkerButton } from "../elements/marker-button.js";
|
|
4
|
+
//#region src/entries/marker-button.ts
|
|
5
|
+
if (customElements.get("mbx-marker-button") === void 0) customElements.define(MARKER_BUTTON, MbxMarkerButton);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MbxMarkerButton };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=marker-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker-button.js","names":[],"sources":["../../src/entries/marker-button.ts"],"sourcesContent":["/** `@mattebox/player/elements/marker-button`: registers <mbx-marker-button>, and the player with it. */\nimport '../element-entry.js';\nimport { MbxMarkerButton } from '../elements/marker-button.js';\nimport { MARKER_BUTTON } from '../tags.js';\n\nif (customElements.get(MARKER_BUTTON) === undefined)\n customElements.define(MARKER_BUTTON, MbxMarkerButton);\n\nexport { MbxMarkerButton };\n"],"mappings":";;;;AAKA,IAAI,eAAe,IAAA,mBAAiB,MAAM,KAAA,GACxC,eAAe,OAAO,eAAe,eAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import toPropertyKey from "./toPropertyKey.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
|
|
3
3
|
function _defineProperty(e, r, t) {
|
|
4
4
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
5
|
value: t,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "./defineProperty.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/objectSpread2.js
|
|
3
3
|
function ownKeys(e, r) {
|
|
4
4
|
var t = Object.keys(e);
|
|
5
5
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _typeof from "./typeof.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
|
|
3
3
|
function toPrimitive(t, r) {
|
|
4
4
|
if ("object" != _typeof(t) || !t) return t;
|
|
5
5
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _typeof from "./typeof.js";
|
|
2
2
|
import toPrimitive from "./toPrimitive.js";
|
|
3
|
-
//#region \0@oxc-project+runtime@0.
|
|
3
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
|
|
4
4
|
function toPropertyKey(t) {
|
|
5
5
|
var i = toPrimitive(t, "string");
|
|
6
6
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
|
|
2
2
|
function _typeof(o) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { optional } from "./session.js";
|
|
3
3
|
//#region src/controls/chapters.ts
|
|
4
4
|
/** The first chapters track on the video, or null. */
|
|
@@ -5,33 +5,33 @@
|
|
|
5
5
|
* subpath, and the rest have disjoint subpaths, where the rule is moot.
|
|
6
6
|
*/
|
|
7
7
|
const PATHS = {
|
|
8
|
-
play: "M10.
|
|
9
|
-
pause: "M8.
|
|
10
|
-
replay: "M15.
|
|
11
|
-
mute: "M17.
|
|
12
|
-
"volume-low": "M17.
|
|
13
|
-
"volume-high": "M17.
|
|
14
|
-
fullscreen: "M25.
|
|
15
|
-
"fullscreen-exit": "M19.
|
|
16
|
-
settings: "M13.
|
|
17
|
-
music: "M26.
|
|
18
|
-
"closed-captions": "M4.
|
|
19
|
-
"closed-captions-on": "M8
|
|
20
|
-
"lock-closed": "M16
|
|
21
|
-
"seek-backward": "M15.
|
|
22
|
-
"seek-forward": "M16.
|
|
23
|
-
"seek-backward-10": "M16.
|
|
24
|
-
"seek-forward-10": "M15.
|
|
25
|
-
"seek-backward-30": "M16.
|
|
26
|
-
"seek-forward-30": "M15.
|
|
27
|
-
"playback-speed": "M13.
|
|
28
|
-
"picture-in-picture": "M16 15.
|
|
29
|
-
"picture-in-picture-exit": "M5.
|
|
30
|
-
airplay: "M5.
|
|
31
|
-
"airplay-active": "M5.
|
|
32
|
-
chapters: "M16.
|
|
33
|
-
"fast-forward": "M16.
|
|
34
|
-
"fast-backward": "M15.
|
|
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"
|
|
35
35
|
};
|
|
36
36
|
const SVG = "http://www.w3.org/2000/svg";
|
|
37
37
|
/** A glyph, hidden from the accessibility tree: the button it sits in carries the name. */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/controls/markers.ts
|
|
2
|
+
/**
|
|
3
|
+
* Past a blocked range's end by this much, so the playhead does not settle
|
|
4
|
+
* on the end itself and enter the range again: Safari can report a time a
|
|
5
|
+
* hair before the one it was given.
|
|
6
|
+
*/
|
|
7
|
+
const PAST = .1;
|
|
8
|
+
/**
|
|
9
|
+
* Markers over `video`. `emit` reports a change of the list as
|
|
10
|
+
* `markerschange` and a jump over a blocked range as `blocked`.
|
|
11
|
+
*/
|
|
12
|
+
function createMarkers(video, emit) {
|
|
13
|
+
let list = [];
|
|
14
|
+
const within = (time) => list.filter((marker) => marker.start <= time && time < marker.end);
|
|
15
|
+
const guard = () => {
|
|
16
|
+
const blocked = within(video.currentTime).find((marker) => marker.kind === "blocked");
|
|
17
|
+
if (blocked === void 0) return;
|
|
18
|
+
video.currentTime = Math.min(blocked.end + PAST, video.duration || Number.POSITIVE_INFINITY);
|
|
19
|
+
emit("blocked", blocked);
|
|
20
|
+
};
|
|
21
|
+
video.addEventListener("seeking", guard);
|
|
22
|
+
video.addEventListener("timeupdate", guard);
|
|
23
|
+
return {
|
|
24
|
+
get list() {
|
|
25
|
+
return list;
|
|
26
|
+
},
|
|
27
|
+
set(next) {
|
|
28
|
+
list = [...next].sort((a, b) => a.start - b.start);
|
|
29
|
+
emit("markerschange", list);
|
|
30
|
+
guard();
|
|
31
|
+
},
|
|
32
|
+
within
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { createMarkers };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, setChildren, state } from "../dom.js";
|
|
2
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
//#region src/controls/menu.ts
|
|
4
4
|
/**
|
|
5
5
|
* The menu primitive the quality, audio, subtitles and speed menus share: a
|
|
@@ -25,6 +25,12 @@ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.150.0/helpers/es
|
|
|
25
25
|
*/
|
|
26
26
|
/** Air between the popup's top and the picture's. */
|
|
27
27
|
const AIR = 8;
|
|
28
|
+
/**
|
|
29
|
+
* The tallest a popup grows, in pixels: about seven and a half rows, so
|
|
30
|
+
* the half row at the foot says the list goes on. A page sets its own
|
|
31
|
+
* with `--mbx-menu-max-height`.
|
|
32
|
+
*/
|
|
33
|
+
const MAX_HEIGHT = 264;
|
|
28
34
|
/** An item's picture. Decorative: the item's text names it. Loaded when the popup first shows it. */
|
|
29
35
|
function picture(url) {
|
|
30
36
|
const node = el("img", "item-image");
|
|
@@ -44,6 +50,9 @@ function menu(options) {
|
|
|
44
50
|
button.setAttribute("aria-haspopup", "menu");
|
|
45
51
|
button.setAttribute("aria-expanded", "false");
|
|
46
52
|
const popup = el("div", "popup");
|
|
53
|
+
popup.addEventListener("scroll", () => {
|
|
54
|
+
more();
|
|
55
|
+
});
|
|
47
56
|
popup.setAttribute("role", "menu");
|
|
48
57
|
popup.hidden = true;
|
|
49
58
|
let open = false;
|
|
@@ -65,15 +74,25 @@ function menu(options) {
|
|
|
65
74
|
function outside(event) {
|
|
66
75
|
if (!event.composedPath().includes(host)) close();
|
|
67
76
|
}
|
|
68
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* The popup's height: its maximum, or the room above the button if that
|
|
79
|
+
* is less, so the popup never leaves the picture. Its width: the room
|
|
80
|
+
* left of its right edge.
|
|
81
|
+
*/
|
|
69
82
|
function fit() {
|
|
70
83
|
const picture = options.picture();
|
|
71
84
|
if (picture === null) return;
|
|
72
85
|
const room = button.getBoundingClientRect().top - picture.top - AIR;
|
|
73
|
-
|
|
86
|
+
const most = Number.parseFloat(getComputedStyle(host).getPropertyValue("--mbx-menu-max-height")) || MAX_HEIGHT;
|
|
87
|
+
popup.style.maxHeight = `${Math.max(0, Math.floor(Math.min(most, room)))}px`;
|
|
88
|
+
more();
|
|
74
89
|
const wide = host.getBoundingClientRect().right - picture.left - AIR;
|
|
75
90
|
popup.style.maxWidth = `${Math.max(0, Math.floor(wide))}px`;
|
|
76
91
|
}
|
|
92
|
+
/** `more` on the popup while rows wait below its foot, which then fades out. */
|
|
93
|
+
function more() {
|
|
94
|
+
popup.toggleAttribute("more", popup.scrollTop + popup.clientHeight < popup.scrollHeight - 1);
|
|
95
|
+
}
|
|
77
96
|
function clear() {
|
|
78
97
|
for (const item of items()) {
|
|
79
98
|
const handler = handlers.get(item);
|
|
@@ -125,12 +144,13 @@ function menu(options) {
|
|
|
125
144
|
section.setAttribute("aria-label", entry.label);
|
|
126
145
|
section.append(el("div", `section-label ${entry.name}-label`, entry.label));
|
|
127
146
|
}
|
|
128
|
-
for (const [id, text, detail, image] of entry.items) {
|
|
147
|
+
for (const [id, text, detail, image, badges] of entry.items) {
|
|
129
148
|
const choice = item(`item ${entry.name}-item`, text, () => {
|
|
130
149
|
close();
|
|
131
150
|
button.focus();
|
|
132
151
|
entry.onSelect(id);
|
|
133
152
|
});
|
|
153
|
+
for (const badge of badges !== null && badges !== void 0 ? badges : []) choice.append(el("span", "item-badge", badge));
|
|
134
154
|
if (detail !== void 0) choice.append(el("span", "item-detail", detail));
|
|
135
155
|
if (image !== void 0) {
|
|
136
156
|
const [, ...rest] = choice.childNodes;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/controls/native-tracks.ts
|
|
2
|
+
/**
|
|
3
|
+
* The video's `audioTracks` or `textTracks` during a native session, or
|
|
4
|
+
* undefined: an engine session has its own tracks, and Chromium has no
|
|
5
|
+
* `audioTracks` without a flag.
|
|
6
|
+
*/
|
|
7
|
+
function nativeTracks(player, name) {
|
|
8
|
+
var _player$player;
|
|
9
|
+
const session = (_player$player = player.player) === null || _player$player === void 0 ? void 0 : _player$player.session;
|
|
10
|
+
if (session == null || session.engine !== null) return void 0;
|
|
11
|
+
const list = player.video[name];
|
|
12
|
+
return list === void 0 ? void 0 : Array.from(list);
|
|
13
|
+
}
|
|
14
|
+
/** Calls `tick` when the video's list of `name` changes, and answers the unsubscribe. */
|
|
15
|
+
function onNativeTracks(video, name, tick) {
|
|
16
|
+
const list = video[name];
|
|
17
|
+
if (list === void 0) return void 0;
|
|
18
|
+
const events = [
|
|
19
|
+
"change",
|
|
20
|
+
"addtrack",
|
|
21
|
+
"removetrack"
|
|
22
|
+
];
|
|
23
|
+
for (const event of events) list.addEventListener(event, tick);
|
|
24
|
+
return () => {
|
|
25
|
+
for (const event of events) list.removeEventListener(event, tick);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { nativeTracks, onNativeTracks };
|