@openplayerjs/player 3.0.0-beta.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +453 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/index.js +2178 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/openplayer.css +1 -0
  7. package/dist/openplayer.umd.js +2 -0
  8. package/dist/openplayer.umd.js.map +1 -0
  9. package/dist/types/a11y.d.ts +7 -0
  10. package/dist/types/a11y.d.ts.map +1 -0
  11. package/dist/types/configuration.d.ts +52 -0
  12. package/dist/types/configuration.d.ts.map +1 -0
  13. package/dist/types/control.d.ts +21 -0
  14. package/dist/types/control.d.ts.map +1 -0
  15. package/dist/types/controls/base.d.ts +27 -0
  16. package/dist/types/controls/base.d.ts.map +1 -0
  17. package/dist/types/controls/captions.d.ts +11 -0
  18. package/dist/types/controls/captions.d.ts.map +1 -0
  19. package/dist/types/controls/currentTime.d.ts +9 -0
  20. package/dist/types/controls/currentTime.d.ts.map +1 -0
  21. package/dist/types/controls/duration.d.ts +9 -0
  22. package/dist/types/controls/duration.d.ts.map +1 -0
  23. package/dist/types/controls/fullscreen.d.ts +13 -0
  24. package/dist/types/controls/fullscreen.d.ts.map +1 -0
  25. package/dist/types/controls/play.d.ts +9 -0
  26. package/dist/types/controls/play.d.ts.map +1 -0
  27. package/dist/types/controls/progress.d.ts +11 -0
  28. package/dist/types/controls/progress.d.ts.map +1 -0
  29. package/dist/types/controls/settings.d.ts +20 -0
  30. package/dist/types/controls/settings.d.ts.map +1 -0
  31. package/dist/types/controls/time.d.ts +9 -0
  32. package/dist/types/controls/time.d.ts.map +1 -0
  33. package/dist/types/controls/volume.d.ts +9 -0
  34. package/dist/types/controls/volume.d.ts.map +1 -0
  35. package/dist/types/events.d.ts +4 -0
  36. package/dist/types/events.d.ts.map +1 -0
  37. package/dist/types/extend.d.ts +7 -0
  38. package/dist/types/extend.d.ts.map +1 -0
  39. package/dist/types/index.d.ts +29 -0
  40. package/dist/types/index.d.ts.map +1 -0
  41. package/dist/types/overlay.d.ts +11 -0
  42. package/dist/types/overlay.d.ts.map +1 -0
  43. package/dist/types/playback.d.ts +4 -0
  44. package/dist/types/playback.d.ts.map +1 -0
  45. package/dist/types/settings.d.ts +25 -0
  46. package/dist/types/settings.d.ts.map +1 -0
  47. package/dist/types/ui.d.ts +11 -0
  48. package/dist/types/ui.d.ts.map +1 -0
  49. package/dist/types/umd.d.ts +55 -0
  50. package/dist/types/umd.d.ts.map +1 -0
  51. package/package.json +50 -0
