Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ESM files to package json #4543

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ declare namespace dashjs {
setCalleeNameVisible(flag: boolean): void;
}

namespace Debug {
const LOG_LEVEL_NONE = 0;
const LOG_LEVEL_FATAL = 1;
const LOG_LEVEL_ERROR = 2;
const LOG_LEVEL_WARNING = 3;
const LOG_LEVEL_INFO = 4;
const LOG_LEVEL_DEBUG = 5;
}

interface EventBus {
on(type: string, listener: any, scope: any, options?: object): void;

Expand Down Expand Up @@ -1296,6 +1305,14 @@ declare namespace dashjs {

export type TrackSelectionFunction = (tracks: MediaInfo[]) => MediaInfo[];

export interface DvrWindow {
start: number;
end: number;
startAsUtc: number;
endAsUtc: number;
size: number;
}

export interface MediaPlayerClass {
setConfig(config: object): void;

Expand Down Expand Up @@ -1427,7 +1444,7 @@ declare namespace dashjs {

timeInDvrWindow(): number;

getDvrWindow(): object;
getDvrWindow(): DvrWindow;

duration(): number;

Expand Down Expand Up @@ -1483,7 +1500,7 @@ declare namespace dashjs {

setTextTrack(idx: number): void;

getRepresentationsFor(type: MediaType): Representation[];
getRepresentationsByType(type: MediaType): Representation[];

getStreamsFromManifest(manifest: object): StreamInfo[];

Expand Down Expand Up @@ -3178,6 +3195,31 @@ declare namespace dashjs {
MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE: 'DRM: licenser error! --';
}

/**
* Streaming - Protection - Events
**/

export interface ProtectionEvents {
KEY_ADDED: 'public_keyAdded';
KEY_ERROR: 'public_keyError';
KEY_MESSAGE: 'public_keyMessage';
KEY_SESSION_CLOSED: 'public_keySessionClosed';
KEY_SESSION_CREATED: 'public_keySessionCreated';
KEY_SESSION_REMOVED: 'public_keySessionRemoved';
KEY_STATUSES_CHANGED: 'public_keyStatusesChanged';
KEY_SYSTEM_ACCESS_COMPLETE: 'public_keySystemAccessComplete';
KEY_SYSTEM_SELECTED: 'public_keySystemSelected';
LICENSE_REQUEST_COMPLETE: 'public_licenseRequestComplete';
LICENSE_REQUEST_SENDING: 'public_licenseRequestSending';
NEED_KEY: 'needkey';
PROTECTION_CREATED: 'public_protectioncreated';
PROTECTION_DESTROYED: 'public_protectiondestroyed';
SERVER_CERTIFICATE_UPDATED: 'serverCertificateUpdated';
TEARDOWN_COMPLETE: 'protectionTeardownComplete';
VIDEO_ELEMENT_SELECTED: 'videoElementSelected';
KEY_SESSION_UPDATED: 'public_keySessionUpdated';
}

/**
* Streaming - Protection - Models
**/
Expand Down Expand Up @@ -3511,6 +3553,11 @@ declare namespace dashjs {
createProtectionSystem(config: object): void;
}

export namespace Protection {
export const events: ProtectionEvents;
export const errors: ProtectionErrors;
}

/**
* Streaming - Rules - ABR - LolP
*/
Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
"description": "A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.",
"author": "Dash Industry Forum",
"license": "BSD-3-Clause",
"exports": "./dist/dash.all.min.js",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./dist/esm/dash.all.debug.esm.js",
"default": "./dist/esm/dash.all.debug.esm.js",
"browser": "./dist/dash.all.min.js",
"script": "./dist/dash.all.min.js"
}
},
"type": "module",
"types": "index.d.ts",
"scripts": {
"dev": "tsc && webpack --config build/webpack.dev.cjs --mode development --watch --progress",
"start": "webpack serve --config build/webpack.dev.cjs",
Expand Down