@broadcastingplatforms/player 0.0.0-dev.c57124a → 0.0.0-dev.e67afbe

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 (38) hide show
  1. package/README.md +63 -0
  2. package/dist/bp-player.js +201 -188
  3. package/dist/bp-player.mjs +201 -188
  4. package/dist/bp-player.standalone.mjs +255 -242
  5. package/dist/components/bp-default-ui.d.ts +2 -4
  6. package/dist/components/bp-player.d.ts +2 -1
  7. package/dist/core/player-core.d.ts +3 -2
  8. package/dist/elements/hls-video.d.ts +1 -0
  9. package/dist/elements/nano-video.d.ts +2 -0
  10. package/dist/events/AddRenditionEvent.d.ts +6 -0
  11. package/dist/events/CanPlayEvent.d.ts +5 -0
  12. package/dist/events/CanPlayThroughEvent.d.ts +5 -0
  13. package/dist/events/ChangeEvent.d.ts +5 -0
  14. package/dist/events/DurationChangeEvent.d.ts +5 -0
  15. package/dist/events/EmptiedEvent.d.ts +5 -0
  16. package/dist/events/EndedEvent.d.ts +5 -0
  17. package/dist/events/ErrorEvent.d.ts +9 -0
  18. package/dist/events/EventUtils.d.ts +22 -0
  19. package/dist/events/LoadStartEvent.d.ts +5 -0
  20. package/dist/events/LoadedDataEvent.d.ts +5 -0
  21. package/dist/events/LoadedMetadataEvent.d.ts +5 -0
  22. package/dist/events/PauseEvent.d.ts +5 -0
  23. package/dist/events/PlayEvent.d.ts +5 -0
  24. package/dist/events/PlayingEvent.d.ts +5 -0
  25. package/dist/events/ProgressEvent.d.ts +5 -0
  26. package/dist/events/RateChangeEvent.d.ts +5 -0
  27. package/dist/events/ReadyEvent.d.ts +6 -0
  28. package/dist/events/ResizeEvent.d.ts +5 -0
  29. package/dist/events/SeekedEvent.d.ts +5 -0
  30. package/dist/events/SeekingEvent.d.ts +5 -0
  31. package/dist/events/TimeUpdateEvent.d.ts +5 -0
  32. package/dist/events/VolumeChangeEvent.d.ts +5 -0
  33. package/dist/events/WaitingEvent.d.ts +5 -0
  34. package/dist/events/index.d.ts +49 -0
  35. package/dist/providers/contract.d.ts +2 -0
  36. package/dist/util/converters.d.ts +14 -0
  37. package/dist/util/index.d.ts +1 -0
  38. package/package.json +2 -19
@@ -1,19 +1,17 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import type { PlayerCore } from '../core/player-core';
3
3
  import type { ProviderConfig, SourceDescription } from '../providers/contract';
4
+ import { type ReadyEvent } from '../events';
4
5
  import 'media-chrome';
5
6
  import 'media-chrome/menu';
6
7
  import './bp-player';
7
8
  import './bp-error-display';
8
9
  import type { BPLiveService } from '../bplive/service';
9
- export type BPDefaultUIReadyEvent = CustomEvent<PlayerCore>;
10
+ export type BPDefaultUIReadyEvent = ReadyEvent;
10
11
  declare global {
11
12
  interface HTMLElementTagNameMap {
12
13
  'bp-default-ui': BPDefaultUI;
13
14
  }
14
- interface HTMLElementEventMap {
15
- ready: BPDefaultUIReadyEvent;
16
- }
17
15
  }