@@ -0,0 +1,52 @@
1
+ import type { Core, PlayerConfig } from '@openplayerjs/core';
2
+ /**
3
+ * UI configuration augments `@openplayerjs/core`'s `PlayerConfig` when `@openplayerjs/ui` is installed.
4
+ *
5
+ * This keeps `@openplayerjs/core` focused on runtime / engine concerns, while UI packages own
6
+ * sizing, label strings, keyboard seek step and progress interaction flags.
7
+ */
8
+ export type PlayerUIConfig = PlayerConfig & {
9
+ labels?: Record<string, string>;
10
+ width?: string | number;
11
+ height?: string | number;
12
+ step?: number;
13
+ allowSkip?: boolean;
14
+ allowRewind?: boolean;
15
+ };
16
+ export declare const defaultUIConfiguration: Required<Pick<PlayerUIConfig, 'step' | 'allowSkip' | 'allowRewind'>>;
17
+ export declare const defaultLabels: Readonly<{
18
+ auto: "Auto";
19
+ captions: "CC/Subtitles";
20
+ click: "Click to unmute";
21
+ container: "Media player";
22
+ fullscreen: "Fullscreen";
23
+ levels: "Quality Levels";
24
+ live: "Live";
25
+ loading: "Loading...";
26
+ media: "Media";
27
+ mute: "Mute";
28
+ off: "Off";
29
+ pause: "Pause";
30
+ play: "Play";
31
+ progressRail: "Time Rail";
32
+ progressSlider: "Time Slider";
33
+ settings: "Player Settings";
34
+ speed: "Speed";
35
+ speedNormal: "Normal";
36
+ tap: "Tap to unmute";
37
+ toggleCaptions: "Toggle Captions";
38
+ unmute: "Unmute";
39
+ volume: "Volume";
40
+ volumeControl: "Volume Control";
41
+ volumeSlider: "Volume Slider";
42
+ }>;
43
+ export type ResolvedUIConfig = {
44
+ allowSkip: boolean;
45
+ allowRewind: boolean;
46
+ step: number;
47
+ width?: string | number;
48
+ height?: string | number;
49
+ labels: Record<string, string>;
50
+ };
51
+ export declare function resolveUIConfig(coreOrConfig: Core | PlayerConfig): ResolvedUIConfig;
52
+ //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,CAIvG,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EAyBxB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,wBAAgB,eAAe,CAAC,YAAY,EAAE,IAAI,GAAG,YAAY,GAAG,gBAAgB,CAwBnF"}
@@ -0,0 +1,21 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ export type VerticalSlot = 'top' | 'middle' | 'bottom';
3
+ export type HorizontalSlot = 'left' | 'center' | 'right';
4
+ export type ControlPlacement = {
5
+ v: VerticalSlot;
6
+ h: HorizontalSlot;
7
+ region?: 'main';
8
+ };
9
+ export type Control = {
10
+ id: string;
11
+ placement: ControlPlacement;
12
+ create(core: Core): HTMLElement;
13
+ destroy?(): void;
14
+ };
15
+ export declare function createControlGrid(controlsRoot: HTMLElement, mainRoot?: HTMLElement): {
16
+ place(placement: Control["placement"], el: HTMLElement): void;
17
+ };
18
+ export declare function registerControl(name: string, factory: () => Control): void;
19
+ export declare function getControl(name: string): Control | null;
20
+ export declare function buildControls(config: any): Control[];
21
+ //# sourceMappingURL=control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,cAAc,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,gBAAgB,CAAC;IAE5B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,CAAC;IAChC,OAAO,CAAC,IAAI,IAAI,CAAC;CAClB,CAAC;AAyCF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,WAAW;qBAQ9D,OAAO,CAAC,WAAW,CAAC,MAAM,WAAW;EAczD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,QAEnE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAGvD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,aAkBxC"}
@@ -0,0 +1,27 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ import { DisposableStore, getOverlayManager, type OverlayState } from '@openplayerjs/core';
3
+ import type { Control } from '../control';
4
+ export type ControlPlacementV = 'top' | 'center' | 'bottom';
5
+ export type ControlPlacementH = 'left' | 'center' | 'right';
6
+ export type ControlPlacement = {
7
+ v: ControlPlacementV;
8
+ h: ControlPlacementH;
9
+ };
10
+ export declare abstract class BaseControl implements Control {
11
+ abstract id: string;
12
+ abstract placement: Control['placement'];
13
+ protected core: Core;
14
+ protected overlayMgr: ReturnType<typeof getOverlayManager>;
15
+ protected activeOverlay: OverlayState | null;
16
+ protected dispose: DisposableStore;
17
+ protected abstract build(): HTMLElement;
18
+ protected onOverlayChanged(_ov: OverlayState | null): void;
19
+ create(core: Core): HTMLElement;
20
+ destroy(): void;
21
+ protected onPlayer(event: any, cb: (...args: any[]) => void): import("@openplayerjs/core").Disposer;
22
+ protected listen(target: EventTarget, type: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): import("@openplayerjs/core").Disposer;
23
+ protected resolvePlayerRoot(): HTMLElement;
24
+ protected resolveFullscreenContainer(): HTMLElement;
25
+ protected resolveFullscreenVideoEl(): HTMLElement | null;
26
+ }
27
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/controls/base.ts"],"names":[],"mappings":"AAAA,OAAO,KA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AAuB;IAK7C,SAAS,CAAC,iBAAiB,IAAI,WAAW;IAO1C,SAAS,CAAC,0BAA0B,IAAI,WAAW;IAInD,SAAS,CAAC,wBAAwB,IAAI,WAAW,GAAG,IAAI;CAMzD"}
@@ -0,0 +1,11 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class CaptionsControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ private button;
7
+ private lastSelectedIndex;
8
+ protected build(): HTMLElement;
9
+ }
10
+ export default function createCaptionsControl(): Control;
11
+ //# sourceMappingURL=captions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captions.d.ts","sourceRoot":"","sources":["../../../src/controls/captions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AA0CrC,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,EAAE,SAAc;IAChB,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA+B;IAE9D,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,iBAAiB,CAAuB;IAEhD,SAAS,CAAC,KAAK,IAAI,WAAW;CA+F/B;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,OAAO,CAEvD"}
@@ -0,0 +1,9 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class CurrentTimeControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ protected build(): HTMLElement;
7
+ }
8
+ export default function createCurrentTimeControl(): Control;
9
+ //# sourceMappingURL=currentTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currentTime.d.ts","sourceRoot":"","sources":["../../../src/controls/currentTime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,EAAE,SAAiB;IACnB,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA8B;IAE7D,SAAS,CAAC,KAAK,IAAI,WAAW;CAwC/B;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,IAAI,OAAO,CAE1D"}
@@ -0,0 +1,9 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class DurationControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ protected build(): HTMLElement;
7
+ }
8
+ export default function createDurationControl(): Control;
9
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../src/controls/duration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,EAAE,SAAc;IAChB,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA+B;IAE9D,SAAS,CAAC,KAAK,IAAI,WAAW;CAoC/B;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,OAAO,CAEvD"}
@@ -0,0 +1,13 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class FullscreenControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ private isFullscreen;
7
+ private screenW;
8
+ private screenH;
9
+ protected build(): HTMLElement;
10
+ protected onOverlayChanged(): void;
11
+ }
12
+ export default function createFullscreenControl(): Control;
13
+ //# sourceMappingURL=fullscreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullscreen.d.ts","sourceRoot":"","sources":["../../../src/controls/fullscreen.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AA0BrC,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,EAAE,SAAgB;IAClB,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA+B;IAC9D,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IAEpB,SAAS,CAAC,KAAK,IAAI,WAAW;IAiG9B,SAAS,CAAC,gBAAgB,IAAI,IAAI;CAQnC;AAED,MAAM,CAAC,OAAO,UAAU,uBAAuB,IAAI,OAAO,CAEzD"}
@@ -0,0 +1,9 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class PlayControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ protected build(): HTMLElement;
7
+ }
8
+ export default function createPlayControl(): Control;
9
+ //# sourceMappingURL=play.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"play.d.ts","sourceRoot":"","sources":["../../../src/controls/play.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,EAAE,SAAU;IACZ,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA8B;IAE7D,SAAS,CAAC,KAAK,IAAI,WAAW;CAuC/B;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,IAAI,OAAO,CAEnD"}
@@ -0,0 +1,11 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class ProgressControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ private repaint?;
7
+ protected build(): HTMLElement;
8
+ protected onOverlayChanged(): void;
9
+ }
10
+ export default function createProgressControl(): Control;
11
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/controls/progress.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,EAAE,SAAc;IAChB,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA6B;IAE5D,OAAO,CAAC,OAAO,CAAC,CAAa;IAE7B,SAAS,CAAC,KAAK,IAAI,WAAW;IAmT9B,SAAS,CAAC,gBAAgB,IAAI,IAAI;CAGnC;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,OAAO,CAEvD"}
@@ -0,0 +1,20 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class SettingsControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ private root;
7
+ private button;
8
+ private panel;
9
+ private view;
10
+ private isOpen;
11
+ private activeSubmenuId;
12
+ protected build(): HTMLElement;
13
+ private toggle;
14
+ private open;
15
+ private close;
16
+ private render;
17
+ private makeRow;
18
+ }
19
+ export default function createSettingsControl(): Control;
20
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/controls/settings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,EAAE,SAAc;IAChB,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA+B;IAE9D,OAAO,CAAC,IAAI,CAAkB;IAC9B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,IAAI,CAAkB;IAE9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,eAAe,CAAuB;IAE9C,SAAS,CAAC,KAAK,IAAI,WAAW;IAoG9B,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,KAAK;IAOb,OAAO,CAAC,MAAM;IA0Ed,OAAO,CAAC,OAAO;CA+BhB;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,OAAO,CAEvD"}
@@ -0,0 +1,9 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class TimeControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ protected build(): HTMLElement;
7
+ }
8
+ export default function createTimeControl(): Control;
9
+ //# sourceMappingURL=time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/controls/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAIrC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,EAAE,SAAU;IACZ,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA8B;IAE7D,SAAS,CAAC,KAAK,IAAI,WAAW;CAmB/B;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,IAAI,OAAO,CAEnD"}
@@ -0,0 +1,9 @@
1
+ import type { Control } from '../control';
2
+ import { BaseControl } from './base';
3
+ export declare class VolumeControl extends BaseControl {
4
+ id: string;
5
+ placement: Control['placement'];
6
+ protected build(): HTMLElement;
7
+ }
8
+ export default function createVolumeControl(): Control | null;
9
+ //# sourceMappingURL=volume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volume.d.ts","sourceRoot":"","sources":["../../../src/controls/volume.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,qBAAa,aAAc,SAAQ,WAAW;IAC5C,EAAE,SAAY;IACd,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAA+B;IAE9D,SAAS,CAAC,KAAK,IAAI,WAAW;CA6K/B;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,IAAI,OAAO,GAAG,IAAI,CAE5D"}
@@ -0,0 +1,4 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ import type { CenterOverlayBindings } from './overlay';
3
+ export declare function bindCenterOverlay(core: Core, keyTarget: HTMLElement, bindings?: CenterOverlayBindings): void;
4
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGvD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,qBAAqB,QA4OrG"}
@@ -0,0 +1,7 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ import type { Control, ControlPlacement } from './control';
3
+ export declare function extendControls(core: Core): {
4
+ addElement(el: HTMLElement, placement?: ControlPlacement): HTMLElement;
5
+ addControl(control: Control): HTMLElement | undefined;
6
+ };
7
+ //# sourceMappingURL=extend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../src/extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE3D,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI;mBAEtB,WAAW,cAAa,gBAAgB;wBASnC,OAAO,GAOJ,WAAW,GAAG,SAAS;EAMjD"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @openplayerjs/ui
3
+ *
4
+ * UI layer: player wrapper, center overlay, controls grid, and all built-in controls.
5
+ * Peer dependency: @openplayerjs/core
6
+ *
7
+ * Stylesheet: import the CSS separately –
8
+ * import '@openplayerjs/ui/style.css'; // bundler
9
+ * <link rel="stylesheet" href="openplayer.css"> // CDN / <link>
10
+ */
11
+ export { createUI } from './ui';
12
+ export type { PlayerUIContext } from './ui';
13
+ export { defaultLabels, defaultUIConfiguration, resolveUIConfig } from './configuration';
14
+ export type { PlayerUIConfig, ResolvedUIConfig } from './configuration';
15
+ export { buildControls, createControlGrid, registerControl } from './control';
16
+ export type { Control, ControlPlacement, HorizontalSlot, VerticalSlot } from './control';
17
+ export { extendControls } from './extend';
18
+ export { BaseControl } from './controls/base';
19
+ export { default as createCaptionsControl } from './controls/captions';
20
+ export { default as createCurrentTimeControl } from './controls/currentTime';
21
+ export { default as createDurationControl } from './controls/duration';
22
+ export { default as createFullscreenControl } from './controls/fullscreen';
23
+ export { default as createPlayControl } from './controls/play';
24
+ export { default as createProgressControl } from './controls/progress';
25
+ export { default as createSettingsControl } from './controls/settings';
26
+ export { default as createTimeControl } from './controls/time';
27
+ export { default as createVolumeControl } from './controls/volume';
28
+ export { setA11yLabel } from './a11y';
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,YAAY,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACzF,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC9E,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzF,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ export type CenterIcon = 'play' | 'pause';
3
+ export type CenterOverlayBindings = {
4
+ button: HTMLButtonElement;
5
+ loader: HTMLSpanElement;
6
+ showButton: (show: boolean) => void;
7
+ showLoader: (show: boolean) => void;
8
+ flashPause: (ms: number) => void;
9
+ };
10
+ export declare function createCenterOverlayDom(core: Core): CenterOverlayBindings;
11
+ //# sourceMappingURL=overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM/C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;IAExB,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,qBAAqB,CAuGxE"}
@@ -0,0 +1,4 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ export declare function getActiveMedia(core: Core): HTMLMediaElement;
3
+ export declare function togglePlayback(core: Core): Promise<void>;
4
+ //# sourceMappingURL=playback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playback.d.ts","sourceRoot":"","sources":["../../src/playback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,CAW3D;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAU9D"}
@@ -0,0 +1,25 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ export type SettingsMenuItem = {
3
+ id: string;
4
+ label: string;
5
+ checked?: boolean;
6
+ disabled?: boolean;
7
+ onSelect: () => void;
8
+ };
9
+ export type SettingsSubmenu = {
10
+ id: string;
11
+ label: string;
12
+ items: SettingsMenuItem[];
13
+ };
14
+ export type SettingsSubmenuProvider = {
15
+ id: string;
16
+ label: string;
17
+ getSubmenu: (core: Core) => SettingsSubmenu | null;
18
+ };
19
+ export declare class SettingsRegistry {
20
+ private providers;
21
+ register(provider: SettingsSubmenuProvider): () => boolean;
22
+ list(): SettingsSubmenuProvider[];
23
+ }
24
+ export declare function getSettingsRegistry(core: Core): SettingsRegistry;
25
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,eAAe,GAAG,IAAI,CAAC;CACpD,CAAC;AAKF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAA8C;IAE/D,QAAQ,CAAC,QAAQ,EAAE,uBAAuB;IAK1C,IAAI,IAAI,uBAAuB,EAAE;CAGlC;AAID,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,CAMhE"}
@@ -0,0 +1,11 @@
1
+ import type { Core } from '@openplayerjs/core';
2
+ import { createControlGrid, type Control } from './control';
3
+ export type PlayerUIContext = {
4
+ wrapper: HTMLDivElement;
5
+ mediaContainer: HTMLDivElement;
6
+ controlsRoot: HTMLDivElement;
7
+ placeholder: Comment;
8
+ grid?: ReturnType<typeof createControlGrid>;
9
+ };
10
+ export declare function createUI(core: Core, media: HTMLMediaElement, controls: Control[]): PlayerUIContext;
11
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAoF5D,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,cAAc,CAAC;IACxB,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,cAAc,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAqUhF"}
@@ -0,0 +1,55 @@
1
+ import type { PlayerEventPayloadMap } from '@openplayerjs/core';
2
+ import * as CoreExports from '@openplayerjs/core';
3
+ import type { Control } from './control';
4
+ import type { ControlPlacement } from './controls/base';
5
+ declare global {
6
+ interface Window {
7
+ OpenPlayerPlugins?: Record<string, UMDPluginEntry>;
8
+ OpenPlayerConfig?: {
9
+ /** If true, OpenPlayer plugin bundles may extend the CorePlayer prototype lazily. */
10
+ extendPlayerPrototype?: boolean;
11
+ };
12
+ /** Internal: tracks which plugin installs were already applied. */
13
+ __OpenPlayerInstalledPlugins?: Record<string, true>;
14
+ }
15
+ }
16
+ export type UMDPluginEntry = {
17
+ name: string;
18
+ factory: (config?: any) => any;
19
+ /** Prototype-level extension hook (optional). */
20
+ install?: (PlayerCtor: any) => void;
21
+ /** Instance-level extension hook (optional). */
22
+ extend?: (player: any, plugin: any, cfg?: any) => void;
23
+ defaults?: any;
24
+ kind?: 'plugin' | 'extension' | string;
25
+ };
26
+ type Unsubscribe = () => void;
27
+ export default class Player {
28
+ private config;
29
+ private media;
30
+ private core;
31
+ private pendingListeners;
32
+ private createdPlugins;
33
+ constructor(target: string | HTMLMediaElement, config?: any);
34
+ getCore(): CoreExports.Core;
35
+ init(): CoreExports.Core;
36
+ on(event: keyof PlayerEventPayloadMap, cb: (...args: any[]) => void): Unsubscribe;
37
+ emit(event: keyof PlayerEventPayloadMap, ...args: any[]): void;
38
+ play(): Promise<void>;
39
+ pause(): void;
40
+ load(): void;
41
+ destroy(): void;
42
+ addCaptions(args: {
43
+ src: string;
44
+ srclang?: string;
45
+ label?: string;
46
+ kind?: 'captions' | 'subtitles';
47
+ default?: boolean;
48
+ }): HTMLTrackElement;
49
+ addElement(el: HTMLElement, placement?: ControlPlacement): void;
50
+ addControl(control: Control): void;
51
+ set src(source: string);
52
+ private createDetectedPlugins;
53
+ }
54
+ export {};
55
+ //# sourceMappingURL=umd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"umd.d.ts","sourceRoot":"","sources":["../../src/umd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAaxD,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,MAAM;QACd,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACnD,gBAAgB,CAAC,EAAE;YACjB,qFAAqF;YACrF,qBAAqB,CAAC,EAAE,OAAO,CAAC;SACjC,CAAC;QACF,mEAAmE;QACnE,4BAA4B,CAAC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AAI,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;QAChC,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;IAKD,UAAU,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,GAAE,gBAA8C;IAIrF,UAAU,CAAC,OAAO,EAAE,OAAO;IAK3B,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAGrB;IAED,OAAO,CAAC,qBAAqB;CAY9B"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@openplayerjs/player",
3
+ "version": "3.0.0-beta.0",
4
+ "description": "UI layer, built-in controls, and accessibility for OpenPlayerJS",
5
+ "author": {
6
+ "name": "Rafael Miranda",
7
+ "email": "rafa8626@gmail.com"
8
+ },
9
+ "license": "MIT",
10
+ "type": "module",
11
+ "sideEffects": [
12
+ "*.css"
13
+ ],
14
+ "types": "./dist/types/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "import": "./dist/index.js",
18
+ "types": "./dist/types/index.d.ts"
19
+ },
20
+ "./style.css": "./dist/openplayer.css"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/openplayerjs/openplayerjs.git",
30
+ "directory": "packages/player"
31
+ },
32
+ "keywords": [
33
+ "media",
34
+ "video",
35
+ "audio",
36
+ "player",
37
+ "openplayer",
38
+ "ui",
39
+ "controls"
40
+ ],
41
+ "peerDependencies": {
42
+ "@openplayerjs/core": "^3.0.0-beta.0"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "scripts": {
48
+ "test": "jest --passWithNoTests --config ../../jest.config.cjs"
49
+ }
50
+ }