@ngxsp/core 0.2.0 → 0.2.1
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/commands.d.ts +40 -0
- package/config/default-config.d.ts +34 -0
- package/domain/audio-identification-routine.d.ts +47 -0
- package/domain/audio-identification.d.ts +78 -0
- package/domain/audio-library.d.ts +59 -0
- package/domain/audio-metadata-harmony.d.ts +29 -0
- package/domain/device-playback.d.ts +40 -0
- package/domain/media-item.d.ts +22 -0
- package/domain/media-library-model.d.ts +75 -0
- package/domain/media-source.d.ts +115 -0
- package/domain/queue.d.ts +12 -0
- package/domain/remote-playback.d.ts +82 -0
- package/domain/ringtone.d.ts +46 -0
- package/domain/shake.d.ts +55 -0
- package/domain/vault.d.ts +55 -0
- package/engine/capability-report.d.ts +35 -0
- package/engine/engine-factory.d.ts +19 -0
- package/engine/engine-profile.d.ts +27 -0
- package/engine/native.engine.d.ts +23 -0
- package/engine/native.factory.d.ts +2 -0
- package/engine/playback-capabilities.d.ts +29 -0
- package/engine/playback-engine.d.ts +44 -0
- package/engine/remote-playback.engine.d.ts +77 -0
- package/engine/types.d.ts +15 -0
- package/events/event-bus.d.ts +15 -0
- package/facade/player-facade.d.ts +125 -0
- package/index.d.ts +60 -2491
- package/online/acoustid.d.ts +29 -0
- package/online/cast-v2.d.ts +62 -0
- package/online/dlna-renderer.d.ts +19 -0
- package/online/dlna.d.ts +48 -0
- package/online/internet-archive.d.ts +105 -0
- package/online/jellyfin.d.ts +24 -0
- package/online/lyrics.d.ts +69 -0
- package/online/md5.d.ts +5 -0
- package/online/mdns.d.ts +61 -0
- package/online/media-cache.d.ts +61 -0
- package/online/musicbrainz.d.ts +41 -0
- package/online/online-http.d.ts +10 -0
- package/online/playback-transfer.d.ts +106 -0
- package/online/radio-browser.d.ts +42 -0
- package/online/subsonic.d.ts +16 -0
- package/online/upnp.d.ts +30 -0
- package/online/webdav.d.ts +21 -0
- package/online/xml-text.d.ts +19 -0
- package/package.json +1 -1
- package/plugins/ads/ssai.plugin.d.ts +14 -0
- package/plugins/metadata/metadata.types.d.ts +28 -0
- package/plugins/metadata/providers/local-metadata.provider.d.ts +11 -0
- package/plugins/plugin.d.ts +20 -0
- package/plugins/progress/progress.plugin.d.ts +10 -0
- package/plugins/resilience/resilience.plugin.d.ts +12 -0
- package/plugins/subtitles/providers/local-subtitle.provider.d.ts +9 -0
- package/plugins/subtitles/subtitle-file.d.ts +14 -0
- package/plugins/subtitles/subtitles.types.d.ts +22 -0
- package/ports/http.port.d.ts +3 -0
- package/ports/log.port.d.ts +12 -0
- package/ports/ports.d.ts +14 -0
- package/ports/storage.port.d.ts +11 -0
- package/ports/telemetry.port.d.ts +7 -0
- package/remote-config/remote-config.d.ts +8 -0
- package/telemetry/telemetry.types.d.ts +11 -0
- package/types.d.ts +345 -0
- package/utils/cache-store.d.ts +12 -0
- package/index.d.cts +0 -2491
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type OnlineJsonHttp } from './online-http';
|
|
2
|
+
/** Radio Browser community directory of internet radio stations. No key required. */
|
|
3
|
+
export declare const RADIO_BROWSER_ORIGIN = "https://de1.api.radio-browser.info";
|
|
4
|
+
export interface RadioBrowserSearchOptions {
|
|
5
|
+
/** ISO 3166-1 alpha-2 country code, e.g. `CM`. */
|
|
6
|
+
countryCode?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
tag?: string;
|
|
9
|
+
limit?: number;
|
|
10
|
+
offset?: number;
|
|
11
|
+
/** Defaults to true: stations failing the directory checks are skipped. */
|
|
12
|
+
hideBroken?: boolean;
|
|
13
|
+
/** Defaults to the most listened stations first. */
|
|
14
|
+
order?: 'clickcount' | 'votes' | 'name' | 'bitrate' | 'lastcheckok';
|
|
15
|
+
origin?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RadioBrowserRequestOptions {
|
|
18
|
+
/** Defaults to plain `fetch`. */
|
|
19
|
+
http?: OnlineJsonHttp;
|
|
20
|
+
signal?: AbortSignal;
|
|
21
|
+
origin?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RadioStation {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
streamUrl: string;
|
|
27
|
+
homepageUrl?: string;
|
|
28
|
+
faviconUrl?: string;
|
|
29
|
+
country?: string;
|
|
30
|
+
countryCode?: string;
|
|
31
|
+
language?: string;
|
|
32
|
+
tags: string[];
|
|
33
|
+
codec?: string;
|
|
34
|
+
bitrateKbps?: number;
|
|
35
|
+
/** HLS playlists need an adaptive engine; other streams play in a media element. */
|
|
36
|
+
hls: boolean;
|
|
37
|
+
/** Plain http streams are blocked as mixed content on https pages. */
|
|
38
|
+
secure: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare function buildRadioBrowserSearchUrl(options?: RadioBrowserSearchOptions): string;
|
|
41
|
+
export declare function searchRadioStations(options?: RadioBrowserSearchOptions, request?: RadioBrowserRequestOptions): Promise<RadioStation[]>;
|
|
42
|
+
export declare function parseRadioStation(entry: unknown): RadioStation | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MediaSourceAccount, type MediaSourceBrowseOptions, type MediaSourceConnector, type MediaSourceHttp, type MediaSourceInput, type MediaSourceItem, type MediaSourcePage } from '../domain/media-source';
|
|
2
|
+
/**
|
|
3
|
+
* Subsonic API, spoken by Navidrome, Airsonic-Advanced, Gonic and others (all open source): a music server with
|
|
4
|
+
* albums, artists and covers. Every request is signed with md5(password + salt), so the account keeps that signature
|
|
5
|
+
* and its salt instead of the password.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SUBSONIC_API_VERSION = "1.16.1";
|
|
8
|
+
export declare const SUBSONIC_CLIENT = "NGXSP";
|
|
9
|
+
export declare function createSubsonicConnector(salt?: () => string): MediaSourceConnector;
|
|
10
|
+
/** Checks the credentials with `ping` and keeps the request signature, never the password. */
|
|
11
|
+
export declare function connectSubsonic(input: MediaSourceInput, http: MediaSourceHttp, salt?: () => string): Promise<MediaSourceAccount>;
|
|
12
|
+
/** Albums at the root (with their covers), then the tracks of an album; searches look up tracks directly. */
|
|
13
|
+
export declare function browseSubsonic(account: MediaSourceAccount, options: MediaSourceBrowseOptions, http: MediaSourceHttp): Promise<MediaSourcePage>;
|
|
14
|
+
export declare function subsonicStreamUrl(account: MediaSourceAccount, songId: string): string;
|
|
15
|
+
export declare function subsonicCoverUrl(account: MediaSourceAccount, coverArtId: string, size?: number): string;
|
|
16
|
+
export declare function parseSubsonicSong(account: MediaSourceAccount, entry: unknown): MediaSourceItem | null;
|
package/online/upnp.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MediaSourceHttp } from '../domain/media-source';
|
|
2
|
+
/** A service of a UPnP device (ContentDirectory, AVTransport, RenderingControl…) and where to send its actions. */
|
|
3
|
+
export interface UpnpService {
|
|
4
|
+
serviceType: string;
|
|
5
|
+
controlUrl: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UpnpDeviceDescription {
|
|
8
|
+
udn?: string;
|
|
9
|
+
friendlyName: string;
|
|
10
|
+
deviceType?: string;
|
|
11
|
+
manufacturer?: string;
|
|
12
|
+
modelName?: string;
|
|
13
|
+
iconUrl?: string;
|
|
14
|
+
/** Every service the device and its embedded devices offer. */
|
|
15
|
+
services: UpnpService[];
|
|
16
|
+
contentDirectory?: UpnpService;
|
|
17
|
+
}
|
|
18
|
+
/** A UPnP action the device refused; `code` is its UPnP error code when it gave one. */
|
|
19
|
+
export declare class UpnpActionError extends Error {
|
|
20
|
+
readonly action: string;
|
|
21
|
+
readonly code: string | undefined;
|
|
22
|
+
readonly status: number;
|
|
23
|
+
constructor(action: string, code: string | undefined, status: number);
|
|
24
|
+
}
|
|
25
|
+
export declare function parseUpnpDeviceDescription(xml: string, descriptionUrl: string): UpnpDeviceDescription;
|
|
26
|
+
/** The first service of this kind (`AVTransport`, `RenderingControl`…), whatever its version. */
|
|
27
|
+
export declare function findUpnpService(services: readonly UpnpService[], name: string): UpnpService | undefined;
|
|
28
|
+
/** Sends a SOAP action and returns the answer; a refusal throws `UpnpActionError`. */
|
|
29
|
+
export declare function upnpAction(http: MediaSourceHttp, service: UpnpService, action: string, soapArguments: Record<string, string>, signal?: AbortSignal): Promise<string>;
|
|
30
|
+
export declare function resolveUpnpUrl(value: string | undefined, base: string): string | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MediaSourceAccount, type MediaSourceBrowseOptions, type MediaSourceConnector, type MediaSourceHttp, type MediaSourceInput, type MediaSourceItem, type MediaSourcePage } from '../domain/media-source';
|
|
2
|
+
export interface WebDavEntry {
|
|
3
|
+
/** Decoded path of the entry on the server, starting with `/`. */
|
|
4
|
+
path: string;
|
|
5
|
+
name: string;
|
|
6
|
+
collection: boolean;
|
|
7
|
+
size?: number;
|
|
8
|
+
contentType?: string;
|
|
9
|
+
lastModified?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function createWebDavConnector(): MediaSourceConnector;
|
|
12
|
+
/** Checks that the address is a WebDAV folder the credentials can read. */
|
|
13
|
+
export declare function connectWebDav(input: MediaSourceInput, http: MediaSourceHttp): Promise<MediaSourceAccount>;
|
|
14
|
+
/** Sub-folders of a folder, then the media files it holds for the kind the app plays. */
|
|
15
|
+
export declare function browseWebDav(account: MediaSourceAccount, options: MediaSourceBrowseOptions, http: MediaSourceHttp): Promise<MediaSourcePage>;
|
|
16
|
+
/** Parses a WebDAV multistatus document; prefixes and namespaces vary between servers, so tags are matched by name. */
|
|
17
|
+
export declare function parseWebDavMultistatus(xml: string): WebDavEntry[];
|
|
18
|
+
/** Value for the `Authorization` header of an account, or undefined for anonymous shares. */
|
|
19
|
+
export declare function webDavAuthorization(account: MediaSourceAccount): string | undefined;
|
|
20
|
+
/** Reads the `.lrc` file sitting next to the track, the way a music folder usually keeps its lyrics. */
|
|
21
|
+
export declare function readWebDavLyrics(account: MediaSourceAccount, item: MediaSourceItem, http: MediaSourceHttp): Promise<string | null>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small readers for the XML documents media servers answer (WebDAV multistatus, UPnP descriptions, DIDL-Lite).
|
|
3
|
+
* Namespace prefixes vary between servers, so elements are matched by local name; documents are small and trusted to
|
|
4
|
+
* be well formed enough for that.
|
|
5
|
+
*/
|
|
6
|
+
export interface XmlElement {
|
|
7
|
+
attributes: Record<string, string>;
|
|
8
|
+
/** Raw inner markup; undefined for self-closing elements. */
|
|
9
|
+
content: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** Inner markup of the first element with this local name. */
|
|
12
|
+
export declare function xmlTagContent(xml: string, name: string): string | undefined;
|
|
13
|
+
/** Decoded, trimmed text of the first element with this local name; undefined when absent or empty. */
|
|
14
|
+
export declare function xmlTagText(xml: string, name: string): string | undefined;
|
|
15
|
+
/** Every element with this local name, with its decoded attributes. */
|
|
16
|
+
export declare function xmlElements(xml: string, name: string): XmlElement[];
|
|
17
|
+
export declare function xmlText(content: string | undefined): string | undefined;
|
|
18
|
+
export declare function decodeXmlEntities(value: string): string;
|
|
19
|
+
export declare function escapeXmlText(value: string): string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlayerPlugin } from '../plugin';
|
|
2
|
+
/**
|
|
3
|
+
* SSAI helper (v1.11)
|
|
4
|
+
*
|
|
5
|
+
* Keeps the core decoupled from vendor SDKs.
|
|
6
|
+
* This plugin rewrites the manifest URL before the engine loads it.
|
|
7
|
+
*/
|
|
8
|
+
export interface SsaiManifestRewriteConfig {
|
|
9
|
+
/** If provided, used as the final playback URL (highest priority). */
|
|
10
|
+
stitchedUrl?: string;
|
|
11
|
+
/** Append query parameters to the source URL (e.g. session, device). */
|
|
12
|
+
appendQuery?: Record<string, string | number | boolean | null | undefined>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSsaiManifestRewritePlugin(): PlayerPlugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface MetadataHint {
|
|
2
|
+
contentId?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
year?: number;
|
|
5
|
+
imdbId?: string;
|
|
6
|
+
tmdbId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface VideoMetadata {
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
year?: number;
|
|
12
|
+
genres?: string[];
|
|
13
|
+
cast?: string[];
|
|
14
|
+
posterUrl?: string;
|
|
15
|
+
backdropUrl?: string;
|
|
16
|
+
extras?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface MetadataMatch {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
score?: number;
|
|
22
|
+
extra?: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface MetadataProvider {
|
|
25
|
+
id: string;
|
|
26
|
+
match(hint: MetadataHint): Promise<MetadataMatch[]>;
|
|
27
|
+
fetch(id: string): Promise<VideoMetadata>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MetadataProvider, MetadataHint, MetadataMatch, VideoMetadata } from '../metadata.types';
|
|
2
|
+
/**
|
|
3
|
+
* Local provider: loads sidecar metadata from a URL (json or txt).
|
|
4
|
+
* - JSON: parsed into `VideoMetadata` where possible
|
|
5
|
+
* - TXT: stored as description
|
|
6
|
+
*/
|
|
7
|
+
export declare class LocalMetadataProvider implements MetadataProvider {
|
|
8
|
+
id: string;
|
|
9
|
+
match(_hint: MetadataHint): Promise<MetadataMatch[]>;
|
|
10
|
+
fetch(id: string): Promise<VideoMetadata>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PlayerConfig, PlayerError } from '../types';
|
|
2
|
+
import { PlayerFacade } from '../facade/player-facade';
|
|
3
|
+
import type { PlayerPorts } from '../ports/ports';
|
|
4
|
+
export interface PlayerContext {
|
|
5
|
+
config: PlayerConfig;
|
|
6
|
+
facade: PlayerFacade;
|
|
7
|
+
ports: PlayerPorts;
|
|
8
|
+
/**
|
|
9
|
+
* Stable content identifier if available (used for progress/subtitle/metadata lookups).
|
|
10
|
+
*/
|
|
11
|
+
contentId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PlayerPlugin {
|
|
14
|
+
id: string;
|
|
15
|
+
onInit?(ctx: PlayerContext): void | Promise<void>;
|
|
16
|
+
onLoadStart?(ctx: PlayerContext): void | Promise<void>;
|
|
17
|
+
onLoaded?(ctx: PlayerContext): void | Promise<void>;
|
|
18
|
+
onError?(ctx: PlayerContext, err: PlayerError): void | Promise<void>;
|
|
19
|
+
onDestroy?(ctx: PlayerContext): void | Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PlayerPlugin, PlayerContext } from '../plugin';
|
|
2
|
+
export declare class ProgressPlugin implements PlayerPlugin {
|
|
3
|
+
readonly id = "progress";
|
|
4
|
+
private timer;
|
|
5
|
+
onLoadStart(ctx: PlayerContext): Promise<void>;
|
|
6
|
+
onLoaded(ctx: PlayerContext): Promise<void>;
|
|
7
|
+
onDestroy(ctx: PlayerContext): Promise<void>;
|
|
8
|
+
private stop;
|
|
9
|
+
private save;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PlayerPlugin, PlayerContext } from '../plugin';
|
|
2
|
+
import type { PlayerError } from '../../types';
|
|
3
|
+
export declare class ResiliencePlugin implements PlayerPlugin {
|
|
4
|
+
readonly id = "resilience";
|
|
5
|
+
private attempts;
|
|
6
|
+
private recovering;
|
|
7
|
+
/** Bumped by every load: a retry only reloads the media that failed, never one loaded since. */
|
|
8
|
+
private loadGeneration;
|
|
9
|
+
onLoadStart(ctx: PlayerContext): Promise<void>;
|
|
10
|
+
onError(ctx: PlayerContext, err: PlayerError): Promise<void>;
|
|
11
|
+
private health;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SubtitleProvider, SubtitleCandidate, SubtitleQuery } from '../subtitles.types';
|
|
2
|
+
/**
|
|
3
|
+
* Local provider: uses `config.source.sidecar.subtitles` entries as candidates.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LocalSubtitleProvider implements SubtitleProvider {
|
|
6
|
+
id: string;
|
|
7
|
+
search(query: SubtitleQuery): Promise<SubtitleCandidate[]>;
|
|
8
|
+
fetch(candidate: SubtitleCandidate): Promise<string | ArrayBuffer>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subtitle files the viewer loads next to a video: SubRip (.srt) or WebVTT (.vtt), in whatever encoding they were
|
|
3
|
+
* saved (UTF-8 today, Windows-1252 for many older French files). The player reads WebVTT only, so SubRip is turned
|
|
4
|
+
* into it.
|
|
5
|
+
*/
|
|
6
|
+
/** The text of a subtitle file: UTF-8 (with or without its byte order mark), else Windows-1252. */
|
|
7
|
+
export declare function decodeSubtitleBytes(bytes: Uint8Array): string;
|
|
8
|
+
/** WebVTT from the text of a .vtt or .srt file. */
|
|
9
|
+
export declare function subtitleTextToVtt(text: string): string;
|
|
10
|
+
/** The subtitle's name and language, from its file name: "Film.fr.srt" is "Film", in French. */
|
|
11
|
+
export declare function describeSubtitleFile(fileName: string): {
|
|
12
|
+
label: string;
|
|
13
|
+
language?: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SubtitleQuery {
|
|
2
|
+
contentId?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
season?: number;
|
|
5
|
+
episode?: number;
|
|
6
|
+
language?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SubtitleCandidate {
|
|
9
|
+
id: string;
|
|
10
|
+
providerId: string;
|
|
11
|
+
lang: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
format?: string;
|
|
14
|
+
score?: number;
|
|
15
|
+
url?: string;
|
|
16
|
+
extra?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface SubtitleProvider {
|
|
19
|
+
id: string;
|
|
20
|
+
search(query: SubtitleQuery): Promise<SubtitleCandidate[]>;
|
|
21
|
+
fetch(candidate: SubtitleCandidate): Promise<string | ArrayBuffer>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface LogPort {
|
|
2
|
+
debug(...args: unknown[]): void;
|
|
3
|
+
info(...args: unknown[]): void;
|
|
4
|
+
warn(...args: unknown[]): void;
|
|
5
|
+
error(...args: unknown[]): void;
|
|
6
|
+
}
|
|
7
|
+
export declare class ConsoleLogPort implements LogPort {
|
|
8
|
+
debug(...args: unknown[]): void;
|
|
9
|
+
info(...args: unknown[]): void;
|
|
10
|
+
warn(...args: unknown[]): void;
|
|
11
|
+
error(...args: unknown[]): void;
|
|
12
|
+
}
|
package/ports/ports.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HttpPort } from './http.port';
|
|
2
|
+
import type { StoragePort } from './storage.port';
|
|
3
|
+
import type { TelemetryPort } from './telemetry.port';
|
|
4
|
+
import type { LogPort } from './log.port';
|
|
5
|
+
export interface PlayerPorts {
|
|
6
|
+
http: HttpPort;
|
|
7
|
+
storage: StoragePort;
|
|
8
|
+
telemetry: TelemetryPort;
|
|
9
|
+
log: LogPort;
|
|
10
|
+
}
|
|
11
|
+
export declare function createDefaultPorts(): PlayerPorts;
|
|
12
|
+
export { MemoryStoragePort } from './storage.port';
|
|
13
|
+
export { NoopTelemetryPort } from './telemetry.port';
|
|
14
|
+
export { ConsoleLogPort } from './log.port';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface StoragePort {
|
|
2
|
+
get(key: string): Promise<string | null>;
|
|
3
|
+
set(key: string, value: string): Promise<void>;
|
|
4
|
+
remove?(key: string): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare class MemoryStoragePort implements StoragePort {
|
|
7
|
+
private map;
|
|
8
|
+
get(key: string): Promise<string | null>;
|
|
9
|
+
set(key: string, value: string): Promise<void>;
|
|
10
|
+
remove(key: string): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PlayerPorts } from '../ports/ports';
|
|
2
|
+
import type { PlayerConfig, RemoteConfigPayload } from '../types';
|
|
3
|
+
export declare function applyRemoteConfig(cfg: PlayerConfig, ports: Partial<PlayerPorts>): Promise<{
|
|
4
|
+
config: PlayerConfig;
|
|
5
|
+
applied: boolean;
|
|
6
|
+
payload?: RemoteConfigPayload;
|
|
7
|
+
source: 'cache' | 'network' | 'none';
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type TelemetryLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
2
|
+
export type TelemetryEvent = 'player:init' | 'player:attach' | 'player:source_set' | 'player:engine_selected' | 'player:load_start' | 'player:load_ok' | 'player:load_fail' | 'player:play_request' | 'player:play_ok' | 'player:play_fail' | 'player:play_aborted' | 'player:pause' | 'player:timeupdate' | 'player:ended' | 'player:error_nonfatal' | 'player:error_fatal' | 'player:playing' | 'qoe:first_frame' | 'qoe:rebuffer_start' | 'qoe:rebuffer_end' | 'qoe:summary' | 'player:auto_next' | 'player:playlist_index' | 'ads:break_start' | 'ads:break_end' | 'ads:ad_start' | 'ads:ad_end' | 'ssai:manifest_rewrite';
|
|
3
|
+
export interface TelemetrySample {
|
|
4
|
+
ts: number;
|
|
5
|
+
level: TelemetryLevel;
|
|
6
|
+
event: TelemetryEvent;
|
|
7
|
+
contentId?: string;
|
|
8
|
+
engineId?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
data?: Record<string, unknown>;
|
|
11
|
+
}
|