eb-player 2.0.20 → 2.0.21
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/build/ebplayer.bundle.js +586 -138
- package/dist/build/ebplayer.bundle.js.map +1 -1
- package/dist/build/types/src/core/command-handler.d.ts +50 -0
- package/dist/build/types/src/core/command-handler.d.ts.map +1 -0
- package/dist/build/types/src/core/config.d.ts +187 -0
- package/dist/build/types/src/core/config.d.ts.map +1 -0
- package/dist/build/types/src/core/engine-state-sync.d.ts +38 -0
- package/dist/build/types/src/core/engine-state-sync.d.ts.map +1 -0
- package/dist/build/types/src/core/event-bus.d.ts +91 -0
- package/dist/build/types/src/core/event-bus.d.ts.map +1 -0
- package/dist/build/types/src/core/fsm.d.ts +30 -0
- package/dist/build/types/src/core/fsm.d.ts.map +1 -0
- package/dist/build/types/src/core/i18n.d.ts +51 -0
- package/dist/build/types/src/core/i18n.d.ts.map +1 -0
- package/dist/build/types/src/core/index.d.ts +23 -0
- package/dist/build/types/src/core/index.d.ts.map +1 -0
- package/dist/build/types/src/core/lifecycle.d.ts +96 -0
- package/dist/build/types/src/core/lifecycle.d.ts.map +1 -0
- package/dist/build/types/src/core/player-state.d.ts +15 -0
- package/dist/build/types/src/core/player-state.d.ts.map +1 -0
- package/dist/build/types/src/core/types.d.ts +85 -0
- package/dist/build/types/src/core/types.d.ts.map +1 -0
- package/dist/build/types/src/eb-player-standalone.d.ts +23 -0
- package/dist/build/types/src/eb-player-standalone.d.ts.map +1 -0
- package/dist/build/types/src/eb-player.d.ts +56 -0
- package/dist/build/types/src/eb-player.d.ts.map +1 -0
- package/dist/build/types/src/engines/abr/dash.d.ts +56 -0
- package/dist/build/types/src/engines/abr/dash.d.ts.map +1 -0
- package/dist/build/types/src/engines/abr/hls.d.ts +105 -0
- package/dist/build/types/src/engines/abr/hls.d.ts.map +1 -0
- package/dist/build/types/src/engines/base-engine.d.ts +72 -0
- package/dist/build/types/src/engines/base-engine.d.ts.map +1 -0
- package/dist/build/types/src/engines/cdn-loader.d.ts +20 -0
- package/dist/build/types/src/engines/cdn-loader.d.ts.map +1 -0
- package/dist/build/types/src/engines/cdn-token-manager.d.ts +137 -0
- package/dist/build/types/src/engines/cdn-token-manager.d.ts.map +1 -0
- package/dist/build/types/src/engines/dash.d.ts +95 -0
- package/dist/build/types/src/engines/dash.d.ts.map +1 -0
- package/dist/build/types/src/engines/drm.d.ts +54 -0
- package/dist/build/types/src/engines/drm.d.ts.map +1 -0
- package/dist/build/types/src/engines/hls-discontinuity-patch.d.ts +43 -0
- package/dist/build/types/src/engines/hls-discontinuity-patch.d.ts.map +1 -0
- package/dist/build/types/src/engines/hls.d.ts +53 -0
- package/dist/build/types/src/engines/hls.d.ts.map +1 -0
- package/dist/build/types/src/engines/index.d.ts +26 -0
- package/dist/build/types/src/engines/index.d.ts.map +1 -0
- package/dist/build/types/src/engines/ios/hls.d.ts +20 -0
- package/dist/build/types/src/engines/ios/hls.d.ts.map +1 -0
- package/dist/build/types/src/engines/poster/hls.d.ts +35 -0
- package/dist/build/types/src/engines/poster/hls.d.ts.map +1 -0
- package/dist/build/types/src/engines/retry/dash.d.ts +51 -0
- package/dist/build/types/src/engines/retry/dash.d.ts.map +1 -0
- package/dist/build/types/src/engines/retry/hls.d.ts +47 -0
- package/dist/build/types/src/engines/retry/hls.d.ts.map +1 -0
- package/dist/build/types/src/engines/snapshot/dash.d.ts +55 -0
- package/dist/build/types/src/engines/snapshot/dash.d.ts.map +1 -0
- package/dist/build/types/src/engines/snapshot/hls.d.ts +118 -0
- package/dist/build/types/src/engines/snapshot/hls.d.ts.map +1 -0
- package/dist/build/types/src/engines/stall-watchdog.d.ts +41 -0
- package/dist/build/types/src/engines/stall-watchdog.d.ts.map +1 -0
- package/dist/build/types/src/integrations/ads-manager.d.ts +79 -0
- package/dist/build/types/src/integrations/ads-manager.d.ts.map +1 -0
- package/dist/build/types/src/integrations/chromecast-manager.d.ts +50 -0
- package/dist/build/types/src/integrations/chromecast-manager.d.ts.map +1 -0
- package/dist/build/types/src/integrations/epg-manager.d.ts +22 -0
- package/dist/build/types/src/integrations/epg-manager.d.ts.map +1 -0
- package/dist/build/types/src/integrations/index.d.ts +7 -0
- package/dist/build/types/src/integrations/index.d.ts.map +1 -0
- package/dist/build/types/src/integrations/intro-stream-manager.d.ts +62 -0
- package/dist/build/types/src/integrations/intro-stream-manager.d.ts.map +1 -0
- package/dist/build/types/src/integrations/p2p-manager.d.ts +42 -0
- package/dist/build/types/src/integrations/p2p-manager.d.ts.map +1 -0
- package/dist/build/types/src/integrations/playlist-manager.d.ts +21 -0
- package/dist/build/types/src/integrations/playlist-manager.d.ts.map +1 -0
- package/dist/build/types/src/skin/bars/bottom-bar.d.ts +16 -0
- package/dist/build/types/src/skin/bars/bottom-bar.d.ts.map +1 -0
- package/dist/build/types/src/skin/bars/middle-bar.d.ts +16 -0
- package/dist/build/types/src/skin/bars/middle-bar.d.ts.map +1 -0
- package/dist/build/types/src/skin/bars/top-bar.d.ts +15 -0
- package/dist/build/types/src/skin/bars/top-bar.d.ts.map +1 -0
- package/dist/build/types/src/skin/base-component.d.ts +69 -0
- package/dist/build/types/src/skin/base-component.d.ts.map +1 -0
- package/dist/build/types/src/skin/brand/forja-playlist-bar.d.ts +15 -0
- package/dist/build/types/src/skin/brand/forja-playlist-bar.d.ts.map +1 -0
- package/dist/build/types/src/skin/brand/snrt-radio-carousel.d.ts +16 -0
- package/dist/build/types/src/skin/brand/snrt-radio-carousel.d.ts.map +1 -0
- package/dist/build/types/src/skin/component-registry.d.ts +16 -0
- package/dist/build/types/src/skin/component-registry.d.ts.map +1 -0
- package/dist/build/types/src/skin/controllers/auto-hide.d.ts +27 -0
- package/dist/build/types/src/skin/controllers/auto-hide.d.ts.map +1 -0
- package/dist/build/types/src/skin/controllers/keyboard.d.ts +29 -0
- package/dist/build/types/src/skin/controllers/keyboard.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/cast-button.d.ts +15 -0
- package/dist/build/types/src/skin/controls/cast-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/channel-name.d.ts +16 -0
- package/dist/build/types/src/skin/controls/channel-name.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/forward-button.d.ts +15 -0
- package/dist/build/types/src/skin/controls/forward-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/fullscreen-button.d.ts +30 -0
- package/dist/build/types/src/skin/controls/fullscreen-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/info-button.d.ts +10 -0
- package/dist/build/types/src/skin/controls/info-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/live-sync-button.d.ts +20 -0
- package/dist/build/types/src/skin/controls/live-sync-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/pip-button.d.ts +21 -0
- package/dist/build/types/src/skin/controls/pip-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/play-pause-button.d.ts +14 -0
- package/dist/build/types/src/skin/controls/play-pause-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/rewind-button.d.ts +15 -0
- package/dist/build/types/src/skin/controls/rewind-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/seekbar.d.ts +48 -0
- package/dist/build/types/src/skin/controls/seekbar.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/settings-panel.d.ts +53 -0
- package/dist/build/types/src/skin/controls/settings-panel.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/share-button.d.ts +11 -0
- package/dist/build/types/src/skin/controls/share-button.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/time-display.d.ts +19 -0
- package/dist/build/types/src/skin/controls/time-display.d.ts.map +1 -0
- package/dist/build/types/src/skin/controls/volume-control.d.ts +21 -0
- package/dist/build/types/src/skin/controls/volume-control.d.ts.map +1 -0
- package/dist/build/types/src/skin/icons/icons-modern.d.ts +10 -0
- package/dist/build/types/src/skin/icons/icons-modern.d.ts.map +1 -0
- package/dist/build/types/src/skin/icons/icons.d.ts +10 -0
- package/dist/build/types/src/skin/icons/icons.d.ts.map +1 -0
- package/dist/build/types/src/skin/icons/sprite.d.ts +39 -0
- package/dist/build/types/src/skin/icons/sprite.d.ts.map +1 -0
- package/dist/build/types/src/skin/index.d.ts +24 -0
- package/dist/build/types/src/skin/index.d.ts.map +1 -0
- package/dist/build/types/src/skin/overlays/error-message.d.ts +14 -0
- package/dist/build/types/src/skin/overlays/error-message.d.ts.map +1 -0
- package/dist/build/types/src/skin/overlays/info-overlay.d.ts +15 -0
- package/dist/build/types/src/skin/overlays/info-overlay.d.ts.map +1 -0
- package/dist/build/types/src/skin/overlays/loading-spinner.d.ts +17 -0
- package/dist/build/types/src/skin/overlays/loading-spinner.d.ts.map +1 -0
- package/dist/build/types/src/skin/overlays/preroll-overlay.d.ts +39 -0
- package/dist/build/types/src/skin/overlays/preroll-overlay.d.ts.map +1 -0
- package/dist/build/types/src/skin/overlays/socials-overlay.d.ts +17 -0
- package/dist/build/types/src/skin/overlays/socials-overlay.d.ts.map +1 -0
- package/dist/build/types/src/skin/overlays/toast-notification.d.ts +18 -0
- package/dist/build/types/src/skin/overlays/toast-notification.d.ts.map +1 -0
- package/dist/build/types/src/skin/skin-root.d.ts +88 -0
- package/dist/build/types/src/skin/skin-root.d.ts.map +1 -0
- package/dist/build/types/src/utils/chapters.d.ts +16 -0
- package/dist/build/types/src/utils/chapters.d.ts.map +1 -0
- package/dist/build/types/src/utils/format-duration.d.ts +9 -0
- package/dist/build/types/src/utils/format-duration.d.ts.map +1 -0
- package/dist/build/types/src/utils/format-wall-clock.d.ts +6 -0
- package/dist/build/types/src/utils/format-wall-clock.d.ts.map +1 -0
- package/dist/build/types/src/utils/settings-helpers.d.ts +41 -0
- package/dist/build/types/src/utils/settings-helpers.d.ts.map +1 -0
- package/package.json +34 -33
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StallWatchdog - Automatic playback recovery for live streams.
|
|
3
|
+
*
|
|
4
|
+
* Detects silent stalls (video.currentTime not advancing) and escalates
|
|
5
|
+
* through recovery attempts before requesting a full stream reload.
|
|
6
|
+
*
|
|
7
|
+
* Ported from component/engines/common.js:
|
|
8
|
+
* startStallWatchdog / stopStallWatchdog / recoverFromStall
|
|
9
|
+
*
|
|
10
|
+
* Escalation sequence (10s interval):
|
|
11
|
+
* - Attempt 1 (10s stuck): calls onRecoverAttempt(1)
|
|
12
|
+
* - Attempt 2 (20s stuck): calls onRecoverAttempt(2)
|
|
13
|
+
* - Attempt 3 (30s stuck): calls onReloadRequired(), stops watchdog
|
|
14
|
+
*/
|
|
15
|
+
export interface StallWatchdogOptions {
|
|
16
|
+
video: HTMLVideoElement;
|
|
17
|
+
onRecoverAttempt: (attempt: number) => void;
|
|
18
|
+
onReloadRequired: () => void;
|
|
19
|
+
isCasting: () => boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare class StallWatchdog {
|
|
22
|
+
private readonly video;
|
|
23
|
+
private readonly onRecoverAttempt;
|
|
24
|
+
private readonly onReloadRequired;
|
|
25
|
+
private readonly isCasting;
|
|
26
|
+
private intervalId;
|
|
27
|
+
private lastTime;
|
|
28
|
+
private stallAttempts;
|
|
29
|
+
constructor(options: StallWatchdogOptions);
|
|
30
|
+
/**
|
|
31
|
+
* Start the stall watchdog interval.
|
|
32
|
+
* Calls stop() first to ensure idempotent restart.
|
|
33
|
+
*/
|
|
34
|
+
start(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Stop the stall watchdog and reset all internal state.
|
|
37
|
+
*/
|
|
38
|
+
stop(): void;
|
|
39
|
+
private tick;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=stall-watchdog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stall-watchdog.d.ts","sourceRoot":"","sources":["../../../../../src/engines/stall-watchdog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,gBAAgB,CAAA;IACvB,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,SAAS,EAAE,MAAM,OAAO,CAAA;CACzB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA2B;IAC5D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAY;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IAEzC,OAAO,CAAC,UAAU,CAA8C;IAChE,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,aAAa,CAAY;gBAErB,OAAO,EAAE,oBAAoB;IAOzC;;;OAGG;IACH,KAAK,IAAI,IAAI;IAQb;;OAEG;IACH,IAAI,IAAI,IAAI;IASZ,OAAO,CAAC,IAAI;CA4Bb"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { PlayerConfig } from '../core/config';
|
|
2
|
+
import type { PlayerState } from '../core/types';
|
|
3
|
+
import type { TypedEventBus } from '../core/event-bus';
|
|
4
|
+
/**
|
|
5
|
+
* G-07-9: backstop for an intro that never signals completion (all three
|
|
6
|
+
* IntroStreamManager completion triggers lost, e.g. a swallowed throw inside
|
|
7
|
+
* its init() that lifecycle.ts only logs). Chosen to exceed any plausible
|
|
8
|
+
* intro asset so it can never truncate a real intro — it converts an
|
|
9
|
+
* infinite hang into a bounded one.
|
|
10
|
+
*/
|
|
11
|
+
export declare const INTRO_DEFERRAL_TIMEOUT_MS = 120000;
|
|
12
|
+
/**
|
|
13
|
+
* G-07-11: bound from ad-leg entry to the AdsManager being handed back by
|
|
14
|
+
* the loader. It spans the gesture wait, loadScript, displayContainer
|
|
15
|
+
* initialization, requestAds and the ads response, and stops there —
|
|
16
|
+
* creative fetch, buffering and render are IMA's and are not charged to it.
|
|
17
|
+
* Must stay below MAIN_OPEN_FALLBACK_MS (eb-player.ts) so this more precise
|
|
18
|
+
* mechanism resolves first.
|
|
19
|
+
*/
|
|
20
|
+
export declare const AD_LEG_TIMEOUT_MS = 20000;
|
|
21
|
+
/**
|
|
22
|
+
* AdsManager manages the IMA SDK preroll ad lifecycle.
|
|
23
|
+
*
|
|
24
|
+
* - Defers IMA SDK loading until an intro stream (if configured) completes,
|
|
25
|
+
* bounded by INTRO_DEFERRAL_TIMEOUT_MS (G-07-9)
|
|
26
|
+
* - Observes a user gesture on the player root starting before that
|
|
27
|
+
* deferral, so a click during the intro satisfies the browser autoplay
|
|
28
|
+
* gesture requirement without a second click after the intro (G-07-11)
|
|
29
|
+
* - Guarantees the ad leg completes exactly once, bounded by
|
|
30
|
+
* AD_LEG_TIMEOUT_MS until the loader hands back an AdsManager (G-07-11)
|
|
31
|
+
* - Sets state.adPlaying based on IMA lifecycle events
|
|
32
|
+
* - Emits 'ad-complete' on TypedEventBus exactly once per instance
|
|
33
|
+
* - Cleans up adsManager.destroy() and displayContainer.destroy() on abort,
|
|
34
|
+
* and on any completion path that never obtained an AdsManager
|
|
35
|
+
*/
|
|
36
|
+
export declare class AdsManager {
|
|
37
|
+
private imaAdsManager;
|
|
38
|
+
private imaDisplayContainer;
|
|
39
|
+
/**
|
|
40
|
+
* Initialize the IMA SDK preroll ad system.
|
|
41
|
+
* - Skips if config.ad is undefined
|
|
42
|
+
* - Defers initialization while config.preroll is set, until
|
|
43
|
+
* 'intro-stream-complete' fires or INTRO_DEFERRAL_TIMEOUT_MS elapses
|
|
44
|
+
* (G-07-9)
|
|
45
|
+
* - If !config.autoplay: observes a click anywhere in the player before
|
|
46
|
+
* the deferral, and consumes it after (required by browser autoplay
|
|
47
|
+
* policies to avoid muted/blocked display contexts)
|
|
48
|
+
* - The ad leg always completes exactly once, bounded by
|
|
49
|
+
* AD_LEG_TIMEOUT_MS until the loader hands back an AdsManager (G-07-11)
|
|
50
|
+
* - Loads IMA SDK, creates AdDisplayContainer, AdsLoader, and AdsRequest
|
|
51
|
+
* - Wires ad lifecycle events to PlayerState and TypedEventBus
|
|
52
|
+
*/
|
|
53
|
+
init(config: PlayerConfig, state: PlayerState, bus: TypedEventBus, video: HTMLVideoElement, adsContainer: HTMLElement, signal: AbortSignal): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Shared teardown for imaAdsManager and imaDisplayContainer, each behind
|
|
56
|
+
* its own null check and nulled immediately after — idempotent by
|
|
57
|
+
* construction. Called unconditionally on abort, and from the completion
|
|
58
|
+
* funnel only when this.imaAdsManager is still null (T-07-23).
|
|
59
|
+
*/
|
|
60
|
+
private releaseImaResources;
|
|
61
|
+
/**
|
|
62
|
+
* Wait for a click event anywhere inside the player root.
|
|
63
|
+
* Used to satisfy browser autoplay policies when autoplay is disabled.
|
|
64
|
+
*
|
|
65
|
+
* G-07-11: the target widens from the video element to
|
|
66
|
+
* video.closest('.eb-player') (falling back to video itself for bare
|
|
67
|
+
* integrations), registered in the capture phase so a descendant that
|
|
68
|
+
* halts bubbling cannot hide the click from it. Observes only; never
|
|
69
|
+
* mutates the event, so the skip button and click-through link keep
|
|
70
|
+
* working exactly as they do today.
|
|
71
|
+
*
|
|
72
|
+
* WR-05: single-shot settle flag guards against the click-vs-abort race —
|
|
73
|
+
* Promise resolution is already idempotent but settled tightens the
|
|
74
|
+
* contract by ensuring listener cleanup happens exactly once for either
|
|
75
|
+
* outcome. Callers still distinguish outcomes via signal.aborted.
|
|
76
|
+
*/
|
|
77
|
+
private waitForUserGesture;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=ads-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ads-manager.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/ads-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAuEtD;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,SAAU,CAAA;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,QAAS,CAAA;AAEvC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,mBAAmB,CAAqC;IAEhE;;;;;;;;;;;;;OAaG;IACG,IAAI,CACR,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,gBAAgB,EACvB,YAAY,EAAE,WAAW,EACzB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC;IA+PhB;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,kBAAkB;CAmB3B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PlayerConfig } from '../core/config';
|
|
2
|
+
import type { PlayerState } from '../core/types';
|
|
3
|
+
import type { TypedEventBus } from '../core/event-bus';
|
|
4
|
+
/**
|
|
5
|
+
* Public interface for the Chromecast driver returned by ChromecastManager.getDriver().
|
|
6
|
+
* Provides play/pause/seek/volume controls to route commands during active cast sessions.
|
|
7
|
+
*/
|
|
8
|
+
export interface CastjsDriver {
|
|
9
|
+
play(): void;
|
|
10
|
+
pause(): void;
|
|
11
|
+
seek(time: number): void;
|
|
12
|
+
volume(level: number): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Reset the shared driver singleton. For testing only.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resetSharedDriverForTesting(): void;
|
|
18
|
+
/**
|
|
19
|
+
* ChromecastManager loads the Castjs SDK from CDN and manages cast sessions.
|
|
20
|
+
* Writes to PlayerState (castAvailable, isCasting) and emits EventBus events
|
|
21
|
+
* ('cast-stop') without depending on any skin component.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ChromecastManager {
|
|
24
|
+
private readonly signal;
|
|
25
|
+
private localDriver;
|
|
26
|
+
constructor(abortController: AbortController);
|
|
27
|
+
/**
|
|
28
|
+
* Initialize Chromecast integration.
|
|
29
|
+
* - Skips if config.chromecast is false
|
|
30
|
+
* - Loads Castjs from CDN
|
|
31
|
+
* - Creates the singleton driver if not already created
|
|
32
|
+
* - Wires driver events to state
|
|
33
|
+
* - Cleans up on abort
|
|
34
|
+
*/
|
|
35
|
+
init(config: PlayerConfig, state: PlayerState, bus: TypedEventBus): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the Castjs driver instance for routing play/pause/seek/volume
|
|
38
|
+
* commands during an active cast session. Returns null if not initialized.
|
|
39
|
+
*/
|
|
40
|
+
getDriver(): CastjsDriver | null;
|
|
41
|
+
/**
|
|
42
|
+
* Toggle cast: disconnect if connected, start casting if available.
|
|
43
|
+
*/
|
|
44
|
+
toggleCast(state: PlayerState): void;
|
|
45
|
+
private applyMetadata;
|
|
46
|
+
private bindDriverEvents;
|
|
47
|
+
private buildCastOptions;
|
|
48
|
+
private registerAbortCleanup;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=chromecast-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chromecast-manager.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/chromecast-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,IAAI,IAAI,CAAA;IACZ,KAAK,IAAI,IAAI,CAAA;IACb,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAwBD;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAID;;;;GAIG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,WAAW,CAA8B;gBAErC,eAAe,EAAE,eAAe;IAI5C;;;;;;;OAOG;IACG,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBvF;;;OAGG;IACH,SAAS,IAAI,YAAY,GAAG,IAAI;IAIhC;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAapC,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,oBAAoB;CAS7B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PlayerConfig } from '../core/config';
|
|
2
|
+
import type { PlayerState } from '../core/types';
|
|
3
|
+
/**
|
|
4
|
+
* EpgManager fetches EPG (Electronic Program Guide) data from the EasyBroadcast
|
|
5
|
+
* EPG API and optionally polls on an interval.
|
|
6
|
+
*
|
|
7
|
+
* - Writes state.epgPrograms and state.epgFetchedAt
|
|
8
|
+
* - Non-critical: errors are logged but never thrown
|
|
9
|
+
* - Cleans up poll timer on abort signal
|
|
10
|
+
*/
|
|
11
|
+
export declare class EpgManager {
|
|
12
|
+
private pollTimer;
|
|
13
|
+
/**
|
|
14
|
+
* Start EPG fetch and optional polling.
|
|
15
|
+
* - Skips if config.epgContentId is undefined
|
|
16
|
+
* - Fetches immediately, then sets up interval polling if epgPolling is set
|
|
17
|
+
* - Registers abort listener to stop polling
|
|
18
|
+
*/
|
|
19
|
+
start(config: PlayerConfig, state: PlayerState, signal: AbortSignal): Promise<void>;
|
|
20
|
+
private fetchEpg;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=epg-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epg-manager.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/epg-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,eAAe,CAAA;AAI5D;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,SAAS,CAA8C;IAE/D;;;;;OAKG;IACG,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;YAmB3E,QAAQ;CAkBvB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ChromecastManager } from './chromecast-manager';
|
|
2
|
+
export { EpgManager } from './epg-manager';
|
|
3
|
+
export { P2PManager } from './p2p-manager';
|
|
4
|
+
export { PlaylistManager } from './playlist-manager';
|
|
5
|
+
export { AdsManager } from './ads-manager';
|
|
6
|
+
export { IntroStreamManager } from './intro-stream-manager';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { PlayerConfig } from '../core/config';
|
|
2
|
+
import type { PlayerState } from '../core/types';
|
|
3
|
+
import type { TypedEventBus } from '../core/event-bus';
|
|
4
|
+
/**
|
|
5
|
+
* G-07-12: absolute backstop for an intro pass where every other completion
|
|
6
|
+
* trigger is lost — no video `ended`, no `preroll-skip`, no `error-fatal`,
|
|
7
|
+
* and no `state.error` write. 90s cannot truncate a real brand intro
|
|
8
|
+
* (single-digit to ~30s assets) but converts an infinite hang into a bounded
|
|
9
|
+
* one.
|
|
10
|
+
*
|
|
11
|
+
* D-10: this value MUST stay strictly below AdsManager's
|
|
12
|
+
* INTRO_DEFERRAL_TIMEOUT_MS (120_000, src/integrations/ads-manager.ts) so
|
|
13
|
+
* the intro pass always completes before the ad leg falls through — intro →
|
|
14
|
+
* ad → main precedence must hold in the failure case too, not only the
|
|
15
|
+
* happy path. Test 14 in test/integrations/intro-stream-manager.test.ts
|
|
16
|
+
* asserts this ordering so a future edit to either constant fails loudly.
|
|
17
|
+
*/
|
|
18
|
+
export declare const INTRO_MAX_DURATION_MS = 90000;
|
|
19
|
+
/**
|
|
20
|
+
* IntroStreamManager owns the intro-stream lifecycle.
|
|
21
|
+
*
|
|
22
|
+
* - On init(), if config.preroll is set: flips state.introStreamPlaying = true and
|
|
23
|
+
* subscribes to:
|
|
24
|
+
* - the video element's native `ended` event
|
|
25
|
+
* - bus `preroll-skip` (from the PrerollOverlay skip button)
|
|
26
|
+
* - bus `error-fatal` (D-04 silent fall-through — intro must never block main)
|
|
27
|
+
* - PlayerState `error` becoming non-null (G-07-12: the one signal shared
|
|
28
|
+
* by two silent failure modes that never reach the bus —
|
|
29
|
+
* StallWatchdog reload-budget exhaustion,
|
|
30
|
+
* src/core/command-handler.ts:159-164, and a synchronous engine
|
|
31
|
+
* init() throw caught in onAttach, src/engines/dash.ts:108-120 and
|
|
32
|
+
* src/engines/hls.ts:194-207)
|
|
33
|
+
* - the on-demand bus event that lets eb-player.ts's openMainStream()
|
|
34
|
+
* guarantee the intro pass is finished before main opens (G-07-13
|
|
35
|
+
* receiving half — see the bus.on() registration below for its name)
|
|
36
|
+
* - an absolute INTRO_MAX_DURATION_MS backstop timer, armed in case no
|
|
37
|
+
* other trigger ever fires
|
|
38
|
+
* - Any one of those triggers calls a closure `complete()` exactly once
|
|
39
|
+
* (idempotent via a `completed` boolean guard), which flips
|
|
40
|
+
* state.introStreamPlaying = false and emits `intro-stream-complete`.
|
|
41
|
+
* - On abort, the video `ended` listener is removed explicitly via
|
|
42
|
+
* removeEventListener and the backstop timer is cleared. Bus and state
|
|
43
|
+
* listeners auto-clean via the `{ signal }` option (see
|
|
44
|
+
* src/core/event-bus.ts on() and src/core/player-state.ts on()).
|
|
45
|
+
*
|
|
46
|
+
* Scope: this manager listens and emits — it does NOT itself open the intro
|
|
47
|
+
* stream. The engine open() call is owned by eb-player.ts (single source of
|
|
48
|
+
* engine selection + DRM wiring), driven by the orchestration around this
|
|
49
|
+
* manager's `intro-stream-complete` event.
|
|
50
|
+
*/
|
|
51
|
+
export declare class IntroStreamManager {
|
|
52
|
+
/**
|
|
53
|
+
* Initialize intro-stream lifecycle tracking.
|
|
54
|
+
* - Skips entirely if config.preroll is falsy (no state flip, no listeners).
|
|
55
|
+
* - Otherwise flips state.introStreamPlaying = true and registers the
|
|
56
|
+
* completion triggers (video `ended`, bus `preroll-skip`, bus
|
|
57
|
+
* `error-fatal`, PlayerState `error`, the on-demand force-completion bus
|
|
58
|
+
* event, and the INTRO_MAX_DURATION_MS backstop timer).
|
|
59
|
+
*/
|
|
60
|
+
init(config: PlayerConfig, state: PlayerState, bus: TypedEventBus, video: HTMLVideoElement, signal: AbortSignal): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=intro-stream-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intro-stream-manager.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/intro-stream-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,QAAS,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,kBAAkB;IAC7B;;;;;;;OAOG;IACG,IAAI,CACR,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC;CAgFjB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PlayerConfig } from '../core/config';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for P2PManager.integrate().
|
|
4
|
+
*/
|
|
5
|
+
export interface P2PIntegrateParams {
|
|
6
|
+
video: HTMLVideoElement;
|
|
7
|
+
driver: unknown;
|
|
8
|
+
type: 'hls' | 'dash';
|
|
9
|
+
config: PlayerConfig;
|
|
10
|
+
signal: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* P2PManager integrates the EasyBroadcast P2P SDK.
|
|
14
|
+
*
|
|
15
|
+
* Loads the SDK from CDN, creates an EBLibrary instance, builds settings
|
|
16
|
+
* (resourceManager, swarmManager, statsOutput, playerInput), and calls
|
|
17
|
+
* integrate() + start(). Cleans up via stop() on abort.
|
|
18
|
+
*
|
|
19
|
+
* Port of component/engines/eb/start.js.
|
|
20
|
+
*/
|
|
21
|
+
export declare class P2PManager {
|
|
22
|
+
private lib;
|
|
23
|
+
/**
|
|
24
|
+
* Integrate the EasyBroadcast P2P SDK.
|
|
25
|
+
* - Skips if config.lib or config.manager is absent/false
|
|
26
|
+
* - Loads the SDK via loadScript
|
|
27
|
+
* - Builds integration settings from config
|
|
28
|
+
* - Calls lib.integrate() and lib.start()
|
|
29
|
+
* - Registers abort cleanup
|
|
30
|
+
*/
|
|
31
|
+
integrate(params: P2PIntegrateParams): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Stop and detach the P2P SDK. Idempotent.
|
|
34
|
+
*
|
|
35
|
+
* Called on AbortSignal teardown, and eagerly on an unrecoverable engine
|
|
36
|
+
* error: hls.js nulls its media element on a fatal keySystemError, so a
|
|
37
|
+
* still-running eblib instance would keep polling `media.currentTime` and
|
|
38
|
+
* throw in a loop until full dispose.
|
|
39
|
+
*/
|
|
40
|
+
stop(): void;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=p2p-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p2p-manager.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/p2p-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAiClD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,gBAAgB,CAAA;IACvB,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,WAAW,CAAA;CACpB;AAED;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,GAAG,CAAiC;IAE5C;;;;;;;OAOG;IACG,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmD1D;;;;;;;OAOG;IACH,IAAI,IAAI,IAAI;CAMb"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PlayerConfig } from '../core/config';
|
|
2
|
+
import type { PlayerState } from '../core/types';
|
|
3
|
+
import type { TypedEventBus } from '../core/event-bus';
|
|
4
|
+
/**
|
|
5
|
+
* PlaylistManager manages episode/playlist navigation.
|
|
6
|
+
*
|
|
7
|
+
* Writes state.playlist from config, then listens for 'playlist-next' and
|
|
8
|
+
* 'playlist-prev' bus events to advance/decrement the episode index with
|
|
9
|
+
* wrap-around. Updates state.src when the current episode changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PlaylistManager {
|
|
12
|
+
/**
|
|
13
|
+
* Initialize playlist from config.
|
|
14
|
+
* - Skips if config.playlist is undefined or empty
|
|
15
|
+
* - Writes state.playlist and state.currentEpisode = 0
|
|
16
|
+
* - Listens for playlist-next and playlist-prev events (cleaned up on abort)
|
|
17
|
+
*/
|
|
18
|
+
init(config: PlayerConfig, state: PlayerState, bus: TypedEventBus, signal: AbortSignal): void;
|
|
19
|
+
private advance;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=playlist-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playlist-manager.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/playlist-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD;;;;;;GAMG;AACH,qBAAa,eAAe;IAC1B;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAiB7F,OAAO,CAAC,OAAO;CAMhB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit-html';
|
|
2
|
+
import { BaseComponent } from '../base-component';
|
|
3
|
+
/**
|
|
4
|
+
* BottomBar is a structural container for the seekbar and control buttons.
|
|
5
|
+
*
|
|
6
|
+
* Renders a controls row with dynamic slot divs based on the layout config.
|
|
7
|
+
* When no layout config is provided, falls back to DEFAULT_LAYOUT.
|
|
8
|
+
*
|
|
9
|
+
* The slot divs are empty containers — individual control components
|
|
10
|
+
* mount into them via SkinRoot.connectChildComponents().
|
|
11
|
+
*/
|
|
12
|
+
export declare class BottomBar extends BaseComponent {
|
|
13
|
+
protected onConnect(): void;
|
|
14
|
+
protected template(): TemplateResult;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=bottom-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-bar.d.ts","sourceRoot":"","sources":["../../../../../../src/skin/bars/bottom-bar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAIjD;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,aAAa;IAC1C,SAAS,CAAC,SAAS,IAAI,IAAI;IAI3B,SAAS,CAAC,QAAQ,IAAI,cAAc;CAmBrC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit-html';
|
|
2
|
+
import { BaseComponent } from '../base-component';
|
|
3
|
+
/**
|
|
4
|
+
* MiddleBar renders centered playback controls with a built-in play/pause button.
|
|
5
|
+
*
|
|
6
|
+
* The central play/pause button is always present (part of the bar's identity).
|
|
7
|
+
* Surrounding slots (default: rewind left, forward right) are driven by layout config.
|
|
8
|
+
*
|
|
9
|
+
* Subscribes to state.playbackState for icon toggle.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MiddleBar extends BaseComponent {
|
|
12
|
+
protected onConnect(): void;
|
|
13
|
+
protected template(): TemplateResult;
|
|
14
|
+
private handleClick;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=middle-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middle-bar.d.ts","sourceRoot":"","sources":["../../../../../../src/skin/bars/middle-bar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAKjD;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,aAAa;IAC1C,SAAS,CAAC,SAAS,IAAI,IAAI;IAU3B,SAAS,CAAC,QAAQ,IAAI,cAAc;IAuBpC,OAAO,CAAC,WAAW;CAUpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit-html';
|
|
2
|
+
import { BaseComponent } from '../base-component';
|
|
3
|
+
/**
|
|
4
|
+
* TopBar renders the top control bar with logo and dynamic action slots.
|
|
5
|
+
*
|
|
6
|
+
* - Logo: renders as <img> wrapped in <a> if logoLink is set (always built-in)
|
|
7
|
+
* - Action slots: driven by layout config (default: share + info on the right)
|
|
8
|
+
*
|
|
9
|
+
* Subscribes to state.controlsVisible for visibility transitions.
|
|
10
|
+
*/
|
|
11
|
+
export declare class TopBar extends BaseComponent {
|
|
12
|
+
protected onConnect(): void;
|
|
13
|
+
protected template(): TemplateResult;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=top-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../../../../../../src/skin/bars/top-bar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAIjD;;;;;;;GAOG;AACH,qBAAa,MAAO,SAAQ,aAAa;IACvC,SAAS,CAAC,SAAS,IAAI,IAAI;IAI3B,SAAS,CAAC,QAAQ,IAAI,cAAc;CA2BrC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { html, render } from 'lit-html';
|
|
2
|
+
import type { TemplateResult } from 'lit-html';
|
|
3
|
+
import type { PlayerState } from '../core/types';
|
|
4
|
+
import type { TypedEventBus } from '../core/event-bus';
|
|
5
|
+
import type { PlayerConfig } from '../core/config';
|
|
6
|
+
import type { I18n } from '../core/i18n';
|
|
7
|
+
export { html, render };
|
|
8
|
+
export type { TemplateResult };
|
|
9
|
+
/**
|
|
10
|
+
* Abstract base class for all skin components.
|
|
11
|
+
*
|
|
12
|
+
* Provides a connect/disconnect lifecycle with AbortSignal-based cleanup,
|
|
13
|
+
* so state subscriptions and event listeners registered in onConnect()
|
|
14
|
+
* are automatically removed when disconnect() is called.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* class PlayButton extends BaseComponent {
|
|
18
|
+
* protected onConnect(): void {
|
|
19
|
+
* this.state!.on('playbackState', () => this.render(), { signal: this.signal })
|
|
20
|
+
* }
|
|
21
|
+
* protected template(): TemplateResult {
|
|
22
|
+
* return html`<button>Play</button>`
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
*/
|
|
26
|
+
export declare abstract class BaseComponent {
|
|
27
|
+
protected el: HTMLElement | null;
|
|
28
|
+
protected state: PlayerState | null;
|
|
29
|
+
protected bus: TypedEventBus | null;
|
|
30
|
+
protected config: PlayerConfig | null;
|
|
31
|
+
protected i18n: I18n | null;
|
|
32
|
+
private abortController;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the AbortSignal for the current connect() session.
|
|
35
|
+
* Only valid after connect() and before disconnect().
|
|
36
|
+
* Pass this signal to state.on() and bus.on() for automatic cleanup.
|
|
37
|
+
*/
|
|
38
|
+
protected get signal(): AbortSignal;
|
|
39
|
+
/**
|
|
40
|
+
* Connect this component to the DOM and player context.
|
|
41
|
+
* Creates a fresh AbortController, sets all fields, then calls onConnect().
|
|
42
|
+
*
|
|
43
|
+
* @param i18n - Optional i18n instance for components that render translated text.
|
|
44
|
+
* Components that use this.i18n should handle null gracefully (null = fallback to key string).
|
|
45
|
+
*/
|
|
46
|
+
connect(el: HTMLElement, state: PlayerState, bus: TypedEventBus, config: PlayerConfig, i18n?: I18n): void;
|
|
47
|
+
/**
|
|
48
|
+
* Disconnect this component from the player context.
|
|
49
|
+
* Aborts the AbortController (cleaning up all signal-based subscriptions),
|
|
50
|
+
* then nulls all references.
|
|
51
|
+
*/
|
|
52
|
+
disconnect(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Called during connect() after all fields are set.
|
|
55
|
+
* Override to register state subscriptions and event listeners using this.signal.
|
|
56
|
+
*/
|
|
57
|
+
protected abstract onConnect(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the lit-html TemplateResult for this component.
|
|
60
|
+
* Called by render() to produce the DOM output.
|
|
61
|
+
*/
|
|
62
|
+
protected abstract template(): TemplateResult;
|
|
63
|
+
/**
|
|
64
|
+
* Renders the component into this.el using lit-html.
|
|
65
|
+
* No-op if el is null (e.g., after disconnect()).
|
|
66
|
+
*/
|
|
67
|
+
protected render(): void;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=base-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-component.d.ts","sourceRoot":"","sources":["../../../../../src/skin/base-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AACvB,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,aAAa;IACjC,SAAS,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAAO;IACvC,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAO;IAC1C,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAAO;IAC1C,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAO;IAC5C,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAO;IAClC,OAAO,CAAC,eAAe,CAA+B;IAEtD;;;;OAIG;IACH,SAAS,KAAK,MAAM,IAAI,WAAW,CAElC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI;IAUzG;;;;OAIG;IACH,UAAU,IAAI,IAAI;IAUlB;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,IAAI,IAAI;IAEpC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,QAAQ,IAAI,cAAc;IAE7C;;;OAGG;IACH,SAAS,CAAC,MAAM,IAAI,IAAI;CAIzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit-html';
|
|
2
|
+
import { BaseComponent } from '../base-component';
|
|
3
|
+
/**
|
|
4
|
+
* ForjaPlaylistBar renders a horizontal episode list in the bottom-extra
|
|
5
|
+
* extension zone for the Forja brand skin.
|
|
6
|
+
*
|
|
7
|
+
* Subscribes to state.playlist and state.currentEpisode.
|
|
8
|
+
* Provides prev/next navigation buttons that emit bus events.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ForjaPlaylistBar extends BaseComponent {
|
|
11
|
+
protected onConnect(): void;
|
|
12
|
+
protected template(): TemplateResult;
|
|
13
|
+
private formatDuration;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=forja-playlist-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forja-playlist-bar.d.ts","sourceRoot":"","sources":["../../../../../../src/skin/brand/forja-playlist-bar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,SAAS,CAAC,SAAS,IAAI,IAAI;IAc3B,SAAS,CAAC,QAAQ,IAAI,cAAc;IA6CpC,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit-html';
|
|
2
|
+
import { BaseComponent } from '../base-component';
|
|
3
|
+
/**
|
|
4
|
+
* SnrtRadioCarousel renders a horizontal carousel of radio program items
|
|
5
|
+
* for the SNRT brand skin.
|
|
6
|
+
*
|
|
7
|
+
* Subscribes to state.epgPrograms for data. Each item shows the program
|
|
8
|
+
* title and time range. This component is registered as a brand extra
|
|
9
|
+
* by the SNRT configuration.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SnrtRadioCarousel extends BaseComponent {
|
|
12
|
+
protected onConnect(): void;
|
|
13
|
+
protected template(): TemplateResult;
|
|
14
|
+
private formatTime;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=snrt-radio-carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snrt-radio-carousel.d.ts","sourceRoot":"","sources":["../../../../../../src/skin/brand/snrt-radio-carousel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD;;;;;;;GAOG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IAClD,SAAS,CAAC,SAAS,IAAI,IAAI;IAU3B,SAAS,CAAC,QAAQ,IAAI,cAAc;IAiBpC,OAAO,CAAC,UAAU;CAInB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentId } from '../core/config';
|
|
2
|
+
import type { BaseComponent } from './base-component';
|
|
3
|
+
type ComponentFactory = () => BaseComponent;
|
|
4
|
+
/**
|
|
5
|
+
* Maps ComponentId strings to factory functions that create component instances.
|
|
6
|
+
* Used by SkinRoot.connectChildComponents() to dynamically mount components
|
|
7
|
+
* based on the layout config.
|
|
8
|
+
*/
|
|
9
|
+
export declare const COMPONENT_REGISTRY: Record<ComponentId, ComponentFactory>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the CSS selector for a component's slot element.
|
|
12
|
+
* Seekbar uses a special class for flex:1 behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare function slotSelector(componentId: ComponentId): string;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=component-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../../../../../src/skin/component-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAgBrD,KAAK,gBAAgB,GAAG,MAAM,aAAa,CAAA;AAE3C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAepE,CAAA;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAG7D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PlayerState } from '../../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* AutoHideController manages the 3-second auto-hide timer for player controls.
|
|
4
|
+
*
|
|
5
|
+
* On any user activity (pointermove, touchstart, keyup), the timer resets to 3s.
|
|
6
|
+
* When the timer fires, controls are hidden — but ONLY if no panel is open,
|
|
7
|
+
* no ad is playing, and no intro stream is playing.
|
|
8
|
+
*
|
|
9
|
+
* Note: Uses manual removeEventListener instead of the { signal } option in
|
|
10
|
+
* addEventListener. JSDOM 28 rejects non-JSDOM AbortSignal instances in the
|
|
11
|
+
* options dict, making the signal approach non-testable. Production behavior
|
|
12
|
+
* is identical — cleanup is triggered by the signal's 'abort' event.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* const controller = new AutoHideController(container, state, signal)
|
|
16
|
+
* // cleanup happens automatically when signal aborts
|
|
17
|
+
*/
|
|
18
|
+
export declare class AutoHideController {
|
|
19
|
+
private timer;
|
|
20
|
+
private readonly state;
|
|
21
|
+
private readonly onActivity;
|
|
22
|
+
private readonly container;
|
|
23
|
+
constructor(container: HTMLElement, state: PlayerState, signal: AbortSignal);
|
|
24
|
+
private show;
|
|
25
|
+
private hide;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=auto-hide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-hide.d.ts","sourceRoot":"","sources":["../../../../../../src/skin/controllers/auto-hide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAkB;IAE7B,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAa;gBAE3B,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW;IAyB3E,OAAO,CAAC,IAAI;IAQZ,OAAO,CAAC,IAAI;CAYb"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PlayerState } from '../../core/types';
|
|
2
|
+
import type { TypedEventBus } from '../../core/event-bus';
|
|
3
|
+
import type { PlayerConfig } from '../../core/config';
|
|
4
|
+
/**
|
|
5
|
+
* KeyboardController handles player keyboard shortcuts.
|
|
6
|
+
*
|
|
7
|
+
* Space: toggles play/pause, prevents default scroll behavior.
|
|
8
|
+
* ArrowLeft: seek back by config.seekOffset seconds (clamped to 0).
|
|
9
|
+
* ArrowRight: seek forward by config.seekOffset seconds (clamped to duration).
|
|
10
|
+
* m: mutes/unmutes — only when config.supportHotKeys is true.
|
|
11
|
+
*
|
|
12
|
+
* All shortcuts are disabled during ads or intro streams (state.adPlaying || state.introStreamPlaying).
|
|
13
|
+
*
|
|
14
|
+
* The container must be focusable to receive keyboard events.
|
|
15
|
+
* If container.tabIndex < 0, it is set to 0 automatically.
|
|
16
|
+
*
|
|
17
|
+
* Note: Uses manual removeEventListener instead of the { signal } option in
|
|
18
|
+
* addEventListener. JSDOM 28 rejects non-JSDOM AbortSignal instances in the
|
|
19
|
+
* options dict, making the signal approach non-testable. Production behavior
|
|
20
|
+
* is identical — cleanup is triggered by the signal's 'abort' event.
|
|
21
|
+
*
|
|
22
|
+
* Usage:
|
|
23
|
+
* const controller = new KeyboardController(container, state, bus, config, signal)
|
|
24
|
+
* // cleanup happens automatically when signal aborts
|
|
25
|
+
*/
|
|
26
|
+
export declare class KeyboardController {
|
|
27
|
+
constructor(container: HTMLElement, state: PlayerState, bus: TypedEventBus, config: PlayerConfig, signal: AbortSignal);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../../../../src/skin/controllers/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,kBAAkB;gBAE3B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,WAAW;CAyDtB"}
|