18
16
  /**
19
17
  * Complete player UI with controls, loading states, and error handling.
@@ -4,7 +4,8 @@ import type { PlayerState } from '../core/state';
4
4
  import type { ProviderType, ProviderConfig, SourceDescription } from '../providers/contract';
5
5
  import type { BPLiveService } from '../bplive/service';
6
6
  import { VideoRenditionList } from './video-rendition-list';
7
- export type BPPlayerReadyEvent = CustomEvent<PlayerCore>;
7
+ import type { ReadyEvent } from '../events';
8
+ export type BPPlayerReadyEvent = ReadyEvent;
8
9
  declare global {
9
10
  interface HTMLElementTagNameMap {
10
11
  'bp-player': BPPlayer;
@@ -126,7 +126,7 @@ export interface PlayerCore {
126
126
  setPlaybackRate(rate: number): void;
127
127
  setTargetQuality(quality: QualityLevel | null): void;
128
128
  setQuality(quality: QualityLevel | null): void;
129
- setFullscreen(fullscreen: boolean): void;
129
+ setFullscreen(fullscreen: boolean): Promise<void>;
130
130
  setPresentationMode(mode: PresentationMode): void;
131
131
  destroy(): void;
132
132
  }
@@ -173,7 +173,8 @@ export declare class PlayerCoreImpl implements PlayerCore {
173
173
  setPlaybackRate(rate: number): void;
174
174
  setTargetQuality(quality: QualityLevel | null): void;
175
175
  setQuality(quality: QualityLevel | null): void;
176
- setFullscreen(fullscreen: boolean): void;
176
+ private _getFullscreenTarget;
177
+ setFullscreen(fullscreen: boolean): Promise<void>;
177
178
  setPresentationMode(mode: PresentationMode): void;
178
179
  destroy(): void;
179
180
  }
@@ -20,6 +20,7 @@ declare class HlsVideoElement extends MediaTracksVideoElement {
20
20
  get config(): HlsVideoConfig | null;
21
21
  set config(value: HlsVideoConfig | null);
22
22
  attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string | null): void;
23
+ disconnectedCallback(): void;
23
24
  load(): Promise<void>;
24
25
  }
25
26
  export default HlsVideoElement;
@@ -83,6 +83,8 @@ interface NanoPlayerConfig {
83
83
  };
84
84
  }
85
85
  interface NanoVideoConfig {
86
+ /** Direct URL to the NanoPlayer script. When set, bypasses libraryLocation construction. */
87
+ scriptUrl?: string;
86
88
  reconnect?: {
87
89
  minDelay: number;
88
90
  maxDelay: number;
@@ -0,0 +1,6 @@
1
+ import type { VideoRendition } from '../components/video-rendition-list';
2
+ export declare const ADD_RENDITION_EVENT: "addrendition";
3
+ export interface AddRenditionEvent extends CustomEvent<VideoRendition> {
4
+ type: typeof ADD_RENDITION_EVENT;
5
+ }
6
+ //# sourceMappingURL=AddRenditionEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const CAN_PLAY_EVENT: "canplay";
2
+ export interface CanPlayEvent extends Event {
3
+ type: typeof CAN_PLAY_EVENT;
4
+ }
5
+ //# sourceMappingURL=CanPlayEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const CAN_PLAY_THROUGH_EVENT: "canplaythrough";
2
+ export interface CanPlayThroughEvent extends Event {
3
+ type: typeof CAN_PLAY_THROUGH_EVENT;
4
+ }
5
+ //# sourceMappingURL=CanPlayThroughEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const CHANGE_EVENT: "change";
2
+ export interface ChangeEvent extends Event {
3
+ type: typeof CHANGE_EVENT;
4
+ }
5
+ //# sourceMappingURL=ChangeEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const DURATION_CHANGE_EVENT: "durationchange";
2
+ export interface DurationChangeEvent extends Event {
3
+ type: typeof DURATION_CHANGE_EVENT;
4
+ }
5
+ //# sourceMappingURL=DurationChangeEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const EMPTIED_EVENT: "emptied";
2
+ export interface EmptiedEvent extends Event {
3
+ type: typeof EMPTIED_EVENT;
4
+ }
5
+ //# sourceMappingURL=EmptiedEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const ENDED_EVENT: "ended";
2
+ export interface EndedEvent extends Event {
3
+ type: typeof ENDED_EVENT;
4
+ }
5
+ //# sourceMappingURL=EndedEvent.d.ts.map
@@ -0,0 +1,9 @@
1
+ export declare const ERROR_EVENT: "error";
2
+ export interface ErrorEventDetail {
3
+ error: Error;
4
+ code?: number;
5
+ }
6
+ export interface PlayerErrorEvent extends CustomEvent<ErrorEventDetail> {
7
+ type: typeof ERROR_EVENT;
8
+ }
9
+ //# sourceMappingURL=ErrorEvent.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Cross-browser event factory utilities.
3
+ */
4
+ export type EventFactory = <TType extends string = string>(type: TType, eventInitDict?: EventInit) => Event & {
5
+ readonly type: TType;
6
+ };
7
+ export type CustomEventFactory = <TType extends string = string, TDetail = unknown>(type: TType, eventInitDict?: CustomEventInit<TDetail>) => CustomEvent<TDetail> & {
8
+ readonly type: TType;
9
+ };
10
+ /**
11
+ * Creates a DOM Event with bubbles and composed enabled by default.
12
+ */
13
+ export declare const createEvent: EventFactory;
14
+ /**
15
+ * Creates a DOM CustomEvent with bubbles and composed enabled by default.
16
+ */
17
+ export declare const createCustomEvent: CustomEventFactory;
18
+ /**
19
+ * Creates a DOM ErrorEvent with bubbles and composed enabled by default.
20
+ */
21
+ export declare function createErrorEvent(error: Error, code?: number): ErrorEvent;
22
+ //# sourceMappingURL=EventUtils.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const LOAD_START_EVENT: "loadstart";
2
+ export interface LoadStartEvent extends Event {
3
+ type: typeof LOAD_START_EVENT;
4
+ }
5
+ //# sourceMappingURL=LoadStartEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const LOADED_DATA_EVENT: "loadeddata";
2
+ export interface LoadedDataEvent extends Event {
3
+ type: typeof LOADED_DATA_EVENT;
4
+ }
5
+ //# sourceMappingURL=LoadedDataEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const LOADED_METADATA_EVENT: "loadedmetadata";
2
+ export interface LoadedMetadataEvent extends Event {
3
+ type: typeof LOADED_METADATA_EVENT;
4
+ }
5
+ //# sourceMappingURL=LoadedMetadataEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const PAUSE_EVENT: "pause";
2
+ export interface PauseEvent extends Event {
3
+ type: typeof PAUSE_EVENT;
4
+ }
5
+ //# sourceMappingURL=PauseEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const PLAY_EVENT: "play";
2
+ export interface PlayEvent extends Event {
3
+ type: typeof PLAY_EVENT;
4
+ }
5
+ //# sourceMappingURL=PlayEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const PLAYING_EVENT: "playing";
2
+ export interface PlayingEvent extends Event {
3
+ type: typeof PLAYING_EVENT;
4
+ }
5
+ //# sourceMappingURL=PlayingEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const PROGRESS_EVENT: "progress";
2
+ export interface ProgressEvent extends Event {
3
+ type: typeof PROGRESS_EVENT;
4
+ }
5
+ //# sourceMappingURL=ProgressEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const RATE_CHANGE_EVENT: "ratechange";
2
+ export interface RateChangeEvent extends Event {
3
+ type: typeof RATE_CHANGE_EVENT;
4
+ }
5
+ //# sourceMappingURL=RateChangeEvent.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { PlayerCore } from '../core/player-core';
2
+ export declare const READY_EVENT: "ready";
3
+ export interface ReadyEvent extends CustomEvent<PlayerCore> {
4
+ type: typeof READY_EVENT;
5
+ }
6
+ //# sourceMappingURL=ReadyEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const RESIZE_EVENT: "resize";
2
+ export interface ResizeEvent extends Event {
3
+ type: typeof RESIZE_EVENT;
4
+ }
5
+ //# sourceMappingURL=ResizeEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const SEEKED_EVENT: "seeked";
2
+ export interface SeekedEvent extends Event {
3
+ type: typeof SEEKED_EVENT;
4
+ }
5
+ //# sourceMappingURL=SeekedEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const SEEKING_EVENT: "seeking";
2
+ export interface SeekingEvent extends Event {
3
+ type: typeof SEEKING_EVENT;
4
+ }
5
+ //# sourceMappingURL=SeekingEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const TIME_UPDATE_EVENT: "timeupdate";
2
+ export interface TimeUpdateEvent extends Event {
3
+ type: typeof TIME_UPDATE_EVENT;
4
+ }
5
+ //# sourceMappingURL=TimeUpdateEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const VOLUME_CHANGE_EVENT: "volumechange";
2
+ export interface VolumeChangeEvent extends Event {
3
+ type: typeof VOLUME_CHANGE_EVENT;
4
+ }
5
+ //# sourceMappingURL=VolumeChangeEvent.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const WAITING_EVENT: "waiting";
2
+ export interface WaitingEvent extends Event {
3
+ type: typeof WAITING_EVENT;
4
+ }
5
+ //# sourceMappingURL=WaitingEvent.d.ts.map
@@ -0,0 +1,49 @@
1
+ export { createEvent, createCustomEvent, createErrorEvent } from './EventUtils';
2
+ export type { EventFactory, CustomEventFactory } from './EventUtils';
3
+ export { PLAY_EVENT } from './PlayEvent';
4
+ export type { PlayEvent } from './PlayEvent';
5
+ export { PAUSE_EVENT } from './PauseEvent';
6
+ export type { PauseEvent } from './PauseEvent';
7
+ export { PLAYING_EVENT } from './PlayingEvent';
8
+ export type { PlayingEvent } from './PlayingEvent';
9
+ export { WAITING_EVENT } from './WaitingEvent';
10
+ export type { WaitingEvent } from './WaitingEvent';
11
+ export { ENDED_EVENT } from './EndedEvent';
12
+ export type { EndedEvent } from './EndedEvent';
13
+ export { SEEKING_EVENT } from './SeekingEvent';
14
+ export type { SeekingEvent } from './SeekingEvent';
15
+ export { SEEKED_EVENT } from './SeekedEvent';
16
+ export type { SeekedEvent } from './SeekedEvent';
17
+ export { TIME_UPDATE_EVENT } from './TimeUpdateEvent';
18
+ export type { TimeUpdateEvent } from './TimeUpdateEvent';
19
+ export { DURATION_CHANGE_EVENT } from './DurationChangeEvent';
20
+ export type { DurationChangeEvent } from './DurationChangeEvent';
21
+ export { LOAD_START_EVENT } from './LoadStartEvent';
22
+ export type { LoadStartEvent } from './LoadStartEvent';
23
+ export { LOADED_METADATA_EVENT } from './LoadedMetadataEvent';
24
+ export type { LoadedMetadataEvent } from './LoadedMetadataEvent';
25
+ export { LOADED_DATA_EVENT } from './LoadedDataEvent';
26
+ export type { LoadedDataEvent } from './LoadedDataEvent';
27
+ export { CAN_PLAY_EVENT } from './CanPlayEvent';
28
+ export type { CanPlayEvent } from './CanPlayEvent';
29
+ export { CAN_PLAY_THROUGH_EVENT } from './CanPlayThroughEvent';
30
+ export type { CanPlayThroughEvent } from './CanPlayThroughEvent';
31
+ export { PROGRESS_EVENT } from './ProgressEvent';
32
+ export type { ProgressEvent } from './ProgressEvent';
33
+ export { EMPTIED_EVENT } from './EmptiedEvent';
34
+ export type { EmptiedEvent } from './EmptiedEvent';
35
+ export { VOLUME_CHANGE_EVENT } from './VolumeChangeEvent';
36
+ export type { VolumeChangeEvent } from './VolumeChangeEvent';
37
+ export { RATE_CHANGE_EVENT } from './RateChangeEvent';
38
+ export type { RateChangeEvent } from './RateChangeEvent';
39
+ export { RESIZE_EVENT } from './ResizeEvent';
40
+ export type { ResizeEvent } from './ResizeEvent';
41
+ export { ERROR_EVENT } from './ErrorEvent';
42
+ export type { PlayerErrorEvent, ErrorEventDetail } from './ErrorEvent';
43
+ export { READY_EVENT } from './ReadyEvent';
44
+ export type { ReadyEvent } from './ReadyEvent';
45
+ export { CHANGE_EVENT } from './ChangeEvent';
46
+ export type { ChangeEvent } from './ChangeEvent';
47
+ export { ADD_RENDITION_EVENT } from './AddRenditionEvent';
48
+ export type { AddRenditionEvent } from './AddRenditionEvent';
49
+ //# sourceMappingURL=index.d.ts.map
@@ -81,6 +81,8 @@ export interface VideoProviderConfig {
81
81
  capLevelToPlayerSize?: boolean;
82
82
  }
83
83
  export interface NanoProviderConfig {
84
+ /** Direct URL to the NanoPlayer script. When set, bypasses libraryLocation construction. */
85
+ scriptUrl?: string;
84
86
  reconnect?: {
85
87
  minDelay: number;
86
88
  maxDelay: number;
@@ -0,0 +1,14 @@
1
+ import type { ComplexAttributeConverter } from 'lit';
2
+ /**
3
+ * Creates a JSON converter for Lit complex attributes.
4
+ * Allows setting complex objects (source, config) as JSON strings in HTML attributes.
5
+ *
6
+ * @returns A ComplexAttributeConverter for use with Lit @property decorator
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * @property({ converter: jsonConverter() }) config?: Config;
11
+ * ```
12
+ */
13
+ export declare function jsonConverter<T = unknown>(): ComplexAttributeConverter<T | undefined>;
14
+ //# sourceMappingURL=converters.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export * from './attribute';
2
+ export * from './converters';
2
3
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@broadcastingplatforms/player",
3
- "version": "0.0.0-dev.c57124a",
3
+ "version": "0.0.0-dev.e67afbe",
4
4
  "description": "Universal video player web component built with Lit",
5
5
  "type": "module",
6
6
  "main": "dist/bp-player.js",
@@ -16,22 +16,6 @@
16
16
  "types": "./dist/index.d.ts",
17
17
  "import": "./dist/bp-player.standalone.mjs"
18
18
  },
19
- "./elements": {
20
- "types": "./dist/elements/index.d.ts",
21
- "import": "./dist/elements/index.js"
22
- },
23
- "./elements/hls-video": {
24
- "types": "./dist/elements/hls-video.d.ts",
25
- "import": "./dist/elements/hls-video.js"
26
- },
27
- "./elements/nano-video": {
28
- "types": "./dist/elements/nano-video.d.ts",
29
- "import": "./dist/elements/nano-video.js"
30
- },
31
- "./elements/livekit-video": {
32
- "types": "./dist/elements/livekit-video.d.ts",
33
- "import": "./dist/elements/livekit-video.js"
34
- },
35
19
  "./dist/*": "./dist/*",
36
20
  "./package.json": "./package.json"
37
21
  },
@@ -53,8 +37,7 @@
53
37
  "concurrently": "^9.1.2",
54
38
  "esbuild": "^0.24.0",
55
39
  "typescript": "^5.7.2",
56
- "vite": "^6.0.5",
57
- "@broadcastingplatforms/web-connectors": "0.0.0-dev.c57124a"
40
+ "vite": "^6.0.5"
58
41
  },
59
42
  "license": "UNLICENSED",
60
43
  "publishConfig": {