eb-player 2.1.5 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/ebplayer.bundle.js +19 -4
- package/dist/build/ebplayer.bundle.js.map +1 -1
- package/dist/build/types/src/eb-player.d.ts +4 -0
- package/dist/build/types/src/eb-player.d.ts.map +1 -1
- package/dist/build/types/src/skin/controls/settings-panel.d.ts.map +1 -1
- package/package.json +5 -2
- package/dist/build/theme-forja.js +0 -1
- package/dist/build/theme-radio.js +0 -1
- package/dist/build/theme-snrt.js +0 -1
- package/dist/build/types/config.d.ts +0 -139
- package/dist/build/types/config.d.ts.map +0 -1
- package/dist/build/types/core/command-handler.d.ts +0 -50
- package/dist/build/types/core/command-handler.d.ts.map +0 -1
- package/dist/build/types/core/config.d.ts +0 -187
- package/dist/build/types/core/config.d.ts.map +0 -1
- package/dist/build/types/core/css/theme-forja.entry.d.ts +0 -2
- package/dist/build/types/core/css/theme-forja.entry.d.ts.map +0 -1
- package/dist/build/types/core/css/theme-radio.entry.d.ts +0 -2
- package/dist/build/types/core/css/theme-radio.entry.d.ts.map +0 -1
- package/dist/build/types/core/css/theme-snrt.entry.d.ts +0 -2
- package/dist/build/types/core/css/theme-snrt.entry.d.ts.map +0 -1
- package/dist/build/types/core/engine-state-sync.d.ts +0 -38
- package/dist/build/types/core/engine-state-sync.d.ts.map +0 -1
- package/dist/build/types/core/event-bus.d.ts +0 -90
- package/dist/build/types/core/event-bus.d.ts.map +0 -1
- package/dist/build/types/core/fsm.d.ts +0 -30
- package/dist/build/types/core/fsm.d.ts.map +0 -1
- package/dist/build/types/core/i18n.d.ts +0 -51
- package/dist/build/types/core/i18n.d.ts.map +0 -1
- package/dist/build/types/core/index.d.ts +0 -23
- package/dist/build/types/core/index.d.ts.map +0 -1
- package/dist/build/types/core/lifecycle.d.ts +0 -96
- package/dist/build/types/core/lifecycle.d.ts.map +0 -1
- package/dist/build/types/core/player-state.d.ts +0 -15
- package/dist/build/types/core/player-state.d.ts.map +0 -1
- package/dist/build/types/core/types.d.ts +0 -85
- package/dist/build/types/core/types.d.ts.map +0 -1
- package/dist/build/types/eb-player-standalone.d.ts +0 -23
- package/dist/build/types/eb-player-standalone.d.ts.map +0 -1
- package/dist/build/types/eb-player.d.ts +0 -56
- package/dist/build/types/eb-player.d.ts.map +0 -1
- package/dist/build/types/engine-state-sync.d.ts +0 -38
- package/dist/build/types/engine-state-sync.d.ts.map +0 -1
- package/dist/build/types/engines/abr/dash.d.ts +0 -56
- package/dist/build/types/engines/abr/dash.d.ts.map +0 -1
- package/dist/build/types/engines/abr/hls.d.ts +0 -105
- package/dist/build/types/engines/abr/hls.d.ts.map +0 -1
- package/dist/build/types/engines/base-engine.d.ts +0 -72
- package/dist/build/types/engines/base-engine.d.ts.map +0 -1
- package/dist/build/types/engines/cdn-loader.d.ts +0 -20
- package/dist/build/types/engines/cdn-loader.d.ts.map +0 -1
- package/dist/build/types/engines/cdn-token-manager.d.ts +0 -137
- package/dist/build/types/engines/cdn-token-manager.d.ts.map +0 -1
- package/dist/build/types/engines/dash.d.ts +0 -79
- package/dist/build/types/engines/dash.d.ts.map +0 -1
- package/dist/build/types/engines/drm.d.ts +0 -54
- package/dist/build/types/engines/drm.d.ts.map +0 -1
- package/dist/build/types/engines/hls-discontinuity-patch.d.ts +0 -43
- package/dist/build/types/engines/hls-discontinuity-patch.d.ts.map +0 -1
- package/dist/build/types/engines/hls.d.ts +0 -53
- package/dist/build/types/engines/hls.d.ts.map +0 -1
- package/dist/build/types/engines/index.d.ts +0 -26
- package/dist/build/types/engines/index.d.ts.map +0 -1
- package/dist/build/types/engines/ios/hls.d.ts +0 -20
- package/dist/build/types/engines/ios/hls.d.ts.map +0 -1
- package/dist/build/types/engines/poster/hls.d.ts +0 -35
- package/dist/build/types/engines/poster/hls.d.ts.map +0 -1
- package/dist/build/types/engines/retry/dash.d.ts +0 -39
- package/dist/build/types/engines/retry/dash.d.ts.map +0 -1
- package/dist/build/types/engines/retry/hls.d.ts +0 -47
- package/dist/build/types/engines/retry/hls.d.ts.map +0 -1
- package/dist/build/types/engines/snapshot/dash.d.ts +0 -55
- package/dist/build/types/engines/snapshot/dash.d.ts.map +0 -1
- package/dist/build/types/engines/snapshot/hls.d.ts +0 -118
- package/dist/build/types/engines/snapshot/hls.d.ts.map +0 -1
- package/dist/build/types/engines/stall-watchdog.d.ts +0 -41
- package/dist/build/types/engines/stall-watchdog.d.ts.map +0 -1
- package/dist/build/types/event-bus.d.ts +0 -54
- package/dist/build/types/event-bus.d.ts.map +0 -1
- package/dist/build/types/fsm.d.ts +0 -27
- package/dist/build/types/fsm.d.ts.map +0 -1
- package/dist/build/types/i18n.d.ts +0 -51
- package/dist/build/types/i18n.d.ts.map +0 -1
- package/dist/build/types/index.d.ts +0 -21
- package/dist/build/types/index.d.ts.map +0 -1
- package/dist/build/types/integrations/ads-manager.d.ts +0 -37
- package/dist/build/types/integrations/ads-manager.d.ts.map +0 -1
- package/dist/build/types/integrations/chromecast-manager.d.ts +0 -50
- package/dist/build/types/integrations/chromecast-manager.d.ts.map +0 -1
- package/dist/build/types/integrations/epg-manager.d.ts +0 -22
- package/dist/build/types/integrations/epg-manager.d.ts.map +0 -1
- package/dist/build/types/integrations/index.d.ts +0 -7
- package/dist/build/types/integrations/index.d.ts.map +0 -1
- package/dist/build/types/integrations/intro-stream-manager.d.ts +0 -33
- package/dist/build/types/integrations/intro-stream-manager.d.ts.map +0 -1
- package/dist/build/types/integrations/p2p-manager.d.ts +0 -42
- package/dist/build/types/integrations/p2p-manager.d.ts.map +0 -1
- package/dist/build/types/integrations/playlist-manager.d.ts +0 -21
- package/dist/build/types/integrations/playlist-manager.d.ts.map +0 -1
- package/dist/build/types/lifecycle.d.ts +0 -64
- package/dist/build/types/lifecycle.d.ts.map +0 -1
- package/dist/build/types/player-state.d.ts +0 -15
- package/dist/build/types/player-state.d.ts.map +0 -1
- package/dist/build/types/skin/bars/bottom-bar.d.ts +0 -16
- package/dist/build/types/skin/bars/bottom-bar.d.ts.map +0 -1
- package/dist/build/types/skin/bars/middle-bar.d.ts +0 -16
- package/dist/build/types/skin/bars/middle-bar.d.ts.map +0 -1
- package/dist/build/types/skin/bars/top-bar.d.ts +0 -15
- package/dist/build/types/skin/bars/top-bar.d.ts.map +0 -1
- package/dist/build/types/skin/base-component.d.ts +0 -69
- package/dist/build/types/skin/base-component.d.ts.map +0 -1
- package/dist/build/types/skin/brand/forja-playlist-bar.d.ts +0 -15
- package/dist/build/types/skin/brand/forja-playlist-bar.d.ts.map +0 -1
- package/dist/build/types/skin/brand/snrt-radio-carousel.d.ts +0 -16
- package/dist/build/types/skin/brand/snrt-radio-carousel.d.ts.map +0 -1
- package/dist/build/types/skin/component-registry.d.ts +0 -16
- package/dist/build/types/skin/component-registry.d.ts.map +0 -1
- package/dist/build/types/skin/controllers/auto-hide.d.ts +0 -27
- package/dist/build/types/skin/controllers/auto-hide.d.ts.map +0 -1
- package/dist/build/types/skin/controllers/keyboard.d.ts +0 -29
- package/dist/build/types/skin/controllers/keyboard.d.ts.map +0 -1
- package/dist/build/types/skin/controls/cast-button.d.ts +0 -15
- package/dist/build/types/skin/controls/cast-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/channel-name.d.ts +0 -16
- package/dist/build/types/skin/controls/channel-name.d.ts.map +0 -1
- package/dist/build/types/skin/controls/forward-button.d.ts +0 -15
- package/dist/build/types/skin/controls/forward-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/fullscreen-button.d.ts +0 -30
- package/dist/build/types/skin/controls/fullscreen-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/info-button.d.ts +0 -10
- package/dist/build/types/skin/controls/info-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/live-sync-button.d.ts +0 -20
- package/dist/build/types/skin/controls/live-sync-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/pip-button.d.ts +0 -21
- package/dist/build/types/skin/controls/pip-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/play-pause-button.d.ts +0 -14
- package/dist/build/types/skin/controls/play-pause-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/rewind-button.d.ts +0 -15
- package/dist/build/types/skin/controls/rewind-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/seekbar.d.ts +0 -48
- package/dist/build/types/skin/controls/seekbar.d.ts.map +0 -1
- package/dist/build/types/skin/controls/settings-panel.d.ts +0 -53
- package/dist/build/types/skin/controls/settings-panel.d.ts.map +0 -1
- package/dist/build/types/skin/controls/share-button.d.ts +0 -11
- package/dist/build/types/skin/controls/share-button.d.ts.map +0 -1
- package/dist/build/types/skin/controls/time-display.d.ts +0 -19
- package/dist/build/types/skin/controls/time-display.d.ts.map +0 -1
- package/dist/build/types/skin/controls/volume-control.d.ts +0 -21
- package/dist/build/types/skin/controls/volume-control.d.ts.map +0 -1
- package/dist/build/types/skin/icons/icons-modern.d.ts +0 -10
- package/dist/build/types/skin/icons/icons-modern.d.ts.map +0 -1
- package/dist/build/types/skin/icons/icons.d.ts +0 -10
- package/dist/build/types/skin/icons/icons.d.ts.map +0 -1
- package/dist/build/types/skin/icons/sprite.d.ts +0 -39
- package/dist/build/types/skin/icons/sprite.d.ts.map +0 -1
- package/dist/build/types/skin/index.d.ts +0 -24
- package/dist/build/types/skin/index.d.ts.map +0 -1
- package/dist/build/types/skin/overlays/error-message.d.ts +0 -14
- package/dist/build/types/skin/overlays/error-message.d.ts.map +0 -1
- package/dist/build/types/skin/overlays/info-overlay.d.ts +0 -15
- package/dist/build/types/skin/overlays/info-overlay.d.ts.map +0 -1
- package/dist/build/types/skin/overlays/loading-spinner.d.ts +0 -17
- package/dist/build/types/skin/overlays/loading-spinner.d.ts.map +0 -1
- package/dist/build/types/skin/overlays/preroll-overlay.d.ts +0 -39
- package/dist/build/types/skin/overlays/preroll-overlay.d.ts.map +0 -1
- package/dist/build/types/skin/overlays/socials-overlay.d.ts +0 -17
- package/dist/build/types/skin/overlays/socials-overlay.d.ts.map +0 -1
- package/dist/build/types/skin/overlays/toast-notification.d.ts +0 -18
- package/dist/build/types/skin/overlays/toast-notification.d.ts.map +0 -1
- package/dist/build/types/skin/skin-root.d.ts +0 -88
- package/dist/build/types/skin/skin-root.d.ts.map +0 -1
- package/dist/build/types/types.d.ts +0 -41
- package/dist/build/types/types.d.ts.map +0 -1
- package/dist/build/types/utils/chapters.d.ts +0 -16
- package/dist/build/types/utils/chapters.d.ts.map +0 -1
- package/dist/build/types/utils/format-duration.d.ts +0 -9
- package/dist/build/types/utils/format-duration.d.ts.map +0 -1
- package/dist/build/types/utils/format-wall-clock.d.ts +0 -6
- package/dist/build/types/utils/format-wall-clock.d.ts.map +0 -1
- package/dist/build/types/utils/settings-helpers.d.ts +0 -41
- package/dist/build/types/utils/settings-helpers.d.ts.map +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
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 | buffering: resume or stop
|
|
16
|
-
* - paused -> buffering is needed when resuming a paused (live) stream where
|
|
17
|
-
* the browser fires 'waiting' before 'playing' (Safari live segment edge);
|
|
18
|
-
* without it the FSM strands at 'paused' while the video actually plays
|
|
19
|
-
* - buffering -> playing | paused | idle | error: buffer recovered, user pause, or stall
|
|
20
|
-
* - buffering -> idle is needed for the stall-watchdog recovery path (kick off reload)
|
|
21
|
-
* - buffering -> paused is needed for live stream support (user pauses during buffer)
|
|
22
|
-
* - error -> loading: retry after error
|
|
23
|
-
* - ended -> loading | idle: restart playback or reset
|
|
24
|
-
*/
|
|
25
|
-
export declare const TRANSITIONS: Readonly<Record<PlaybackState, ReadonlyArray<PlaybackState>>>;
|
|
26
|
-
/**
|
|
27
|
-
* Returns true if transitioning from `from` to `to` is valid per the FSM.
|
|
28
|
-
*/
|
|
29
|
-
export declare function isValidTransition(from: PlaybackState, to: PlaybackState): boolean;
|
|
30
|
-
//# sourceMappingURL=fsm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;;;;;GAgBG;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"}
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;AAwE/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"}
|
|
@@ -1,23 +0,0 @@
|
|
|
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 imports: base.css, theme files (auto-discovered via virtual:theme-css),
|
|
8
|
-
* and skin.css are imported here so Rollup's postcss plugin extracts them.
|
|
9
|
-
*/
|
|
10
|
-
import './css/base.css';
|
|
11
|
-
import 'virtual:theme-css';
|
|
12
|
-
import '../skin/css/skin.css';
|
|
13
|
-
export { PlaybackState, TRANSITIONS, isValidTransition } from './fsm';
|
|
14
|
-
export type { StateMap, Listener, PlayerState } from './types';
|
|
15
|
-
export { createPlayerState } from './player-state';
|
|
16
|
-
export { TypedEventBus } from './event-bus';
|
|
17
|
-
export type { EventMap } from './event-bus';
|
|
18
|
-
export { mergeConfig, DEFAULT_CONFIG, AVAILABLE_THEMES, THEME_LAYOUTS } from './config';
|
|
19
|
-
export type { PlayerConfig, SkinColors, EngineSettings } from './config';
|
|
20
|
-
export { I18n } from './i18n';
|
|
21
|
-
export { PlayerController } from './lifecycle';
|
|
22
|
-
export { EngineStateSync } from './engine-state-sync';
|
|
23
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,gBAAgB,CAAA;AACvB,OAAO,mBAAmB,CAAA;AAC1B,OAAO,sBAAsB,CAAA;AAG7B,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,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACvF,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"}
|
|
@@ -1,96 +0,0 @@
|
|
|
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
|
-
import type { SavedSelections } from './command-handler';
|
|
7
|
-
/**
|
|
8
|
-
* PlayerController manages the complete lifecycle of a player instance.
|
|
9
|
-
*
|
|
10
|
-
* Lifecycle:
|
|
11
|
-
* 1. Construct with config
|
|
12
|
-
* 2. mount(container) — apply CSS vars, set data-theme, create SkinRoot, initialize integrations
|
|
13
|
-
* 3. setEngineSync(sync) — attach engine bridge to state
|
|
14
|
-
* 4. dispose() — disconnect SkinRoot, abort all signals, detach engine, clear references
|
|
15
|
-
* 5. Optionally re-mount with a fresh container (dispose() creates a new AbortController)
|
|
16
|
-
*
|
|
17
|
-
* Mount order:
|
|
18
|
-
* 1. CSS vars / data-theme applied to container
|
|
19
|
-
* 2. Config-derived state (isRtl, isRadio) set
|
|
20
|
-
* 3. SkinRoot connected (needs DOM) — creates video element and ads container
|
|
21
|
-
* 4. AutoHideController + KeyboardController wired
|
|
22
|
-
* 5. Integrations initialized (need skin DOM for ads)
|
|
23
|
-
*
|
|
24
|
-
* Dispose order (reverse of mount):
|
|
25
|
-
* 1. Engine detached
|
|
26
|
-
* 2. Bus disposed
|
|
27
|
-
* 3. AbortController aborted (cleans up all signal-based listeners)
|
|
28
|
-
* 4. SkinRoot disconnected
|
|
29
|
-
* 5. References nulled
|
|
30
|
-
*/
|
|
31
|
-
export declare class PlayerController {
|
|
32
|
-
readonly state: PlayerState;
|
|
33
|
-
readonly bus: TypedEventBus;
|
|
34
|
-
readonly config: PlayerConfig;
|
|
35
|
-
readonly i18n: I18n;
|
|
36
|
-
private abortController;
|
|
37
|
-
private _container;
|
|
38
|
-
private engineSync;
|
|
39
|
-
private skinRoot;
|
|
40
|
-
private commandHandler;
|
|
41
|
-
private chromecastManager;
|
|
42
|
-
private reloadCallback;
|
|
43
|
-
get signal(): AbortSignal;
|
|
44
|
-
/**
|
|
45
|
-
* The currently mounted container element, or null if not mounted / after dispose().
|
|
46
|
-
* Available for Phase 2 engine implementations that need access to the DOM context.
|
|
47
|
-
*/
|
|
48
|
-
get container(): HTMLElement | null;
|
|
49
|
-
constructor(config: Partial<PlayerConfig>);
|
|
50
|
-
/**
|
|
51
|
-
* Attach the player to a DOM container element.
|
|
52
|
-
*
|
|
53
|
-
* Applies CSS vars and data-theme, creates the SkinRoot DOM scaffold,
|
|
54
|
-
* registers AutoHide/Keyboard controllers, and initializes integration
|
|
55
|
-
* managers based on config flags.
|
|
56
|
-
*
|
|
57
|
-
* CSS application order (later wins):
|
|
58
|
-
* 1. primaryColor → --eb-color-primary
|
|
59
|
-
* 2. skinColors.general → --eb-color-primary (overrides primaryColor)
|
|
60
|
-
* 3. skinColors.progressBar → --eb-color-progress
|
|
61
|
-
* 4. skinColors.volumeBar → --eb-color-volume
|
|
62
|
-
*/
|
|
63
|
-
mount(container: HTMLElement): void;
|
|
64
|
-
/**
|
|
65
|
-
* Store a callback to invoke when request-reload fires.
|
|
66
|
-
* Called by eb-player.ts after mount() to wire the reload orchestration path.
|
|
67
|
-
*/
|
|
68
|
-
setReloadCallback(callback: () => void): void;
|
|
69
|
-
/**
|
|
70
|
-
* Returns saved stream selections from the CommandHandler (quality, audioTrack, subtitleTrack).
|
|
71
|
-
* Returns defaults when no CommandHandler exists (e.g., noUi mode, no video element).
|
|
72
|
-
*/
|
|
73
|
-
getSavedSelections(): SavedSelections;
|
|
74
|
-
/**
|
|
75
|
-
* Attach an engine bridge implementation to the state store.
|
|
76
|
-
* If an existing engine is attached, detach() is called first.
|
|
77
|
-
* The engine receives the PlayerState and the current AbortSignal.
|
|
78
|
-
*/
|
|
79
|
-
setEngineSync(sync: EngineStateSync): void;
|
|
80
|
-
/**
|
|
81
|
-
* Dispose the player instance.
|
|
82
|
-
* - Calls engineSync.detach() if an engine is attached
|
|
83
|
-
* - Calls bus.dispose() to clear all event listeners
|
|
84
|
-
* - Aborts the AbortController (removes all signal-based listeners atomically)
|
|
85
|
-
* - Disconnects SkinRoot
|
|
86
|
-
* - Clears all references
|
|
87
|
-
* - Creates a fresh AbortController for potential re-mount
|
|
88
|
-
*/
|
|
89
|
-
dispose(): void;
|
|
90
|
-
/**
|
|
91
|
-
* Initialize integration managers based on config flags.
|
|
92
|
-
* All integrations are async and non-critical — errors are caught and logged.
|
|
93
|
-
*/
|
|
94
|
-
private initIntegrations;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAW7B,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,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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;IAC1C,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,cAAc,CAAqB;IAE3C,IAAI,MAAM,IAAI,WAAW,CAExB;IAED;;;OAGG;IACH,IAAI,SAAS,IAAI,WAAW,GAAG,IAAI,CAElC;gBAEW,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;IAczC;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI;IAwFnC;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAI7C;;;OAGG;IACH,kBAAkB,IAAI,eAAe;IAOrC;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAQ1C;;;;;;;;OAQG;IACH,OAAO,IAAI,IAAI;IAwBf;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAqFzB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;AAqG9D;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,WAAW,CAyD1E;AAED,YAAY,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { PlaybackState } from './fsm';
|
|
2
|
-
/**
|
|
3
|
-
* A single EPG (Electronic Program Guide) entry.
|
|
4
|
-
*/
|
|
5
|
-
export interface EpgProgram {
|
|
6
|
-
title: string;
|
|
7
|
-
start: number;
|
|
8
|
-
end: number;
|
|
9
|
-
lang: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A chapter marker within the video timeline.
|
|
13
|
-
*/
|
|
14
|
-
export interface ChapterMark {
|
|
15
|
-
title: string;
|
|
16
|
-
startTime: number;
|
|
17
|
-
endTime: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* A single item in a playlist.
|
|
21
|
-
*/
|
|
22
|
-
export interface PlaylistItem {
|
|
23
|
-
src: string;
|
|
24
|
-
title: string;
|
|
25
|
-
image: string;
|
|
26
|
-
duration: number;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* The complete map of all reactive state properties in the player.
|
|
30
|
-
* Used by PlayerState (Proxy-based reactive store).
|
|
31
|
-
*/
|
|
32
|
-
export interface StateMap {
|
|
33
|
-
playbackState: PlaybackState;
|
|
34
|
-
volume: number;
|
|
35
|
-
currentTime: number;
|
|
36
|
-
duration: number;
|
|
37
|
-
muted: boolean;
|
|
38
|
-
bufferedEnd: number;
|
|
39
|
-
isLive: boolean;
|
|
40
|
-
qualityLevels: unknown[];
|
|
41
|
-
currentQuality: number;
|
|
42
|
-
audioTracks: unknown[];
|
|
43
|
-
currentAudioTrack: number;
|
|
44
|
-
subtitleTracks: unknown[];
|
|
45
|
-
currentSubtitleTrack: number;
|
|
46
|
-
playbackRate: number;
|
|
47
|
-
error: string | null;
|
|
48
|
-
src: string;
|
|
49
|
-
isFullscreen: boolean;
|
|
50
|
-
isPip: boolean;
|
|
51
|
-
isCasting: boolean;
|
|
52
|
-
controlsVisible: boolean;
|
|
53
|
-
settingsOpen: boolean;
|
|
54
|
-
socialsOpen: boolean;
|
|
55
|
-
infoOpen: boolean;
|
|
56
|
-
adPlaying: boolean;
|
|
57
|
-
introStreamPlaying: boolean;
|
|
58
|
-
castAvailable: boolean;
|
|
59
|
-
isRtl: boolean;
|
|
60
|
-
isRadio: boolean;
|
|
61
|
-
isIOS: boolean;
|
|
62
|
-
isSyncWithLive: boolean;
|
|
63
|
-
epgPrograms: EpgProgram[];
|
|
64
|
-
epgFetchedAt: number;
|
|
65
|
-
chapters: ChapterMark[];
|
|
66
|
-
playlist: PlaylistItem[];
|
|
67
|
-
currentEpisode: number;
|
|
68
|
-
reconnecting: boolean;
|
|
69
|
-
toast: string | null;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Per-property subscriber callback type.
|
|
73
|
-
* Receives the new value and the previous value.
|
|
74
|
-
*/
|
|
75
|
-
export type Listener<T> = (value: T, prev: T) => void;
|
|
76
|
-
/**
|
|
77
|
-
* The public interface for the player state object.
|
|
78
|
-
* Combines all state properties with the subscription method.
|
|
79
|
-
*/
|
|
80
|
-
export type PlayerState = StateMap & {
|
|
81
|
-
on: <K extends keyof StateMap>(key: K, listener: Listener<StateMap[K]>, options?: {
|
|
82
|
-
signal?: AbortSignal;
|
|
83
|
-
}) => void;
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;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cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,QAAQ,EAAE,YAAY,EAAE,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IAGtB,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;AAErD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG;IACnC,EAAE,EAAE,CAAC,CAAC,SAAS,MAAM,QAAQ,EAC3B,GAAG,EAAE,CAAC,EACN,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC/B,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,KAC/B,IAAI,CAAA;CACV,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Standalone entry point — used for the generated player bundle (not the npm UMD build).
|
|
3
|
-
*
|
|
4
|
-
* This file is resolved by Rollup with @rollup/plugin-virtual injecting the brand config
|
|
5
|
-
* from 'virtual:brand-config' at build time.
|
|
6
|
-
*
|
|
7
|
-
* The exported start() wraps eb-player's start() to merge the brand config as a base,
|
|
8
|
-
* so consumers calling window.EBPlayer.start({src: '...'}) inherit brand settings
|
|
9
|
-
* (skin, colors, tokens, etc.) without having to repeat them.
|
|
10
|
-
*
|
|
11
|
-
* Import chain:
|
|
12
|
-
* eb-player-standalone.ts → eb-player.ts (facade) + virtual:brand-config (brand config)
|
|
13
|
-
*/
|
|
14
|
-
export { stop, destroy } from './eb-player';
|
|
15
|
-
import type { PlayerConfig } from './core/config';
|
|
16
|
-
import type { PlayerReference } from './eb-player';
|
|
17
|
-
/**
|
|
18
|
-
* Start the player with brand config as the base layer.
|
|
19
|
-
* Consumer's runtimeConfig overrides brand values, which override DEFAULT_CONFIG.
|
|
20
|
-
* Merge order: DEFAULT_CONFIG → brandConfig → runtimeConfig
|
|
21
|
-
*/
|
|
22
|
-
export declare function start(runtimeConfig?: Partial<PlayerConfig>): PlayerReference;
|
|
23
|
-
//# sourceMappingURL=eb-player-standalone.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eb-player-standalone.d.ts","sourceRoot":"","sources":["../../../src/eb-player-standalone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAQlD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,eAAe,CAG5E"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EBPlayer facade — consumer-facing API layer.
|
|
3
|
-
*
|
|
4
|
-
* Provides the window.EBPlayer interface:
|
|
5
|
-
* - window.EBPlayer.start(config) — synchronously returns a PlayerReference
|
|
6
|
-
* - window.EBPlayer.stop() — detaches all active engines (skins stay mounted)
|
|
7
|
-
* - window.EBPlayer.destroy() — disposes all controllers (tears down everything)
|
|
8
|
-
*
|
|
9
|
-
* Supports multiple simultaneous player instances on the same page.
|
|
10
|
-
* Each instance is keyed by its container element:
|
|
11
|
-
* - Calling start() with the SAME container disposes the old instance first (backward compat).
|
|
12
|
-
* - Calling start() with a DIFFERENT container creates an independent player.
|
|
13
|
-
*
|
|
14
|
-
* Per-instance cleanup is available via PlayerReference.destroy().
|
|
15
|
-
* Global stop()/destroy() operate on all instances at once.
|
|
16
|
-
*/
|
|
17
|
-
import type { PlayerState } from './core/types';
|
|
18
|
-
import type { PlayerConfig } from './core/config';
|
|
19
|
-
/**
|
|
20
|
-
* The PlayerReference returned by start().
|
|
21
|
-
* Gives consumers direct control over the active stream.
|
|
22
|
-
*/
|
|
23
|
-
export interface PlayerReference {
|
|
24
|
-
/** Open a stream URL. Detects protocol from extension (.m3u8 → HLS, .mpd → DASH). */
|
|
25
|
-
open(src: string): void;
|
|
26
|
-
/** Close the active stream (detaches engine; skin remains mounted). */
|
|
27
|
-
close(): void;
|
|
28
|
-
/** Destroy this player instance completely (tears down skin, events, and all resources). */
|
|
29
|
-
destroy(): void;
|
|
30
|
-
/** Current player state (read-only reference to the reactive state store). */
|
|
31
|
-
readonly state: PlayerState;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Start the player with the given config.
|
|
35
|
-
*
|
|
36
|
-
* If a player is already mounted on the same container element, it is disposed
|
|
37
|
-
* before the new one is created (backward-compatible single-instance behavior).
|
|
38
|
-
* If the container is different, the new player coexists alongside existing ones
|
|
39
|
-
* (multi-instance support).
|
|
40
|
-
*
|
|
41
|
-
* Returns a PlayerReference synchronously — never returns a Promise.
|
|
42
|
-
*/
|
|
43
|
-
export declare function start(runtimeConfig: Partial<PlayerConfig>): PlayerReference;
|
|
44
|
-
/**
|
|
45
|
-
* Stop all active streams.
|
|
46
|
-
* Detaches engines without disposing controllers (skins stay mounted).
|
|
47
|
-
* For single-instance usage this behaves identically to the old global stop().
|
|
48
|
-
*/
|
|
49
|
-
export declare function stop(): void;
|
|
50
|
-
/**
|
|
51
|
-
* Destroy all player instances completely.
|
|
52
|
-
* Disposes every controller (tears down skin, events, and all resources).
|
|
53
|
-
* For single-instance usage this behaves identically to the old global destroy().
|
|
54
|
-
*/
|
|
55
|
-
export declare function destroy(): void;
|
|
56
|
-
//# sourceMappingURL=eb-player.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eb-player.d.ts","sourceRoot":"","sources":["../../../src/eb-player.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAWH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,qFAAqF;IACrF,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,uEAAuE;IACvE,KAAK,IAAI,IAAI,CAAA;IACb,4FAA4F;IAC5F,OAAO,IAAI,IAAI,CAAA;IACf,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;CAC5B;AA0GD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,eAAe,CA8V3E;AAED;;;;GAIG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAO3B;AAED;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAK9B"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { PlayerState } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* EngineStateSync is the abstract base class defining the contract for Phase 2
|
|
4
|
-
* engine bridge implementations (HLS, DASH).
|
|
5
|
-
*
|
|
6
|
-
* Phase 2 HLS and DASH engines extend this class to bridge DOM video events
|
|
7
|
-
* to the PlayerState store. The attach() method receives the PlayerState and
|
|
8
|
-
* an AbortSignal for automatic cleanup — engines register video element
|
|
9
|
-
* event listeners using the signal to ensure zero-leak cleanup on dispose().
|
|
10
|
-
*
|
|
11
|
-
* Usage pattern in Phase 2:
|
|
12
|
-
* class HlsEngineSync extends EngineStateSync {
|
|
13
|
-
* attach(state: PlayerState, signal: AbortSignal): void {
|
|
14
|
-
* video.addEventListener('timeupdate', () => { state.currentTime = video.currentTime }, { signal })
|
|
15
|
-
* }
|
|
16
|
-
* detach(): void {
|
|
17
|
-
* this.driver?.destroy()
|
|
18
|
-
* }
|
|
19
|
-
* }
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class EngineStateSync {
|
|
22
|
-
/**
|
|
23
|
-
* Called by PlayerController.setEngineSync() to bridge engine events to state.
|
|
24
|
-
* Implementations should register all event listeners using { signal } so they
|
|
25
|
-
* are automatically removed when the AbortController is aborted on dispose().
|
|
26
|
-
*
|
|
27
|
-
* @param state - The reactive PlayerState to write engine events into
|
|
28
|
-
* @param signal - AbortSignal tied to the PlayerController's lifecycle
|
|
29
|
-
*/
|
|
30
|
-
abstract attach(state: PlayerState, signal: AbortSignal): void;
|
|
31
|
-
/**
|
|
32
|
-
* Called by PlayerController.dispose() or when a new engine replaces this one.
|
|
33
|
-
* Implementations should clean up engine-specific resources (e.g., driver.destroy()).
|
|
34
|
-
* Signal-based event listeners are automatically removed by the AbortController.
|
|
35
|
-
*/
|
|
36
|
-
abstract detach(): void;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=engine-state-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"engine-state-sync.d.ts","sourceRoot":"","sources":["../../../src/core/engine-state-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,8BAAsB,eAAe;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAE9D;;;;OAIG;IACH,QAAQ,CAAC,MAAM,IAAI,IAAI;CACxB"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DASH Custom ABR Rule
|
|
3
|
-
*
|
|
4
|
-
* Ported from component/engines/abr/dash.js
|
|
5
|
-
*
|
|
6
|
-
* Implements a buffer-and-throughput aware adaptive bitrate rule for dash.js.
|
|
7
|
-
* Applied via driver.addABRCustomRule('qualitySwitchRules', 'CustomAbrRule', factory).
|
|
8
|
-
*/
|
|
9
|
-
interface SwitchRequestInstance {
|
|
10
|
-
quality: number;
|
|
11
|
-
reason: string;
|
|
12
|
-
priority: number;
|
|
13
|
-
}
|
|
14
|
-
interface SwitchRequestFactory {
|
|
15
|
-
(context: unknown): {
|
|
16
|
-
create: () => SwitchRequestInstance;
|
|
17
|
-
};
|
|
18
|
-
PRIORITY: {
|
|
19
|
-
STRONG: number;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
interface SingletonFactory<T> {
|
|
23
|
-
(context: unknown): {
|
|
24
|
-
getInstance: () => T;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
interface AbrControllerInstance {
|
|
28
|
-
getQualityFor: (mediaType: string, streamInfo: unknown) => number;
|
|
29
|
-
}
|
|
30
|
-
interface RulesContextInstance {
|
|
31
|
-
getMediaInfo: () => {
|
|
32
|
-
type: string;
|
|
33
|
-
bitrateList: Array<{
|
|
34
|
-
bandwidth: number;
|
|
35
|
-
}>;
|
|
36
|
-
representationCount: number;
|
|
37
|
-
};
|
|
38
|
-
getAbrController: () => AbrControllerInstance;
|
|
39
|
-
}
|
|
40
|
-
interface FactoryMakerLike {
|
|
41
|
-
getClassFactoryByName: (name: string) => SwitchRequestFactory;
|
|
42
|
-
getSingletonFactoryByName: (name: string) => SingletonFactory<unknown>;
|
|
43
|
-
getClassFactory: (fn: AbrRuleFunction) => unknown;
|
|
44
|
-
}
|
|
45
|
-
interface AbrRuleFunction {
|
|
46
|
-
(): {
|
|
47
|
-
getMaxIndex: (rulesContext: RulesContextInstance) => SwitchRequestInstance;
|
|
48
|
-
};
|
|
49
|
-
__dashjs_factory_name: string;
|
|
50
|
-
}
|
|
51
|
-
export interface DashjsForAbr {
|
|
52
|
-
FactoryMaker: FactoryMakerLike;
|
|
53
|
-
}
|
|
54
|
-
export declare function createDashAbrRule(dashjs: DashjsForAbr): unknown;
|
|
55
|
-
export {};
|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AY,EAAE,oBAAoB,KAAK,qBAAqB,CAAA;KAAE,CAAA;IAClF,qBAAqB,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,gBAAgB,CAAA;CAC/B;AAyCD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAwJ/D"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom HLS ABR controller.
|
|
3
|
-
*
|
|
4
|
-
* Ported from component/engines/abr/hls.js (509 LOC).
|
|
5
|
-
*
|
|
6
|
-
* Creates a class that extends hls.js's built-in ABR controller and overrides
|
|
7
|
-
* nextAutoLevel with bandwidth-aware and buffer-level-based quality selection.
|
|
8
|
-
*
|
|
9
|
-
* Usage: pass the result as `abrController` in the Hls constructor config.
|
|
10
|
-
*
|
|
11
|
-
* Note: hls.js internals are accessed via type assertions because the library
|
|
12
|
-
* does not export its internal controller types (Open Question 3 in RESEARCH.md).
|
|
13
|
-
*/
|
|
14
|
-
interface AbrHlsLevel {
|
|
15
|
-
bitrate: number;
|
|
16
|
-
loaded?: {
|
|
17
|
-
bytes: number;
|
|
18
|
-
duration: number;
|
|
19
|
-
};
|
|
20
|
-
realBitrate?: number;
|
|
21
|
-
}
|
|
22
|
-
interface AbrHlsMedia {
|
|
23
|
-
currentTime: number;
|
|
24
|
-
playbackRate: number;
|
|
25
|
-
paused: boolean;
|
|
26
|
-
readyState: number;
|
|
27
|
-
}
|
|
28
|
-
interface AbrHlsConfig {
|
|
29
|
-
maxBufferLength: number;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
|
-
interface AbrHlsInstance {
|
|
33
|
-
on: (event: string, handler: (event: string, data: unknown) => void, context?: unknown) => void;
|
|
34
|
-
off: (event: string, handler: (event: string, data: unknown) => void, context?: unknown) => void;
|
|
35
|
-
levels: AbrHlsLevel[];
|
|
36
|
-
currentLevel: number;
|
|
37
|
-
media: AbrHlsMedia | null;
|
|
38
|
-
config: AbrHlsConfig;
|
|
39
|
-
autoLevelEnabled?: boolean;
|
|
40
|
-
}
|
|
41
|
-
interface AbrHlsEvents {
|
|
42
|
-
FRAG_LOADING: string;
|
|
43
|
-
FRAG_LOADED: string;
|
|
44
|
-
FRAG_BUFFERED: string;
|
|
45
|
-
LEVEL_LOADED: string;
|
|
46
|
-
ERROR: string;
|
|
47
|
-
}
|
|
48
|
-
interface AbrHlsConstructorLike {
|
|
49
|
-
Events: AbrHlsEvents;
|
|
50
|
-
DefaultConfig: {
|
|
51
|
-
abrController?: AbrControllerConstructor;
|
|
52
|
-
[key: string]: unknown;
|
|
53
|
-
};
|
|
54
|
-
[key: string]: unknown;
|
|
55
|
-
}
|
|
56
|
-
interface AbrControllerConstructor {
|
|
57
|
-
new (hlsInstance: AbrHlsInstance, ...args: unknown[]): AbrControllerInstance;
|
|
58
|
-
prototype: AbrControllerInstance;
|
|
59
|
-
}
|
|
60
|
-
interface AbrControllerInstance {
|
|
61
|
-
hls: AbrHlsInstance;
|
|
62
|
-
destroy(): void;
|
|
63
|
-
registerListeners?: () => void;
|
|
64
|
-
unregisterListeners?: () => void;
|
|
65
|
-
clearTimer?: () => void;
|
|
66
|
-
fragCurrent?: HlsFragment | null;
|
|
67
|
-
partCurrent?: HlsFragPart | null;
|
|
68
|
-
timer?: ReturnType<typeof setInterval> | undefined;
|
|
69
|
-
onCheck?: () => void;
|
|
70
|
-
[key: string]: unknown;
|
|
71
|
-
}
|
|
72
|
-
interface HlsFragment {
|
|
73
|
-
type: string;
|
|
74
|
-
sn: number | 'initSegment';
|
|
75
|
-
level: number;
|
|
76
|
-
duration: number;
|
|
77
|
-
stats: HlsFragStats;
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
}
|
|
80
|
-
interface HlsFragPart {
|
|
81
|
-
duration: number;
|
|
82
|
-
stats: HlsFragStats;
|
|
83
|
-
}
|
|
84
|
-
interface HlsFragStats {
|
|
85
|
-
loading: {
|
|
86
|
-
start: number;
|
|
87
|
-
};
|
|
88
|
-
parsing: {
|
|
89
|
-
end: number;
|
|
90
|
-
};
|
|
91
|
-
loaded: number;
|
|
92
|
-
tload?: number;
|
|
93
|
-
tfirst?: number;
|
|
94
|
-
trequest?: number;
|
|
95
|
-
aborted?: boolean;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Factory that creates a custom ABR controller class extending hls.js's built-in
|
|
99
|
-
* ABR controller. Takes the Hls constructor so it can access Events and DefaultConfig.
|
|
100
|
-
*
|
|
101
|
-
* The returned class can be passed as `abrController` in the Hls constructor config.
|
|
102
|
-
*/
|
|
103
|
-
export declare function createHlsAbrController(HlsConstructor: AbrHlsConstructorLike): AbrControllerConstructor;
|
|
104
|
-
export {};
|
|
105
|
-
//# sourceMappingURL=hls.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hls.d.ts","sourceRoot":"","sources":["../../../../../src/engines/abr/hls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAqBH,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,UAAU,YAAY;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,UAAU,cAAc;IACtB,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,OAAO,CAAC,E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