@mattebox/player 0.10.0 → 0.12.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/announcer.d.ts +6 -3
- package/dist/announcer.d.ts.map +1 -1
- package/dist/announcer.js +17 -14
- package/dist/announcer.js.map +1 -1
- package/dist/cdn/mattebox-player.min.js +3 -3
- package/dist/controls/airplay.js +1 -2
- package/dist/controls/chapters.js +1 -2
- package/dist/controls/cues.js +1 -2
- package/dist/controls/fullscreen.js +1 -2
- package/dist/controls/icons.d.ts +1 -1
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/icons.js +2 -2
- package/dist/controls/icons.js.map +1 -1
- package/dist/controls/markers.d.ts +2 -15
- package/dist/controls/markers.d.ts.map +1 -1
- package/dist/controls/markers.js +1 -2
- package/dist/controls/markers.js.map +1 -1
- package/dist/controls/menu.js +1 -2
- package/dist/controls/native-tracks.d.ts +8 -7
- package/dist/controls/native-tracks.d.ts.map +1 -1
- package/dist/controls/native-tracks.js +1 -2
- package/dist/controls/native-tracks.js.map +1 -1
- package/dist/controls/pip.js +1 -2
- package/dist/controls/quality-names.js +1 -2
- package/dist/controls/ranges.js +1 -2
- package/dist/controls/session.js +1 -2
- package/dist/controls/slider.js +1 -2
- package/dist/controls/time.js +1 -2
- package/dist/controls/track-names.d.ts +3 -2
- package/dist/controls/track-names.d.ts.map +1 -1
- package/dist/controls/track-names.js +5 -5
- package/dist/controls/track-names.js.map +1 -1
- package/dist/dom.js +1 -2
- package/dist/element-entry.d.ts +4 -1
- package/dist/element-entry.d.ts.map +1 -1
- package/dist/element-entry.js +1 -2
- package/dist/element-entry.js.map +1 -1
- package/dist/element.d.ts +134 -5
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +346 -35
- package/dist/element.js.map +1 -1
- package/dist/elements/airplay-button.js +2 -3
- package/dist/elements/airplay-button.js.map +1 -1
- package/dist/elements/audio-menu.d.ts +3 -2
- package/dist/elements/audio-menu.d.ts.map +1 -1
- package/dist/elements/audio-menu.js +18 -12
- package/dist/elements/audio-menu.js.map +1 -1
- package/dist/elements/chapters-menu.d.ts +2 -1
- package/dist/elements/chapters-menu.d.ts.map +1 -1
- package/dist/elements/chapters-menu.js +2 -3
- package/dist/elements/chapters-menu.js.map +1 -1
- package/dist/elements/component.d.ts +9 -0
- package/dist/elements/component.d.ts.map +1 -1
- package/dist/elements/component.js +16 -2
- package/dist/elements/component.js.map +1 -1
- package/dist/elements/control-bar.d.ts.map +1 -1
- package/dist/elements/control-bar.js +9 -8
- package/dist/elements/control-bar.js.map +1 -1
- package/dist/elements/current-time.js +1 -2
- package/dist/elements/drm-badge.js +4 -5
- package/dist/elements/drm-badge.js.map +1 -1
- package/dist/elements/duration.js +1 -2
- package/dist/elements/error-screen.d.ts +9 -0
- package/dist/elements/error-screen.d.ts.map +1 -1
- package/dist/elements/error-screen.js +55 -15
- package/dist/elements/error-screen.js.map +1 -1
- package/dist/elements/fullscreen-button.js +2 -3
- package/dist/elements/fullscreen-button.js.map +1 -1
- package/dist/elements/live-button.js +3 -4
- package/dist/elements/live-button.js.map +1 -1
- package/dist/elements/marker-button.d.ts.map +1 -1
- package/dist/elements/marker-button.js +7 -6
- package/dist/elements/marker-button.js.map +1 -1
- package/dist/elements/menu-element.d.ts +3 -2
- package/dist/elements/menu-element.d.ts.map +1 -1
- package/dist/elements/menu-element.js +3 -4
- package/dist/elements/menu-element.js.map +1 -1
- package/dist/elements/mute-button.js +2 -3
- package/dist/elements/mute-button.js.map +1 -1
- package/dist/elements/pip-button.js +2 -3
- package/dist/elements/pip-button.js.map +1 -1
- package/dist/elements/play-button.d.ts.map +1 -1
- package/dist/elements/play-button.js +9 -12
- package/dist/elements/play-button.js.map +1 -1
- package/dist/elements/quality-menu.d.ts +2 -1
- package/dist/elements/quality-menu.d.ts.map +1 -1
- package/dist/elements/quality-menu.js +3 -4
- package/dist/elements/quality-menu.js.map +1 -1
- package/dist/elements/remaining-time.js +1 -2
- package/dist/elements/scan-button.d.ts.map +1 -1
- package/dist/elements/scan-button.js +2 -3
- package/dist/elements/scan-button.js.map +1 -1
- package/dist/elements/seek-bar.d.ts +2 -0
- package/dist/elements/seek-bar.d.ts.map +1 -1
- package/dist/elements/seek-bar.js +10 -7
- package/dist/elements/seek-bar.js.map +1 -1
- package/dist/elements/shared.d.ts +18 -0
- package/dist/elements/shared.d.ts.map +1 -1
- package/dist/elements/shared.js +17 -11
- package/dist/elements/shared.js.map +1 -1
- package/dist/elements/skip-button.d.ts.map +1 -1
- package/dist/elements/skip-button.js +2 -3
- package/dist/elements/skip-button.js.map +1 -1
- package/dist/elements/spacer.js +1 -2
- package/dist/elements/speed-menu.d.ts +2 -1
- package/dist/elements/speed-menu.d.ts.map +1 -1
- package/dist/elements/speed-menu.js +3 -4
- package/dist/elements/speed-menu.js.map +1 -1
- package/dist/elements/spinner.d.ts +1 -1
- package/dist/elements/spinner.js +2 -4
- package/dist/elements/spinner.js.map +1 -1
- package/dist/elements/start-button.d.ts.map +1 -1
- package/dist/elements/start-button.js +5 -7
- package/dist/elements/start-button.js.map +1 -1
- package/dist/elements/subtitles-menu.d.ts +2 -1
- package/dist/elements/subtitles-menu.d.ts.map +1 -1
- package/dist/elements/subtitles-menu.js +51 -22
- package/dist/elements/subtitles-menu.js.map +1 -1
- package/dist/elements/time-element.js +1 -2
- package/dist/elements/title.d.ts.map +1 -1
- package/dist/elements/title.js +16 -7
- package/dist/elements/title.js.map +1 -1
- package/dist/elements/video-menu.d.ts +24 -0
- package/dist/elements/video-menu.d.ts.map +1 -0
- package/dist/elements/video-menu.js +146 -0
- package/dist/elements/video-menu.js.map +1 -0
- package/dist/elements/volume-slider.js +2 -3
- package/dist/elements/volume-slider.js.map +1 -1
- package/dist/elements/volume.js +1 -2
- package/dist/entries/airplay-button.js +1 -2
- package/dist/entries/audio-menu.js +1 -2
- package/dist/entries/chapters-menu.js +1 -2
- package/dist/entries/control-bar.js +1 -2
- package/dist/entries/current-time.js +1 -2
- package/dist/entries/drm-badge.js +1 -2
- package/dist/entries/duration.js +1 -2
- package/dist/entries/error-screen.js +1 -2
- package/dist/entries/fullscreen-button.js +1 -2
- package/dist/entries/live-button.js +1 -2
- package/dist/entries/marker-button.js +1 -2
- package/dist/entries/mute-button.js +1 -2
- package/dist/entries/pip-button.js +1 -2
- package/dist/entries/play-button.js +1 -2
- package/dist/entries/quality-menu.js +1 -2
- package/dist/entries/remaining-time.js +1 -2
- package/dist/entries/scan-button.js +1 -2
- package/dist/entries/seek-bar.js +1 -2
- package/dist/entries/skip-button.js +1 -2
- package/dist/entries/spacer.js +1 -2
- package/dist/entries/speed-menu.js +1 -2
- package/dist/entries/spinner.js +1 -2
- package/dist/entries/start-button.js +1 -2
- package/dist/entries/subtitles-menu.js +1 -2
- package/dist/entries/title.js +1 -2
- package/dist/entries/video-menu.d.ts +5 -0
- package/dist/entries/video-menu.d.ts.map +1 -0
- package/dist/entries/video-menu.js +8 -0
- package/dist/entries/video-menu.js.map +1 -0
- package/dist/entries/volume-slider.js +1 -2
- package/dist/entries/volume.js +1 -2
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/asyncToGenerator.js +1 -2
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.js +1 -2
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/objectSpread2.js +1 -2
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.js +1 -2
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.js +1 -2
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.js +1 -2
- package/dist/es2015/announcer.js +18 -15
- package/dist/es2015/controls/airplay.js +1 -2
- package/dist/es2015/controls/chapters.js +2 -3
- package/dist/es2015/controls/cues.js +1 -2
- package/dist/es2015/controls/fullscreen.js +1 -2
- package/dist/es2015/controls/icons.js +2 -2
- package/dist/es2015/controls/markers.js +1 -2
- package/dist/es2015/controls/menu.js +2 -3
- package/dist/es2015/controls/native-tracks.js +1 -2
- package/dist/es2015/controls/pip.js +1 -2
- package/dist/es2015/controls/quality-names.js +1 -2
- package/dist/es2015/controls/ranges.js +1 -2
- package/dist/es2015/controls/session.js +1 -2
- package/dist/es2015/controls/slider.js +1 -2
- package/dist/es2015/controls/time.js +1 -2
- package/dist/es2015/controls/track-names.js +5 -5
- package/dist/es2015/dom.js +1 -2
- package/dist/es2015/element-entry.js +1 -2
- package/dist/es2015/element.js +402 -85
- package/dist/es2015/elements/airplay-button.js +2 -4
- package/dist/es2015/elements/audio-menu.js +18 -16
- package/dist/es2015/elements/chapters-menu.js +2 -3
- package/dist/es2015/elements/component.js +18 -2
- package/dist/es2015/elements/control-bar.js +9 -8
- package/dist/es2015/elements/current-time.js +1 -2
- package/dist/es2015/elements/drm-badge.js +5 -7
- package/dist/es2015/elements/duration.js +1 -2
- package/dist/es2015/elements/error-screen.js +58 -16
- package/dist/es2015/elements/fullscreen-button.js +2 -4
- package/dist/es2015/elements/live-button.js +3 -5
- package/dist/es2015/elements/marker-button.js +8 -7
- package/dist/es2015/elements/menu-element.js +3 -8
- package/dist/es2015/elements/mute-button.js +3 -4
- package/dist/es2015/elements/pip-button.js +2 -4
- package/dist/es2015/elements/play-button.js +9 -13
- package/dist/es2015/elements/quality-menu.js +4 -5
- package/dist/es2015/elements/remaining-time.js +1 -2
- package/dist/es2015/elements/scan-button.js +3 -4
- package/dist/es2015/elements/seek-bar.js +12 -11
- package/dist/es2015/elements/shared.js +17 -11
- package/dist/es2015/elements/skip-button.js +2 -4
- package/dist/es2015/elements/spacer.js +1 -2
- package/dist/es2015/elements/speed-menu.js +4 -5
- package/dist/es2015/elements/spinner.js +2 -5
- package/dist/es2015/elements/start-button.js +6 -8
- package/dist/es2015/elements/subtitles-menu.js +53 -31
- package/dist/es2015/elements/time-element.js +1 -2
- package/dist/es2015/elements/title.js +17 -8
- package/dist/es2015/elements/video-menu.js +152 -0
- package/dist/es2015/elements/volume-slider.js +3 -4
- package/dist/es2015/elements/volume.js +1 -2
- package/dist/es2015/entries/airplay-button.js +1 -2
- package/dist/es2015/entries/audio-menu.js +1 -2
- package/dist/es2015/entries/chapters-menu.js +1 -2
- package/dist/es2015/entries/control-bar.js +1 -2
- package/dist/es2015/entries/current-time.js +1 -2
- package/dist/es2015/entries/drm-badge.js +1 -2
- package/dist/es2015/entries/duration.js +1 -2
- package/dist/es2015/entries/error-screen.js +1 -2
- package/dist/es2015/entries/fullscreen-button.js +1 -2
- package/dist/es2015/entries/live-button.js +1 -2
- package/dist/es2015/entries/marker-button.js +1 -2
- package/dist/es2015/entries/mute-button.js +1 -2
- package/dist/es2015/entries/pip-button.js +1 -2
- package/dist/es2015/entries/play-button.js +1 -2
- package/dist/es2015/entries/quality-menu.js +1 -2
- package/dist/es2015/entries/remaining-time.js +1 -2
- package/dist/es2015/entries/scan-button.js +1 -2
- package/dist/es2015/entries/seek-bar.js +1 -2
- package/dist/es2015/entries/skip-button.js +1 -2
- package/dist/es2015/entries/spacer.js +1 -2
- package/dist/es2015/entries/speed-menu.js +1 -2
- package/dist/es2015/entries/spinner.js +1 -2
- package/dist/es2015/entries/start-button.js +1 -2
- package/dist/es2015/entries/subtitles-menu.js +1 -2
- package/dist/es2015/entries/title.js +1 -2
- package/dist/es2015/entries/video-menu.js +6 -0
- package/dist/es2015/entries/volume-slider.js +1 -2
- package/dist/es2015/entries/volume.js +1 -2
- package/dist/es2015/host.js +1 -2
- package/dist/es2015/ids.js +33 -0
- package/dist/es2015/index.js +4 -1
- package/dist/es2015/labels.js +1 -2
- package/dist/es2015/locales/ar.js +75 -0
- package/dist/es2015/locales/ca.js +75 -0
- package/dist/es2015/locales/de.js +75 -0
- package/dist/es2015/locales/es.js +75 -0
- package/dist/es2015/locales/fr.js +75 -0
- package/dist/es2015/locales/hi.js +75 -0
- package/dist/es2015/locales/it.js +75 -0
- package/dist/es2015/locales/ja.js +75 -0
- package/dist/es2015/locales/ko.js +75 -0
- package/dist/es2015/locales/pt.js +75 -0
- package/dist/es2015/locales/zh.js +75 -0
- package/dist/es2015/locales.js +61 -0
- package/dist/es2015/namespaces.js +1 -2
- package/dist/es2015/presets.js +2 -3
- package/dist/es2015/style.js +1 -2
- package/dist/es2015/surface.js +12 -4
- package/dist/es2015/tags.js +3 -3
- package/dist/es2015/text.js +15 -0
- package/dist/es2015/trackers.js +43 -0
- package/dist/es2015/video-sources.js +127 -0
- package/dist/host.d.ts +49 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +1 -2
- package/dist/host.js.map +1 -1
- package/dist/ids.d.ts +19 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +34 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/labels.js +1 -2
- package/dist/locales/ar.d.ts +75 -0
- package/dist/locales/ar.d.ts.map +1 -0
- package/dist/locales/ar.js +77 -0
- package/dist/locales/ar.js.map +1 -0
- package/dist/locales/ca.d.ts +75 -0
- package/dist/locales/ca.d.ts.map +1 -0
- package/dist/locales/ca.js +77 -0
- package/dist/locales/ca.js.map +1 -0
- package/dist/locales/de.d.ts +75 -0
- package/dist/locales/de.d.ts.map +1 -0
- package/dist/locales/de.js +77 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/es.d.ts +75 -0
- package/dist/locales/es.d.ts.map +1 -0
- package/dist/locales/es.js +77 -0
- package/dist/locales/es.js.map +1 -0
- package/dist/locales/fr.d.ts +75 -0
- package/dist/locales/fr.d.ts.map +1 -0
- package/dist/locales/fr.js +77 -0
- package/dist/locales/fr.js.map +1 -0
- package/dist/locales/hi.d.ts +75 -0
- package/dist/locales/hi.d.ts.map +1 -0
- package/dist/locales/hi.js +77 -0
- package/dist/locales/hi.js.map +1 -0
- package/dist/locales/it.d.ts +75 -0
- package/dist/locales/it.d.ts.map +1 -0
- package/dist/locales/it.js +77 -0
- package/dist/locales/it.js.map +1 -0
- package/dist/locales/ja.d.ts +75 -0
- package/dist/locales/ja.d.ts.map +1 -0
- package/dist/locales/ja.js +77 -0
- package/dist/locales/ja.js.map +1 -0
- package/dist/locales/ko.d.ts +75 -0
- package/dist/locales/ko.d.ts.map +1 -0
- package/dist/locales/ko.js +77 -0
- package/dist/locales/ko.js.map +1 -0
- package/dist/locales/pt.d.ts +75 -0
- package/dist/locales/pt.d.ts.map +1 -0
- package/dist/locales/pt.js +77 -0
- package/dist/locales/pt.js.map +1 -0
- package/dist/locales/zh.d.ts +75 -0
- package/dist/locales/zh.d.ts.map +1 -0
- package/dist/locales/zh.js +77 -0
- package/dist/locales/zh.js.map +1 -0
- package/dist/locales.d.ts +27 -0
- package/dist/locales.d.ts.map +1 -0
- package/dist/locales.js +48 -0
- package/dist/locales.js.map +1 -0
- package/dist/messages.d.ts +167 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/namespaces.js +1 -2
- package/dist/presets.js +1 -2
- package/dist/style.js +1 -2
- package/dist/surface.d.ts +4 -1
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +12 -4
- package/dist/surface.js.map +1 -1
- package/dist/tags.d.ts +1 -0
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +3 -3
- package/dist/tags.js.map +1 -1
- package/dist/text.d.ts +14 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +16 -0
- package/dist/text.js.map +1 -0
- package/dist/trackers.d.ts +18 -0
- package/dist/trackers.d.ts.map +1 -0
- package/dist/trackers.js +45 -0
- package/dist/trackers.js.map +1 -0
- package/dist/video-sources.d.ts +48 -0
- package/dist/video-sources.d.ts.map +1 -0
- package/dist/video-sources.js +133 -0
- package/dist/video-sources.js.map +1 -0
- package/package.json +11 -3
package/dist/element.d.ts
CHANGED
|
@@ -17,11 +17,14 @@
|
|
|
17
17
|
* them into runtime helpers, and the emit check bans helpers. Statics are
|
|
18
18
|
* getters and instance state is declared, then assigned in the constructor.
|
|
19
19
|
*/
|
|
20
|
-
import type { Handler, Player, PlayerError, Session, Source } from '@mattebox/player-core';
|
|
20
|
+
import type { Connector, Handler, Player, PlayerError, Programme, ProgrammeSource, Session, Source, SourceVideoTrack } from '@mattebox/player-core';
|
|
21
21
|
import type { KernelConfig, Mattebox, Stage } from 'mattebox';
|
|
22
22
|
import type { AttachEmeOptions } from 'mattebox/eme';
|
|
23
23
|
import type { Marker, Markers } from './controls/markers.js';
|
|
24
|
-
import type { PlayerHost } from './host.js';
|
|
24
|
+
import type { Block, PlayerHost } from './host.js';
|
|
25
|
+
import type { LocaleSource } from './locales.js';
|
|
26
|
+
import type { Messages } from './messages.js';
|
|
27
|
+
import type { Tracker, Trackers } from './trackers.js';
|
|
25
28
|
/**
|
|
26
29
|
* What the element dispatches. `error` is also a standard DOM event name, so
|
|
27
30
|
* without these overloads a listener on it is typed as `ErrorEvent` and the
|
|
@@ -36,6 +39,12 @@ export interface MatteboxPlayerEventMap {
|
|
|
36
39
|
markerschange: CustomEvent<readonly Marker[]>;
|
|
37
40
|
/** Playback reached a blocked range and moved past it. */
|
|
38
41
|
blocked: CustomEvent<Marker>;
|
|
42
|
+
/** The page called `block()` or `unblock()`, or a new source cleared the block: the block, or null. */
|
|
43
|
+
blockchange: CustomEvent<Block | null>;
|
|
44
|
+
/** A load resolved what it plays, before the session: the programme, or null at unload. */
|
|
45
|
+
programmechange: CustomEvent<Programme | null>;
|
|
46
|
+
/** A tracker was added, removed, started or stopped: the trackers. */
|
|
47
|
+
trackerschange: CustomEvent<readonly Tracker[]>;
|
|
39
48
|
}
|
|
40
49
|
export interface MatteboxPlayerElement {
|
|
41
50
|
addEventListener<K extends keyof MatteboxPlayerEventMap>(type: K, listener: (this: MatteboxPlayerElement, event: MatteboxPlayerEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -63,6 +72,12 @@ export interface MatteboxPlayerOptions {
|
|
|
63
72
|
* with `handlers`, which carry their own.
|
|
64
73
|
*/
|
|
65
74
|
readonly drm?: AttachEmeOptions;
|
|
75
|
+
/**
|
|
76
|
+
* One per source type, such as `srgssr/urn`: a source of that type is a
|
|
77
|
+
* programme id, or data you give, which the connector resolves to what
|
|
78
|
+
* plays. Kept with `handlers`.
|
|
79
|
+
*/
|
|
80
|
+
readonly connectors?: readonly Connector[];
|
|
66
81
|
}
|
|
67
82
|
/**
|
|
68
83
|
* The interface above merges only `addEventListener` and `removeEventListener`
|
|
@@ -72,6 +87,14 @@ export interface MatteboxPlayerOptions {
|
|
|
72
87
|
*/
|
|
73
88
|
export declare class MatteboxPlayerElement extends HTMLElement implements PlayerHost {
|
|
74
89
|
static get observedAttributes(): readonly string[];
|
|
90
|
+
/**
|
|
91
|
+
* Registers the words of a language for every player on the page. Each
|
|
92
|
+
* source is a set of words or a function that loads one, which runs only
|
|
93
|
+
* when a player shows that language. Later sources go over earlier ones,
|
|
94
|
+
* so a page changes a shipped word by registering its own after it.
|
|
95
|
+
* Players that show the language take the new words at once.
|
|
96
|
+
*/
|
|
97
|
+
static addLocale(language: string, ...sources: readonly LocaleSource[]): void;
|
|
75
98
|
/**
|
|
76
99
|
* Registers the element once, and records the stages markup-only pages
|
|
77
100
|
* get. The controls register through their own entries, the package's
|
|
@@ -86,6 +109,14 @@ export declare class MatteboxPlayerElement extends HTMLElement implements Player
|
|
|
86
109
|
private focusable;
|
|
87
110
|
private readonly surface;
|
|
88
111
|
private readonly voice;
|
|
112
|
+
/** The words of the language shown, empty for English. */
|
|
113
|
+
private words;
|
|
114
|
+
/** The language tag the player resolved, or empty without one. */
|
|
115
|
+
private shown;
|
|
116
|
+
/** Bumped on every resolution, so a slow loader does not win over a later choice. */
|
|
117
|
+
private wordsEpoch;
|
|
118
|
+
/** Ends the watch on registrations and on the page's `lang`. */
|
|
119
|
+
private unwatch;
|
|
89
120
|
/** Runs out when the video has waited `LOADING_MS`. */
|
|
90
121
|
private slow;
|
|
91
122
|
/** The audio track the live region last saw, so it says only a change. Undefined before the first play. */
|
|
@@ -101,6 +132,7 @@ export declare class MatteboxPlayerElement extends HTMLElement implements Player
|
|
|
101
132
|
private given;
|
|
102
133
|
/** The sources the page set from script, or null. */
|
|
103
134
|
private list;
|
|
135
|
+
private readonly tracking;
|
|
104
136
|
/** The sources of the last run, as text: what tells a new `<source>` child from the ones already tried. */
|
|
105
137
|
private tried;
|
|
106
138
|
/** The options this element was constructed with, or null for the ones `define()` recorded. */
|
|
@@ -108,6 +140,8 @@ export declare class MatteboxPlayerElement extends HTMLElement implements Player
|
|
|
108
140
|
private core;
|
|
109
141
|
private current;
|
|
110
142
|
private failure;
|
|
143
|
+
/** What `block()` set, or null. */
|
|
144
|
+
private stop;
|
|
111
145
|
/** Whether an attribute change is the element's own reflection, which must not write back to the video. */
|
|
112
146
|
private reflecting;
|
|
113
147
|
/** Watches the element's box for `layout`, while connected. */
|
|
@@ -116,13 +150,23 @@ export declare class MatteboxPlayerElement extends HTMLElement implements Player
|
|
|
116
150
|
private fixed;
|
|
117
151
|
/** The video has played once since its source was set: `started`, which tells a first play from a pause. */
|
|
118
152
|
private started;
|
|
119
|
-
/** The video waits for data: `waiting`, set on `waiting
|
|
153
|
+
/** The video waits for data: `waiting`, set on `waiting`, cleared once it can play. */
|
|
120
154
|
private waiting;
|
|
121
155
|
private offs;
|
|
122
156
|
/** Everything the element does to the player runs here, so it runs in order. */
|
|
123
157
|
private queue;
|
|
124
158
|
/** Whether a run is queued and not yet started, so a burst of changes loads once. */
|
|
125
159
|
private pending;
|
|
160
|
+
/** The source the versions of `videoSources` belong to: the one that played before a switch. */
|
|
161
|
+
private original;
|
|
162
|
+
/** The version that plays, or null for the programme itself. */
|
|
163
|
+
private version;
|
|
164
|
+
/** True while a version loads, so its `sourcechange` keeps the programme. */
|
|
165
|
+
private switching;
|
|
166
|
+
/** The source `switchSource` loaded, which a retry loads again, or null. */
|
|
167
|
+
private switched;
|
|
168
|
+
/** Ends the hold of a switch: the poster and `switching` go back. Null without one. */
|
|
169
|
+
private held;
|
|
126
170
|
constructor(options?: MatteboxPlayerOptions);
|
|
127
171
|
/** The media element. Everything the browser already does is here. */
|
|
128
172
|
get video(): HTMLVideoElement;
|
|
@@ -133,8 +177,58 @@ export declare class MatteboxPlayerElement extends HTMLElement implements Player
|
|
|
133
177
|
* over them, and they win over the `<source>` children. Setting them
|
|
134
178
|
* loads, and null returns to the children.
|
|
135
179
|
*/
|
|
136
|
-
get sources(): readonly
|
|
137
|
-
set sources(value: readonly
|
|
180
|
+
get sources(): readonly ProgrammeSource[] | null;
|
|
181
|
+
set sources(value: readonly ProgrammeSource[] | null);
|
|
182
|
+
/**
|
|
183
|
+
* The language the page chose for this player, which wins over the
|
|
184
|
+
* nearest `lang` attribute. Empty follows `lang`. Setting it changes the
|
|
185
|
+
* words of every control at once.
|
|
186
|
+
*/
|
|
187
|
+
get language(): string;
|
|
188
|
+
set language(value: string);
|
|
189
|
+
/** The language tag the words come from: `language`, else the nearest `lang`. Empty without either. */
|
|
190
|
+
get locale(): string;
|
|
191
|
+
/** The word of `id` in the player's language, or undefined, where the control's English applies. */
|
|
192
|
+
message(id: keyof Messages): string | undefined;
|
|
193
|
+
/** Follows registrations and the document's `lang` until disconnect. */
|
|
194
|
+
private watchLanguage;
|
|
195
|
+
/** Resolves the language, takes its words, and tells the controls with `localechange`. */
|
|
196
|
+
private relocale;
|
|
197
|
+
/**
|
|
198
|
+
* Loads the sources again, in the order a load reads them: the `src`
|
|
199
|
+
* attribute, the `sources` property, then the `<source>` children. The
|
|
200
|
+
* error screens' Retry calls it. On a version of `videoSources`, it
|
|
201
|
+
* loads that version again.
|
|
202
|
+
*/
|
|
203
|
+
retry(): void;
|
|
204
|
+
/**
|
|
205
|
+
* Loads `source` in place of the one that plays, from the same position
|
|
206
|
+
* and in the same play state, with the same audio and subtitle choice.
|
|
207
|
+
* Use it for the same programme at another URL, such as its HLS and
|
|
208
|
+
* DASH manifests. The last frame and the controls hold until the new
|
|
209
|
+
* load shows a frame there. The markers stay, and the versions are the
|
|
210
|
+
* ones `source` names. A new `src`, `sources` or `<source>` load
|
|
211
|
+
* replaces it.
|
|
212
|
+
*/
|
|
213
|
+
switchSource(source: Source): void;
|
|
214
|
+
/** The other versions of the picture the source names at their own URLs, for the video menu. */
|
|
215
|
+
get videoSources(): readonly SourceVideoTrack[];
|
|
216
|
+
/** The version of `videoSources` that plays, or null for the source itself. */
|
|
217
|
+
get videoSource(): SourceVideoTrack | null;
|
|
218
|
+
/**
|
|
219
|
+
* Plays a version of `videoSources`, or the source itself for null, from
|
|
220
|
+
* the same position and in the same play state, with the same audio and
|
|
221
|
+
* subtitle choice. A live source joins the version at its live edge.
|
|
222
|
+
* Fires `videosourcechange`.
|
|
223
|
+
*/
|
|
224
|
+
selectVideoSource(track: SourceVideoTrack | null): void;
|
|
225
|
+
/**
|
|
226
|
+
* Loads `source` under the programme that plays, and puts the position,
|
|
227
|
+
* play state and tracks back. With `hold`, the last frame stays as the
|
|
228
|
+
* poster and the player carries `switching`, the play state from
|
|
229
|
+
* before, so the controls show that state through the load.
|
|
230
|
+
*/
|
|
231
|
+
private swap;
|
|
138
232
|
/** The core, or null until the first source has been set up: resolving a preset is asynchronous. */
|
|
139
233
|
get player(): Player | null;
|
|
140
234
|
/** The engine feeding the video, or null for a native session and before the first load. */
|
|
@@ -146,6 +240,41 @@ export declare class MatteboxPlayerElement extends HTMLElement implements Player
|
|
|
146
240
|
* after a source that failed while the page was still loading.
|
|
147
241
|
*/
|
|
148
242
|
get error(): PlayerError | null;
|
|
243
|
+
/**
|
|
244
|
+
* Shows why the programme does not play, in place of the video, and
|
|
245
|
+
* stops the load: the reason the page's content API gave, such as a
|
|
246
|
+
* geographic or an age restriction. The error screen shows the title,
|
|
247
|
+
* else "Not available", and the message, with no retry. Each text can
|
|
248
|
+
* be given by language tag, and follows the player's language. A new
|
|
249
|
+
* `src` or `sources` clears it. Fires `blockchange`.
|
|
250
|
+
*/
|
|
251
|
+
block(block: Block): void;
|
|
252
|
+
/** Shows the block, for `block()` and for a programme a connector blocked, which loaded nothing. */
|
|
253
|
+
private refuse;
|
|
254
|
+
/** Removes the block. Nothing plays until a source loads: set one, or call `retry()`. */
|
|
255
|
+
unblock(): void;
|
|
256
|
+
/** What `block()` set, or null. */
|
|
257
|
+
get blocked(): Block | null;
|
|
258
|
+
/**
|
|
259
|
+
* What the current load resolved to: the sources, and what a connector
|
|
260
|
+
* said of the programme. Null before a load and after an unload.
|
|
261
|
+
*/
|
|
262
|
+
get programme(): Programme | null;
|
|
263
|
+
/**
|
|
264
|
+
* The page's trackers. Each starts at every programme and stops at its
|
|
265
|
+
* end; one added or removed during a programme starts or stops at once.
|
|
266
|
+
*/
|
|
267
|
+
get trackers(): Trackers;
|
|
268
|
+
/**
|
|
269
|
+
* Applies what the load resolved, before any session: the markers, the
|
|
270
|
+
* poster, the block. The page's own `poster` and markers set after the
|
|
271
|
+
* source win. Then the trackers start on the programme.
|
|
272
|
+
*/
|
|
273
|
+
private programmed;
|
|
274
|
+
/** A block's title and message in the player's language: the title defaults to the `blocked` word. */
|
|
275
|
+
private blockWords;
|
|
276
|
+
/** Puts the block on the row under the video, under native controls. */
|
|
277
|
+
private showBlock;
|
|
149
278
|
connectedCallback(): void;
|
|
150
279
|
/** Sets `layout` from the element's box, unless the page fixed it. */
|
|
151
280
|
private measure;
|
package/dist/element.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAAA;;;;;;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