Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b5427b5
Add support for com.apple.fps keySystem
valotvince Dec 28, 2021
554e93e
Improve support for DRM key-systems and key handling
robwalch Aug 9, 2022
b30ed72
Update README `licenseXhrSetup` example
robwalch Oct 6, 2022
acf4309
Update api-extractor markdown
robwalch Oct 19, 2022
fe33d26
Attach CDM on start when even when initial fragments do not have a ke…
robwalch Oct 20, 2022
94bf06d
Handle expired key status correctly
robwalch Oct 21, 2022
d00fd45
Map key-sessions by key ID and log key ID more often than URI
robwalch Oct 27, 2022
2afa6d3
Support "clear-lead" key-session creation without new config
robwalch Oct 27, 2022
412413b
Emit and handle FRAG_PARSING_ERROR from transmuxers (#5018)
robwalch Nov 17, 2022
83799b9
Route all key-system errors to `onFragmentOrKeyLoadError`
robwalch Nov 17, 2022
8c34bfb
Populate EMEKeyError.err for better demo error logging
robwalch Nov 17, 2022
c73d45b
Remove `useEmeEncryptedEvent` and mark `widevineLicenseUrl` as deprec…
robwalch Nov 28, 2022
d3d57fd
Add support for EXT-X-SESSION-KEY tags (for key-system access on mani…
robwalch Nov 30, 2022
480ff27
Throw before licenseXhrSetup if key was removed
robwalch Dec 2, 2022
f46950a
Make key session promise chain more consice
robwalch Dec 3, 2022
497f17d
Stop on fatal key system errors
robwalch Dec 3, 2022
78dadb7
Only request access to key-systems for keys matching those found in t…
robwalch Dec 10, 2022
d3eefb7
Modify key-system helpers so that it's easier to support additional k…
robwalch Dec 14, 2022
adea6fe
Add undocumented `generateRequest` ("Content ID") filter
robwalch Dec 15, 2022
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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ HLS.js is written in [ECMAScript6] (`*.js`) and [TypeScript] (`*.ts`) (strongly
- AES-128 decryption
- SAMPLE-AES decryption (only supported if using MPEG-2 TS container)
- Encrypted media extensions (EME) support for DRM (digital rights management)
- Widevine CDM (only tested with [shaka-packager](https://github.com/google/shaka-packager) test-stream on [the demo page](https://hls-js.netlify.app/demo/?src=https%3A%2F%2Fstorage.googleapis.com%2Fshaka-demo-assets%2Fangel-one-widevine-hls%2Fhls.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==))
- FairPlay, PlayReady, Widevine CDMs with fmp4 segments
- CEA-608/708 captions
- WebVTT subtitles
- Alternate Audio Track Rendition (Master Playlist with Alternative Audio) for VoD and Live playlists
Expand Down Expand Up @@ -113,14 +113,16 @@ The following tags are added to their respective fragment's attribute list but a

For a complete list of issues, see ["Top priorities" in the Release Planning and Backlog project tab](https://github.com/video-dev/hls.js/projects/6). Codec support is dependent on the runtime environment (for example, not all browsers on the same OS support HEVC).

- FairPlay and PlayReady DRM ( See [#3779](https://github.com/video-dev/hls.js/issues/2360) and [issues labeled DRM](https://github.com/video-dev/hls.js/issues?q=is%3Aissue+is%3Aopen+label%3ADRM))
- Advanced variant selection based on runtime media capabilities (See issues labeled [`media-capabilities`](https://github.com/video-dev/hls.js/labels/media-capabilities))
- HLS Content Steering
- HLS Interstitials
- `#EXT-X-DEFINE` variable substitution
- `#EXT-X-GAP` filling [#2940](https://github.com/video-dev/hls.js/issues/2940)
- `#EXT-X-I-FRAME-STREAM-INF` I-frame Media Playlist files
- `SAMPLE-AES` with fmp4, aac, mp3, vtt... segments (MPEG-2 TS only)
- FairPlay, PlayReady, Widevine DRM with MPEG-2 TS segments
- Advanced variant selection based on runtime media capabilities (See issues labeled [`media-capabilities`](https://github.com/video-dev/hls.js/labels/media-capabilities))
- MP3 elementary stream audio in IE and Edge (<=18) on Windows 10 (See [#1641](https://github.com/video-dev/hls.js/issues/1641) and [Microsoft answers forum](https://answers.microsoft.com/en-us/ie/forum/all/ie11-on-windows-10-cannot-play-hls-with-mp3/2da994b5-8dec-4ae9-9201-7d138ede49d9))

### Server-side-rendering (SSR) and `require` from a Node.js runtime

Expand Down
121 changes: 90 additions & 31 deletions api-extractor/report/hls.js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ export class DateRange {
export type DRMSystemOptions = {
audioRobustness?: string;
videoRobustness?: string;
audioEncryptionScheme?: string | null;
videoEncryptionScheme?: string | null;
persistentState?: MediaKeysRequirement;
distinctiveIdentifier?: MediaKeysRequirement;
sessionTypes?: string[];
sessionType?: string;
};

// Warning: (ae-missing-release-tag) "ElementaryStreamInfo" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand Down Expand Up @@ -352,10 +358,11 @@ export enum ElementaryStreamTypes {
//
// @public (undocumented)
export type EMEControllerConfig = {
licenseXhrSetup?: (xhr: XMLHttpRequest, url: string) => void;
licenseResponseCallback?: (xhr: XMLHttpRequest, url: string) => ArrayBuffer;
licenseXhrSetup?: (this: Hls, xhr: XMLHttpRequest, url: string, keyContext: MediaKeySessionContext, licenseChallenge: Uint8Array) => void | Promise<Uint8Array | void>;
licenseResponseCallback?: (this: Hls, xhr: XMLHttpRequest, url: string, keyContext: MediaKeySessionContext) => ArrayBuffer;
emeEnabled: boolean;
widevineLicenseUrl?: string;
drmSystems: DRMSystemsConfiguration;
drmSystemOptions: DRMSystemOptions;
requestMediaKeySystemAccessFunc: MediaKeyFunc | null;
};
Expand All @@ -369,6 +376,8 @@ export interface ErrorData {
// (undocumented)
bytes?: number;
// (undocumented)
chunkMeta?: ChunkMetadata;
// (undocumented)
context?: PlaylistLoaderContext;
// (undocumented)
details: ErrorDetails;
Expand Down Expand Up @@ -457,6 +466,16 @@ export enum ErrorDetails {
// (undocumented)
KEY_SYSTEM_NO_SESSION = "keySystemNoSession",
// (undocumented)
KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED = "keySystemServerCertificateRequestFailed",
// (undocumented)
KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED = "keySystemServerCertificateUpdateFailed",
// (undocumented)
KEY_SYSTEM_SESSION_UPDATE_FAILED = "keySystemSessionUpdateFailed",
// (undocumented)
KEY_SYSTEM_STATUS_INTERNAL_ERROR = "keySystemStatusInternalError",
// (undocumented)
KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED = "keySystemStatusOutputRestricted",
// (undocumented)
LEVEL_EMPTY_ERROR = "levelEmptyError",
// (undocumented)
LEVEL_LOAD_ERROR = "levelLoadError",
Expand Down Expand Up @@ -733,7 +752,6 @@ export class Fragment extends BaseSegment {
cc: number;
// (undocumented)
clearElementaryStreamInfo(): void;
createInitializationVector(segmentNumber: number): Uint8Array;
// (undocumented)
data?: Uint8Array;
// (undocumented)
Expand All @@ -754,12 +772,16 @@ export class Fragment extends BaseSegment {
endPTS?: number;
// (undocumented)
initSegment: Fragment | null;
// Warning: (ae-forgotten-export) The symbol "KeyLoaderContext" needs to be exported by the entry point hls.d.ts
//
// (undocumented)
keyLoader: Loader<KeyLoaderContext> | null;
// (undocumented)
level: number;
// (undocumented)
levelkey?: LevelKey;
levelkeys?: {
[key: string]: LevelKey;
};
// (undocumented)
loader: Loader<FragmentLoaderContext> | null;
// (undocumented)
Expand All @@ -770,10 +792,11 @@ export class Fragment extends BaseSegment {
programDateTime: number | null;
// (undocumented)
rawProgramDateTime: string | null;
setDecryptDataFromLevelKey(levelkey: LevelKey, segmentNumber: number): LevelKey;
// (undocumented)
setElementaryStreamInfo(type: ElementaryStreamTypes, startPTS: number, endPTS: number, startDTS: number, endDTS: number, partial?: boolean): void;
// (undocumented)
setKeyFormat(keyFormat: KeySystemFormats): void;
// (undocumented)
sn: number | 'initSegment';
// (undocumented)
start: number;
Expand Down Expand Up @@ -889,7 +912,7 @@ class Hls implements HlsEventEmitter {
// (undocumented)
readonly config: HlsConfig;
// (undocumented)
createController(ControllerClass: any, fragmentTracker: any, components: any): any;
createController(ControllerClass: any, components: any): any;
get currentLevel(): number;
// Warning: (ae-setter-with-docs) The doc comment for the property "currentLevel" must appear on the getter, not the setter.
set currentLevel(newLevel: number);
Expand Down Expand Up @@ -1221,26 +1244,42 @@ export interface InitPTSFoundData {
export interface KeyLoadedData {
// (undocumented)
frag: Fragment;
// Warning: (ae-forgotten-export) The symbol "KeyLoaderInfo" needs to be exported by the entry point hls.d.ts
//
// (undocumented)
keyInfo: KeyLoaderInfo;
}

// Warning: (ae-missing-release-tag) "KeyLoaderContext" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
// Warning: (ae-missing-release-tag) "KeyLoadingData" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface KeyLoaderContext extends FragmentLoaderContext {
export interface KeyLoadingData {
// (undocumented)
frag: Fragment;
}

// Warning: (ae-missing-release-tag) "KeyLoadingData" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
// Warning: (ae-missing-release-tag) "KeySystemFormats" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface KeyLoadingData {
export enum KeySystemFormats {
// (undocumented)
frag: Fragment;
CLEARKEY = "org.w3.clearkey",
// (undocumented)
FAIRPLAY = "com.apple.streamingkeydelivery",
// (undocumented)
PLAYREADY = "com.microsoft.playready",
// (undocumented)
WIDEVINE = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"
}

// Warning: (ae-missing-release-tag) "KeySystems" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export enum KeySystems {
// (undocumented)
CLEARKEY = "org.w3.clearkey",
// (undocumented)
FAIRPLAY = "com.apple.fps",
// (undocumented)
PLAYREADY = "com.microsoft.playready",
// (undocumented)
Expand Down Expand Up @@ -1402,6 +1441,8 @@ export class LevelDetails {
// (undocumented)
get edge(): number;
// (undocumented)
encryptedFragments: Fragment[];
// (undocumented)
endCC: number;
// (undocumented)
endSN: number;
Expand Down Expand Up @@ -1471,28 +1512,38 @@ export class LevelDetails {
version: number | null;
}

// Warning: (ae-forgotten-export) The symbol "DecryptData" needs to be exported by the entry point hls.d.ts
// Warning: (ae-missing-release-tag) "LevelKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export class LevelKey {
export class LevelKey implements DecryptData {
constructor(method: string, uri: string, format: string, formatversions?: number[], iv?: Uint8Array | null);
// (undocumented)
static fromURI(uri: string): LevelKey;
static clearKeyUriToKeyIdMap(): void;
// (undocumented)
static fromURL(baseUrl: string, relativeUrl: string): LevelKey;
readonly encrypted: boolean;
// (undocumented)
getDecryptData(sn: number | 'initSegment'): LevelKey | null;
// (undocumented)
readonly isCommonEncryption: boolean;
// (undocumented)
isSupported(): boolean;
// (undocumented)
iv: Uint8Array | null;
// (undocumented)
key: Uint8Array | null;
// (undocumented)
keyFormat: string | null;
readonly keyFormat: string;
// (undocumented)
readonly keyFormatVersions: number[];
// (undocumented)
keyFormatVersions: string | null;
keyId: Uint8Array | null;
// (undocumented)
keyID: string | null;
readonly method: string;
// (undocumented)
method: string | null;
pssh: Uint8Array | null;
// (undocumented)
get uri(): string | null;
readonly uri: string;
}

// Warning: (ae-missing-release-tag) "LevelLoadedData" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand Down Expand Up @@ -1792,6 +1843,8 @@ export interface ManifestLoadedData {
// (undocumented)
sessionData: Record<string, AttrList> | null;
// (undocumented)
sessionKeys: LevelKey[] | null;
// (undocumented)
stats: LoaderStats;
// (undocumented)
subtitles?: MediaPlaylist[];
Expand Down Expand Up @@ -1822,6 +1875,10 @@ export interface ManifestParsedData {
// (undocumented)
levels: Level[];
// (undocumented)
sessionData: Record<string, AttrList> | null;
// (undocumented)
sessionKeys: LevelKey[] | null;
// (undocumented)
stats: LoaderStats;
// (undocumented)
subtitleTracks: MediaPlaylist[];
Expand Down Expand Up @@ -2236,18 +2293,20 @@ export interface UserdataSample {

// Warnings were encountered during analysis:
//
// src/config.ts:169:3 - (ae-forgotten-export) The symbol "ILogger" needs to be exported by the entry point hls.d.ts
// src/config.ts:179:3 - (ae-forgotten-export) The symbol "AudioStreamController" needs to be exported by the entry point hls.d.ts
// src/config.ts:180:3 - (ae-forgotten-export) The symbol "AudioTrackController" needs to be exported by the entry point hls.d.ts
// src/config.ts:182:3 - (ae-forgotten-export) The symbol "SubtitleStreamController" needs to be exported by the entry point hls.d.ts
// src/config.ts:183:3 - (ae-forgotten-export) The symbol "SubtitleTrackController" needs to be exported by the entry point hls.d.ts
// src/config.ts:184:3 - (ae-forgotten-export) The symbol "TimelineController" needs to be exported by the entry point hls.d.ts
// src/config.ts:186:3 - (ae-forgotten-export) The symbol "EMEController" needs to be exported by the entry point hls.d.ts
// src/config.ts:189:3 - (ae-forgotten-export) The symbol "CMCDController" needs to be exported by the entry point hls.d.ts
// src/config.ts:191:3 - (ae-forgotten-export) The symbol "AbrController" needs to be exported by the entry point hls.d.ts
// src/config.ts:192:3 - (ae-forgotten-export) The symbol "BufferController" needs to be exported by the entry point hls.d.ts
// src/config.ts:193:3 - (ae-forgotten-export) The symbol "CapLevelController" needs to be exported by the entry point hls.d.ts
// src/config.ts:194:3 - (ae-forgotten-export) The symbol "FPSController" needs to be exported by the entry point hls.d.ts
// src/config.ts:87:3 - (ae-forgotten-export) The symbol "MediaKeySessionContext" needs to be exported by the entry point hls.d.ts
// src/config.ts:102:3 - (ae-forgotten-export) The symbol "DRMSystemsConfiguration" needs to be exported by the entry point hls.d.ts
// src/config.ts:205:3 - (ae-forgotten-export) The symbol "ILogger" needs to be exported by the entry point hls.d.ts
// src/config.ts:215:3 - (ae-forgotten-export) The symbol "AudioStreamController" needs to be exported by the entry point hls.d.ts
// src/config.ts:216:3 - (ae-forgotten-export) The symbol "AudioTrackController" needs to be exported by the entry point hls.d.ts
// src/config.ts:218:3 - (ae-forgotten-export) The symbol "SubtitleStreamController" needs to be exported by the entry point hls.d.ts
// src/config.ts:219:3 - (ae-forgotten-export) The symbol "SubtitleTrackController" needs to be exported by the entry point hls.d.ts
// src/config.ts:220:3 - (ae-forgotten-export) The symbol "TimelineController" needs to be exported by the entry point hls.d.ts
// src/config.ts:222:3 - (ae-forgotten-export) The symbol "EMEController" needs to be exported by the entry point hls.d.ts
// src/config.ts:225:3 - (ae-forgotten-export) The symbol "CMCDController" needs to be exported by the entry point hls.d.ts
// src/config.ts:227:3 - (ae-forgotten-export) The symbol "AbrController" needs to be exported by the entry point hls.d.ts
// src/config.ts:228:3 - (ae-forgotten-export) The symbol "BufferController" needs to be exported by the entry point hls.d.ts
// src/config.ts:229:3 - (ae-forgotten-export) The symbol "CapLevelController" needs to be exported by the entry point hls.d.ts
// src/config.ts:230:3 - (ae-forgotten-export) The symbol "FPSController" needs to be exported by the entry point hls.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
Loading