eb-player 1.54.55 → 2.0.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/README.md +2 -6
- package/dist/build/default.js +1 -1
- package/dist/build/eb-player.css +2066 -0
- package/dist/build/ebplayer-engines.bundle.js +2393 -0
- package/dist/build/ebplayer-engines.bundle.js.map +1 -0
- package/dist/build/ebplayer.bundle.js +6580 -0
- package/dist/build/ebplayer.bundle.js.map +1 -0
- package/dist/build/theme-forja.css +10 -0
- package/dist/build/theme-forja.js +1 -0
- package/dist/build/theme-modern.css +520 -0
- package/dist/build/theme-radio.css +11 -0
- package/dist/build/theme-radio.js +1 -0
- package/dist/build/theme-snrt.css +11 -0
- package/dist/build/theme-snrt.js +1 -0
- package/dist/build/theme-v2.css +661 -0
- package/dist/build/types/config.d.ts +139 -0
- package/dist/build/types/config.d.ts.map +1 -0
- package/dist/build/types/core/command-handler.d.ts +49 -0
- package/dist/build/types/core/command-handler.d.ts.map +1 -0
- package/dist/build/types/core/config.d.ts +174 -0
- package/dist/build/types/core/config.d.ts.map +1 -0
- package/dist/build/types/core/css/theme-forja.entry.d.ts +2 -0
- package/dist/build/types/core/css/theme-forja.entry.d.ts.map +1 -0
- package/dist/build/types/core/css/theme-radio.entry.d.ts +2 -0
- package/dist/build/types/core/css/theme-radio.entry.d.ts.map +1 -0
- package/dist/build/types/core/css/theme-snrt.entry.d.ts +2 -0
- package/dist/build/types/core/css/theme-snrt.entry.d.ts.map +1 -0
- package/dist/build/types/core/engine-state-sync.d.ts +38 -0
- package/dist/build/types/core/engine-state-sync.d.ts.map +1 -0
- package/dist/build/types/core/event-bus.d.ts +87 -0
- package/dist/build/types/core/event-bus.d.ts.map +1 -0
- package/dist/build/types/core/fsm.d.ts +27 -0
- package/dist/build/types/core/fsm.d.ts.map +1 -0
- package/dist/build/types/core/i18n.d.ts +51 -0
- package/dist/build/types/core/i18n.d.ts.map +1 -0
- package/dist/build/types/core/index.d.ts +23 -0
- package/dist/build/types/core/index.d.ts.map +1 -0
- package/dist/build/types/core/lifecycle.d.ts +96 -0
- package/dist/build/types/core/lifecycle.d.ts.map +1 -0
- package/dist/build/types/core/player-state.d.ts +15 -0
- package/dist/build/types/core/player-state.d.ts.map +1 -0
- package/dist/build/types/core/types.d.ts +84 -0
- package/dist/build/types/core/types.d.ts.map +1 -0
- package/dist/build/types/eb-player-standalone.d.ts +12 -0
- package/dist/build/types/eb-player-standalone.d.ts.map +1 -0
- package/dist/build/types/eb-player.d.ts +43 -0
- package/dist/build/types/eb-player.d.ts.map +1 -0
- package/dist/build/types/engine-state-sync.d.ts +38 -0
- package/dist/build/types/engine-state-sync.d.ts.map +1 -0
- package/dist/build/types/engines/abr/dash.d.ts +56 -0
- package/dist/build/types/engines/abr/dash.d.ts.map +1 -0
- package/dist/build/types/engines/abr/hls.d.ts +105 -0
- package/dist/build/types/engines/abr/hls.d.ts.map +1 -0
- package/dist/build/types/engines/base-engine.d.ts +56 -0
- package/dist/build/types/engines/base-engine.d.ts.map +1 -0
- package/dist/build/types/engines/cdn-loader.d.ts +20 -0
- package/dist/build/types/engines/cdn-loader.d.ts.map +1 -0
- package/dist/build/types/engines/cdn-token-manager.d.ts +136 -0
- package/dist/build/types/engines/cdn-token-manager.d.ts.map +1 -0
- package/dist/build/types/engines/dash.d.ts +79 -0
- package/dist/build/types/engines/dash.d.ts.map +1 -0
- package/dist/build/types/engines/drm.d.ts +54 -0
- package/dist/build/types/engines/drm.d.ts.map +1 -0
- package/dist/build/types/engines/hls-discontinuity-patch.d.ts +43 -0
- package/dist/build/types/engines/hls-discontinuity-patch.d.ts.map +1 -0
- package/dist/build/types/engines/hls.d.ts +45 -0
- package/dist/build/types/engines/hls.d.ts.map +1 -0
- package/dist/build/types/engines/index.d.ts +26 -0
- package/dist/build/types/engines/index.d.ts.map +1 -0
- package/dist/build/types/engines/ios/hls.d.ts +20 -0
- package/dist/build/types/engines/ios/hls.d.ts.map +1 -0
- package/dist/build/types/engines/poster/hls.d.ts +35 -0
- package/dist/build/types/engines/poster/hls.d.ts.map +1 -0
- package/dist/build/types/engines/retry/dash.d.ts +39 -0
- package/dist/build/types/engines/retry/dash.d.ts.map +1 -0
- package/dist/build/types/engines/retry/hls.d.ts +35 -0
- package/dist/build/types/engines/retry/hls.d.ts.map +1 -0
- package/dist/build/types/engines/snapshot/dash.d.ts +55 -0
- package/dist/build/types/engines/snapshot/dash.d.ts.map +1 -0
- package/dist/build/types/engines/snapshot/hls.d.ts +104 -0
- package/dist/build/types/engines/snapshot/hls.d.ts.map +1 -0
- package/dist/build/types/engines/stall-watchdog.d.ts +41 -0
- package/dist/build/types/engines/stall-watchdog.d.ts.map +1 -0
- package/dist/build/types/event-bus.d.ts +54 -0
- package/dist/build/types/event-bus.d.ts.map +1 -0
- package/dist/build/types/fsm.d.ts +27 -0
- package/dist/build/types/fsm.d.ts.map +1 -0
- package/dist/build/types/i18n.d.ts +51 -0
- package/dist/build/types/i18n.d.ts.map +1 -0
- package/dist/build/types/index.d.ts +21 -0
- package/dist/build/types/index.d.ts.map +1 -0
- package/dist/build/types/integrations/ads-manager.d.ts +32 -0
- package/dist/build/types/integrations/ads-manager.d.ts.map +1 -0
- package/dist/build/types/integrations/chromecast-manager.d.ts +50 -0
- package/dist/build/types/integrations/chromecast-manager.d.ts.map +1 -0
- package/dist/build/types/integrations/epg-manager.d.ts +22 -0
- package/dist/build/types/integrations/epg-manager.d.ts.map +1 -0
- package/dist/build/types/integrations/index.d.ts +6 -0
- package/dist/build/types/integrations/index.d.ts.map +1 -0
- package/dist/build/types/integrations/p2p-manager.d.ts +33 -0
- package/dist/build/types/integrations/p2p-manager.d.ts.map +1 -0
- package/dist/build/types/integrations/playlist-manager.d.ts +21 -0
- package/dist/build/types/integrations/playlist-manager.d.ts.map +1 -0
- package/dist/build/types/lifecycle.d.ts +64 -0
- package/dist/build/types/lifecycle.d.ts.map +1 -0
- package/dist/build/types/player-state.d.ts +15 -0
- package/dist/build/types/player-state.d.ts.map +1 -0
- package/dist/build/types/skin/bars/bottom-bar.d.ts +16 -0
- package/dist/build/types/skin/bars/bottom-bar.d.ts.map +1 -0
- package/dist/build/types/skin/bars/middle-bar.d.ts +16 -0
- package/dist/build/types/skin/bars/middle-bar.d.ts.map +1 -0
- package/dist/build/types/skin/bars/top-bar.d.ts +15 -0
- package/dist/build/types/skin/bars/top-bar.d.ts.map +1 -0
- package/dist/build/types/skin/base-component.d.ts +69 -0
- package/dist/build/types/skin/base-component.d.ts.map +1 -0
- package/dist/build/types/skin/brand/forja-playlist-bar.d.ts +15 -0
- package/dist/build/types/skin/brand/forja-playlist-bar.d.ts.map +1 -0
- package/dist/build/types/skin/brand/snrt-radio-carousel.d.ts +16 -0
- package/dist/build/types/skin/brand/snrt-radio-carousel.d.ts.map +1 -0
- package/dist/build/types/skin/component-registry.d.ts +16 -0
- package/dist/build/types/skin/component-registry.d.ts.map +1 -0
- package/dist/build/types/skin/controllers/auto-hide.d.ts +27 -0
- package/dist/build/types/skin/controllers/auto-hide.d.ts.map +1 -0
- package/dist/build/types/skin/controllers/keyboard.d.ts +29 -0
- package/dist/build/types/skin/controllers/keyboard.d.ts.map +1 -0
- package/dist/build/types/skin/controls/cast-button.d.ts +15 -0
- package/dist/build/types/skin/controls/cast-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/forward-button.d.ts +15 -0
- package/dist/build/types/skin/controls/forward-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/fullscreen-button.d.ts +17 -0
- package/dist/build/types/skin/controls/fullscreen-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/info-button.d.ts +10 -0
- package/dist/build/types/skin/controls/info-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/live-sync-button.d.ts +20 -0
- package/dist/build/types/skin/controls/live-sync-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/pip-button.d.ts +21 -0
- package/dist/build/types/skin/controls/pip-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/play-pause-button.d.ts +14 -0
- package/dist/build/types/skin/controls/play-pause-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/rewind-button.d.ts +15 -0
- package/dist/build/types/skin/controls/rewind-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/seekbar.d.ts +43 -0
- package/dist/build/types/skin/controls/seekbar.d.ts.map +1 -0
- package/dist/build/types/skin/controls/settings-panel.d.ts +45 -0
- package/dist/build/types/skin/controls/settings-panel.d.ts.map +1 -0
- package/dist/build/types/skin/controls/share-button.d.ts +11 -0
- package/dist/build/types/skin/controls/share-button.d.ts.map +1 -0
- package/dist/build/types/skin/controls/time-display.d.ts +19 -0
- package/dist/build/types/skin/controls/time-display.d.ts.map +1 -0
- package/dist/build/types/skin/controls/volume-control.d.ts +21 -0
- package/dist/build/types/skin/controls/volume-control.d.ts.map +1 -0
- package/dist/build/types/skin/icons/icons-modern.d.ts +10 -0
- package/dist/build/types/skin/icons/icons-modern.d.ts.map +1 -0
- package/dist/build/types/skin/icons/icons.d.ts +10 -0
- package/dist/build/types/skin/icons/icons.d.ts.map +1 -0
- package/dist/build/types/skin/icons/sprite.d.ts +39 -0
- package/dist/build/types/skin/icons/sprite.d.ts.map +1 -0
- package/dist/build/types/skin/index.d.ts +24 -0
- package/dist/build/types/skin/index.d.ts.map +1 -0
- package/dist/build/types/skin/overlays/error-message.d.ts +14 -0
- package/dist/build/types/skin/overlays/error-message.d.ts.map +1 -0
- package/dist/build/types/skin/overlays/info-overlay.d.ts +15 -0
- package/dist/build/types/skin/overlays/info-overlay.d.ts.map +1 -0
- package/dist/build/types/skin/overlays/loading-spinner.d.ts +17 -0
- package/dist/build/types/skin/overlays/loading-spinner.d.ts.map +1 -0
- package/dist/build/types/skin/overlays/socials-overlay.d.ts +17 -0
- package/dist/build/types/skin/overlays/socials-overlay.d.ts.map +1 -0
- package/dist/build/types/skin/overlays/toast-notification.d.ts +18 -0
- package/dist/build/types/skin/overlays/toast-notification.d.ts.map +1 -0
- package/dist/build/types/skin/skin-root.d.ts +80 -0
- package/dist/build/types/skin/skin-root.d.ts.map +1 -0
- package/dist/build/types/types.d.ts +41 -0
- package/dist/build/types/types.d.ts.map +1 -0
- package/dist/build/types/utils/chapters.d.ts +16 -0
- package/dist/build/types/utils/chapters.d.ts.map +1 -0
- package/dist/build/types/utils/format-duration.d.ts +9 -0
- package/dist/build/types/utils/format-duration.d.ts.map +1 -0
- package/dist/build/types/utils/format-wall-clock.d.ts +6 -0
- package/dist/build/types/utils/format-wall-clock.d.ts.map +1 -0
- package/dist/build/types/utils/settings-helpers.d.ts +41 -0
- package/dist/build/types/utils/settings-helpers.d.ts.map +1 -0
- package/dist/dev/default.js +6451 -0
- package/dist/dev/default.js.map +1 -0
- package/dist/dev/easybroadcast.js +6654 -0
- package/dist/dev/easybroadcast.js.map +1 -0
- package/dist/dev/index.html +24 -0
- package/dist/eb-player.css +2066 -0
- package/dist/players/default/default.js +400 -1
- package/dist/players/default/index.html +1 -5
- package/dist/players/forja/forja.js +310 -0
- package/dist/players/forja/index.html +1 -0
- package/dist/players/videos/equipe/EB_lequipe-preprod.js +1 -0
- package/dist/players/videos/equipe/EB_lequipe.js +1 -1
- package/dist/players/videos/equipe/equipe.js +1 -1
- package/dist/theme-forja.css +10 -0
- package/dist/theme-modern.css +520 -0
- package/dist/theme-radio.css +11 -0
- package/dist/theme-snrt.css +11 -0
- package/dist/theme-v2.css +661 -0
- package/package.json +34 -3
- package/dist/build/forja.js +0 -1
- package/dist/players/videos/equipe/EB_lequipe-preprod copy.js +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HLS Snapshot Handler.
|
|
3
|
+
*
|
|
4
|
+
* Ported from component/engines/snapshot/hls.js (102 LOC).
|
|
5
|
+
*
|
|
6
|
+
* Creates a separate Hls instance for seekbar thumbnail preview rendering.
|
|
7
|
+
* The snapshot instance runs independently from the main playback engine with
|
|
8
|
+
* its own off-screen video element and low-buffer settings.
|
|
9
|
+
*
|
|
10
|
+
* Token injection (Pitfall 6): tokenManager is captured via closure,
|
|
11
|
+
* not stored on `this`, to avoid binding issues inside pLoader.
|
|
12
|
+
*/
|
|
13
|
+
import type { CDNTokenManager } from '../cdn-token-manager';
|
|
14
|
+
interface SnapshotLoaderContext {
|
|
15
|
+
url: string;
|
|
16
|
+
}
|
|
17
|
+
interface SnapshotLoaderCallbacks {
|
|
18
|
+
onSuccess: (response: unknown, stats: unknown, context: unknown) => void;
|
|
19
|
+
onError: (error: unknown, context: unknown, response: unknown) => void;
|
|
20
|
+
onTimeout: (stats: unknown, context: unknown, response: unknown) => void;
|
|
21
|
+
}
|
|
22
|
+
interface SnapshotLoaderConfig {
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
interface SnapshotHlsLoaderClass {
|
|
26
|
+
new (config: SnapshotLoaderConfig): {
|
|
27
|
+
load: (context: SnapshotLoaderContext, config: SnapshotLoaderConfig, callbacks: SnapshotLoaderCallbacks) => void;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface SnapshotHlsDriverConfig {
|
|
31
|
+
startLevel?: number;
|
|
32
|
+
enableWebVTT?: boolean;
|
|
33
|
+
maxBufferLength?: number;
|
|
34
|
+
pLoader?: SnapshotHlsLoaderClass;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
interface SnapshotHlsEvents {
|
|
38
|
+
MANIFEST_LOADED: string;
|
|
39
|
+
[key: string]: string;
|
|
40
|
+
}
|
|
41
|
+
interface SnapshotHlsInstance {
|
|
42
|
+
on: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
43
|
+
once: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
44
|
+
trigger: (event: string, data?: unknown) => unknown;
|
|
45
|
+
loadSource: (src: string) => void;
|
|
46
|
+
attachMedia: (element: HTMLVideoElement) => void;
|
|
47
|
+
detachMedia: () => void;
|
|
48
|
+
destroy: () => void;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
interface SnapshotHlsConstructor {
|
|
52
|
+
new (config?: SnapshotHlsDriverConfig): SnapshotHlsInstance;
|
|
53
|
+
isSupported: () => boolean;
|
|
54
|
+
Events: SnapshotHlsEvents;
|
|
55
|
+
DefaultConfig: {
|
|
56
|
+
loader: SnapshotHlsLoaderClass;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
};
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
export interface SnapshotConfig {
|
|
62
|
+
src?: string;
|
|
63
|
+
engineSettings?: {
|
|
64
|
+
extraParamsCallback?: ((status?: number | string) => Promise<Record<string, unknown>>) | null;
|
|
65
|
+
onCDNTokenError?: ((error: {
|
|
66
|
+
status: number | string;
|
|
67
|
+
errorCode: string;
|
|
68
|
+
errorType: string;
|
|
69
|
+
}) => void) | null;
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
}
|
|
74
|
+
export declare class HlsSnapshotHandler {
|
|
75
|
+
private readonly config;
|
|
76
|
+
private readonly tokenManager;
|
|
77
|
+
private driver;
|
|
78
|
+
private offscreenVideo;
|
|
79
|
+
private throttleTimeout;
|
|
80
|
+
private pendingSeekTime;
|
|
81
|
+
constructor(config: SnapshotConfig, tokenManager: CDNTokenManager | null);
|
|
82
|
+
/**
|
|
83
|
+
* Initialize the snapshot Hls instance using the CDN-loaded Hls constructor.
|
|
84
|
+
* Creates a separate Hls instance with minimal buffering for thumbnail generation.
|
|
85
|
+
*/
|
|
86
|
+
init(HlsConstructor: SnapshotHlsConstructor): void;
|
|
87
|
+
/**
|
|
88
|
+
* Seek the snapshot player to the specified time.
|
|
89
|
+
* Throttled to avoid excessive seeks (250ms minimum interval).
|
|
90
|
+
*/
|
|
91
|
+
take(time: number): void;
|
|
92
|
+
private applyPendingSeek;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the off-screen video element used for thumbnail rendering.
|
|
95
|
+
* The seekbar displays this element in the tooltip to show preview frames.
|
|
96
|
+
*/
|
|
97
|
+
getVideo(): HTMLVideoElement | null;
|
|
98
|
+
/**
|
|
99
|
+
* Destroy the snapshot Hls instance and clean up resources.
|
|
100
|
+
*/
|
|
101
|
+
destroy(): void;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
104
|
+
//# sourceMappingURL=hls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hls.d.ts","sourceRoot":"","sources":["../../../../../src/engines/snapshot/hls.ts"],"names":[],"mappings":"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"}
|
|
@@ -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,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventMap defines the typed event names and their payload types.
|
|
3
|
+
* - void events: listener receives no arguments
|
|
4
|
+
* - payload events: listener receives the typed payload
|
|
5
|
+
*
|
|
6
|
+
* This type will be extended as more events are identified in Phase 2/3.
|
|
7
|
+
*/
|
|
8
|
+
export interface EventMap {
|
|
9
|
+
'request-reload': void;
|
|
10
|
+
'ad-complete': void;
|
|
11
|
+
'cast-stop': void;
|
|
12
|
+
'error-fatal': {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
'cast-start': {
|
|
17
|
+
src: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type EventListener<T> = T extends void ? () => void : (payload: T) => void;
|
|
21
|
+
type EmitArgs<K extends keyof EventMap> = EventMap[K] extends void ? [event: K] : [event: K, payload: EventMap[K]];
|
|
22
|
+
/**
|
|
23
|
+
* TypedEventBus provides signal-based inter-component communication.
|
|
24
|
+
* It is distinct from PlayerState (reactive values) — the EventBus handles
|
|
25
|
+
* one-shot signals and commands between components.
|
|
26
|
+
*
|
|
27
|
+
* Usage:
|
|
28
|
+
* bus.on('request-reload', () => reload())
|
|
29
|
+
* bus.emit('request-reload')
|
|
30
|
+
* bus.on('error-fatal', (payload) => handleError(payload), { signal: ac.signal })
|
|
31
|
+
*/
|
|
32
|
+
export declare class TypedEventBus {
|
|
33
|
+
private readonly listeners;
|
|
34
|
+
constructor();
|
|
35
|
+
/**
|
|
36
|
+
* Register a listener for the given event.
|
|
37
|
+
* Pass an AbortSignal via options to auto-remove the listener when the signal aborts.
|
|
38
|
+
*/
|
|
39
|
+
on<K extends keyof EventMap>(event: K, listener: EventListener<EventMap[K]>, options?: {
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
}): void;
|
|
42
|
+
/**
|
|
43
|
+
* Emit an event, calling all registered listeners.
|
|
44
|
+
* Void events require no payload argument; payload events require the payload.
|
|
45
|
+
*/
|
|
46
|
+
emit<K extends keyof EventMap>(...args: EmitArgs<K>): void;
|
|
47
|
+
/**
|
|
48
|
+
* Remove all listeners from all events.
|
|
49
|
+
* After calling dispose(), all subsequent emit calls are no-ops.
|
|
50
|
+
*/
|
|
51
|
+
dispose(): void;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=event-bus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../../src/core/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,gBAAgB,EAAE,IAAI,CAAA;IACtB,aAAa,EAAE,IAAI,CAAA;IACnB,WAAW,EAAE,IAAI,CAAA;IACjB,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,YAAY,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9B;AAED,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,GAAG,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAA;AAE1E,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,IAAI,GAC9D,CAAC,KAAK,EAAE,CAAC,CAAC,GACV,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AAEpC;;;;;;;;;GASG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkD;;IAM5E;;;OAGG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,QAAQ,EACzB,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACpC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACjC,IAAI;IA2BP;;;OAGG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAiB1D;;;OAGG;IACH,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finite State Machine for player playback state transitions.
|
|
3
|
+
*
|
|
4
|
+
* The TRANSITIONS map defines all valid state transitions. The Proxy set trap
|
|
5
|
+
* in player-state.ts calls isValidTransition to enforce these rules.
|
|
6
|
+
*/
|
|
7
|
+
export type PlaybackState = 'idle' | 'loading' | 'playing' | 'paused' | 'buffering' | 'error' | 'ended';
|
|
8
|
+
/**
|
|
9
|
+
* Maps each state to the set of states it may transition into.
|
|
10
|
+
*
|
|
11
|
+
* Design notes:
|
|
12
|
+
* - idle -> loading: initial load or post-stall reload
|
|
13
|
+
* - loading -> playing | error: stream starts or fails
|
|
14
|
+
* - playing -> paused | buffering | ended | error: normal playback events
|
|
15
|
+
* - paused -> playing | loading | idle: resume or stop
|
|
16
|
+
* - buffering -> playing | paused | idle | error: buffer recovered, user pause, or stall
|
|
17
|
+
* - buffering -> idle is needed for the stall-watchdog recovery path (kick off reload)
|
|
18
|
+
* - buffering -> paused is needed for live stream support (user pauses during buffer)
|
|
19
|
+
* - error -> loading: retry after error
|
|
20
|
+
* - ended -> loading | idle: restart playback or reset
|
|
21
|
+
*/
|
|
22
|
+
export declare const TRANSITIONS: Readonly<Record<PlaybackState, ReadonlyArray<PlaybackState>>>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns true if transitioning from `from` to `to` is valid per the FSM.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isValidTransition(from: PlaybackState, to: PlaybackState): boolean;
|
|
27
|
+
//# sourceMappingURL=fsm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm.d.ts","sourceRoot":"","sources":["../../../src/core/fsm.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,GACX,OAAO,GACP,OAAO,CAAA;AAEX;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,CAQrF,CAAA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAEjF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight i18n module replacing Vue i18n.
|
|
3
|
+
*
|
|
4
|
+
* Translations are keyed using dot-notation (e.g., 'error.start').
|
|
5
|
+
* A KEY_MAP provides backward compatibility with the old full-sentence keys
|
|
6
|
+
* used in component/translations/ for Phase 2/3 compatibility.
|
|
7
|
+
*/
|
|
8
|
+
type LocaleMap = Record<string, string>;
|
|
9
|
+
type TranslationMap = Record<string, LocaleMap>;
|
|
10
|
+
/**
|
|
11
|
+
* KEY_MAP maps old full-sentence keys to new dot-notation keys.
|
|
12
|
+
* Provides Phase 2/3 backward compatibility with existing translation lookups.
|
|
13
|
+
*/
|
|
14
|
+
export declare const KEY_MAP: Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* I18n class provides translation and interpolation for the player UI.
|
|
17
|
+
* Designed to grow as skin components are ported in Phase 3.
|
|
18
|
+
*/
|
|
19
|
+
export declare class I18n {
|
|
20
|
+
private currentLocale;
|
|
21
|
+
private readonly translations;
|
|
22
|
+
constructor(locale?: string);
|
|
23
|
+
/**
|
|
24
|
+
* Add or extend translations at runtime.
|
|
25
|
+
* Useful for skin components adding their own translation keys in Phase 3.
|
|
26
|
+
*/
|
|
27
|
+
addTranslations(entries: TranslationMap): void;
|
|
28
|
+
/**
|
|
29
|
+
* Look up a translation key in the current locale.
|
|
30
|
+
* Falls back to English if not found in current locale.
|
|
31
|
+
* Falls back to the key string itself if not found in English either.
|
|
32
|
+
* Interpolates {variable} placeholders with provided values.
|
|
33
|
+
*/
|
|
34
|
+
t(key: string, vars?: Record<string, string | number>): string;
|
|
35
|
+
/**
|
|
36
|
+
* Replace {varName} placeholders in a template string with provided values.
|
|
37
|
+
* Unmatched placeholders are left unchanged.
|
|
38
|
+
*/
|
|
39
|
+
interpolate(template: string, vars: Record<string, string | number>): string;
|
|
40
|
+
/**
|
|
41
|
+
* Change the active locale for subsequent t() calls.
|
|
42
|
+
* Falls back to 'en' for unsupported locales.
|
|
43
|
+
*/
|
|
44
|
+
setLocale(locale: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Return the current active locale code.
|
|
47
|
+
*/
|
|
48
|
+
getLocale(): string;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/core/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACvC,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAqB/C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAE1C,CAAA;AAoBD;;;GAGG;AACH,qBAAa,IAAI;IACf,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;gBAEjC,MAAM,CAAC,EAAE,MAAM;IAK3B;;;OAGG;IACH,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAM9C;;;;;OAKG;IACH,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM;IAqB9D;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM;IAO5E;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,SAAS,IAAI,MAAM;CAGpB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* eb-player core public API barrel export.
|
|
3
|
+
*
|
|
4
|
+
* This file is the entry point for the Rollup build (rollup.config.ts).
|
|
5
|
+
* Import from this file to access all public core module exports.
|
|
6
|
+
*
|
|
7
|
+
* CSS import: base.css is imported here so Rollup's postcss plugin
|
|
8
|
+
* extracts it to dist/eb-player.css as part of the build.
|
|
9
|
+
*/
|
|
10
|
+
import './css/base.css';
|
|
11
|
+
export { PlaybackState, TRANSITIONS, isValidTransition } from './fsm';
|
|
12
|
+
export type { StateMap, Listener, PlayerState } from './types';
|
|
13
|
+
export { createPlayerState } from './player-state';
|
|
14
|
+
export { TypedEventBus } from './event-bus';
|
|
15
|
+
export type { EventMap } from './event-bus';
|
|
16
|
+
export { mergeConfig, DEFAULT_CONFIG } from './config';
|
|
17
|
+
export type { PlayerConfig, SkinColors, EngineSettings } from './config';
|
|
18
|
+
export { I18n } from './i18n';
|
|
19
|
+
export { PlayerController } from './lifecycle';
|
|
20
|
+
export { EngineStateSync } from './engine-state-sync';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,gBAAgB,CAAA;AAGvB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGrE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGlD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACtD,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAGxE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAG7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PlayerConfig } from '../core/config';
|
|
2
|
+
import type { PlayerState } from '../core/types';
|
|
3
|
+
import type { TypedEventBus } from '../core/event-bus';
|
|
4
|
+
/**
|
|
5
|
+
* AdsManager manages the IMA SDK preroll ad lifecycle.
|
|
6
|
+
*
|
|
7
|
+
* - Loads the IMA SDK from CDN via loadScript
|
|
8
|
+
* - Gates displayContainer.initialize() on a user gesture when config.autoplay is false
|
|
9
|
+
* (browser autoplay policy requirement — see Pitfall 2 in plan context)
|
|
10
|
+
* - Sets state.adPlaying based on IMA lifecycle events
|
|
11
|
+
* - Emits 'ad-complete' on TypedEventBus when all ads are done
|
|
12
|
+
* - Cleans up adsManager.destroy() and displayContainer.destroy() on abort
|
|
13
|
+
*/
|
|
14
|
+
export declare class AdsManager {
|
|
15
|
+
private imaAdsManager;
|
|
16
|
+
private imaDisplayContainer;
|
|
17
|
+
/**
|
|
18
|
+
* Initialize the IMA SDK preroll ad system.
|
|
19
|
+
* - Skips if config.preroll is false/undefined
|
|
20
|
+
* - If !config.autoplay: waits for user click on video element before initializing
|
|
21
|
+
* (required by browser autoplay policies to avoid muted/blocked display contexts)
|
|
22
|
+
* - Loads IMA SDK, creates AdDisplayContainer, AdsLoader, and AdsRequest
|
|
23
|
+
* - Wires ad lifecycle events to PlayerState and TypedEventBus
|
|
24
|
+
*/
|
|
25
|
+
init(config: PlayerConfig, state: PlayerState, bus: TypedEventBus, video: HTMLVideoElement, adsContainer: HTMLElement, signal: AbortSignal): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Wait for a click event on the video element.
|
|
28
|
+
* Used to satisfy browser autoplay policies when autoplay is disabled.
|
|
29
|
+
*/
|
|
30
|
+
private waitForUserGesture;
|
|
31
|
+
}
|
|
32
|
+
//# 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;;;;;;;;;GASG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,mBAAmB,CAAqC;IAEhE;;;;;;;OAOG;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;IAmEhB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CAgB3B"}
|
|
@@ -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,6 @@
|
|
|
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
|
+
//# 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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
//# 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;CAmD3D"}
|
|
@@ -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,64 @@
|
|
|
1
|
+
import { TypedEventBus } from './event-bus';
|
|
2
|
+
import { I18n } from './i18n';
|
|
3
|
+
import type { PlayerState } from './types';
|
|
4
|
+
import type { PlayerConfig } from './config';
|
|
5
|
+
import type { EngineStateSync } from './engine-state-sync';
|
|
6
|
+
/**
|
|
7
|
+
* PlayerController manages the complete lifecycle of a player instance.
|
|
8
|
+
*
|
|
9
|
+
* Lifecycle:
|
|
10
|
+
* 1. Construct with config
|
|
11
|
+
* 2. mount(container) — apply CSS vars, set data-theme, register listeners with AbortSignal
|
|
12
|
+
* 3. setEngineSync(sync) — attach engine bridge to state
|
|
13
|
+
* 4. dispose() — abort all listeners, detach engine, clear references
|
|
14
|
+
* 5. Optionally re-mount with a fresh container (dispose() creates a new AbortController)
|
|
15
|
+
*
|
|
16
|
+
* AbortController pattern:
|
|
17
|
+
* All listeners registered during mount() and setEngineSync() use the AbortController's
|
|
18
|
+
* signal. Calling dispose() aborts the signal, removing all registered listeners atomically.
|
|
19
|
+
* After dispose(), a fresh AbortController is created so the controller can be re-mounted.
|
|
20
|
+
*/
|
|
21
|
+
export declare class PlayerController {
|
|
22
|
+
readonly state: PlayerState;
|
|
23
|
+
readonly bus: TypedEventBus;
|
|
24
|
+
readonly config: PlayerConfig;
|
|
25
|
+
readonly i18n: I18n;
|
|
26
|
+
private abortController;
|
|
27
|
+
private _container;
|
|
28
|
+
private engineSync;
|
|
29
|
+
private get signal();
|
|
30
|
+
/**
|
|
31
|
+
* The currently mounted container element, or null if not mounted / after dispose().
|
|
32
|
+
* Available for Phase 2 engine implementations that need access to the DOM context.
|
|
33
|
+
*/
|
|
34
|
+
get container(): HTMLElement | null;
|
|
35
|
+
constructor(config: Partial<PlayerConfig>);
|
|
36
|
+
/**
|
|
37
|
+
* Attach the player to a DOM container element.
|
|
38
|
+
* Applies runtime CSS custom property overrides and sets the data-theme attribute
|
|
39
|
+
* for brand theming (backward compat with primaryColor/skinColors consumer API).
|
|
40
|
+
*
|
|
41
|
+
* CSS application order (later wins):
|
|
42
|
+
* 1. primaryColor → --eb-color-primary
|
|
43
|
+
* 2. skinColors.general → --eb-color-primary (overrides primaryColor)
|
|
44
|
+
* 3. skinColors.progressBar → --eb-color-progress
|
|
45
|
+
* 4. skinColors.volumeBar → --eb-color-volume
|
|
46
|
+
*/
|
|
47
|
+
mount(container: HTMLElement): void;
|
|
48
|
+
/**
|
|
49
|
+
* Attach an engine bridge implementation to the state store.
|
|
50
|
+
* If an existing engine is attached, detach() is called first.
|
|
51
|
+
* The engine receives the PlayerState and the current AbortSignal.
|
|
52
|
+
*/
|
|
53
|
+
setEngineSync(sync: EngineStateSync): void;
|
|
54
|
+
/**
|
|
55
|
+
* Dispose the player instance.
|
|
56
|
+
* - Calls engineSync.detach() if an engine is attached
|
|
57
|
+
* - Calls bus.dispose() to clear all event listeners
|
|
58
|
+
* - Aborts the AbortController (removes all signal-based listeners atomically)
|
|
59
|
+
* - Clears container and engine references
|
|
60
|
+
* - Creates a fresh AbortController for potential re-mount
|
|
61
|
+
*/
|
|
62
|
+
dispose(): void;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/core/lifecycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IAEnB,OAAO,CAAC,eAAe,CAAiB;IACxC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,UAAU,CAAwB;IAE1C,OAAO,KAAK,MAAM,GAEjB;IAED;;;OAGG;IACH,IAAI,SAAS,IAAI,WAAW,GAAG,IAAI,CAElC;gBAEW,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;IAUzC;;;;;;;;;;OAUG;IACH,KAAK,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI;IA6BnC;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAQ1C;;;;;;;OAOG;IACH,OAAO,IAAI,IAAI;CAehB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StateMap, PlayerState } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a Proxy-based reactive PlayerState instance.
|
|
4
|
+
*
|
|
5
|
+
* The Proxy set trap enforces three rules:
|
|
6
|
+
* 1. Non-plain objects (class instances) are rejected with a TypeError
|
|
7
|
+
* 2. `playbackState` assignments are validated via the FSM transition guard
|
|
8
|
+
* 3. Assigning the same value is a no-op (no subscriber notification)
|
|
9
|
+
*
|
|
10
|
+
* Subscribers are registered via `state.on('propertyName', callback, { signal })`.
|
|
11
|
+
* Pass an AbortController signal to clean up subscriptions automatically.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createPlayerState(initial?: Partial<StateMap>): PlayerState;
|
|
14
|
+
export type { PlayerState };
|
|
15
|
+
//# sourceMappingURL=player-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-state.d.ts","sourceRoot":"","sources":["../../../src/core/player-state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAY,WAAW,EAAE,MAAM,SAAS,CAAA;AA8E9D;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,WAAW,CAoD1E;AAED,YAAY,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -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"}
|