@mux/playback-core 0.17.0 → 0.18.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.
- package/dist/index.cjs.js +3 -1
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +4 -4
- package/dist/playback-core.js +46 -31
- package/dist/playback-core.js.map +4 -4
- package/dist/playback-core.mjs +46 -31
- package/dist/playback-core.mjs.map +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/errors.d.ts +2 -1
- package/dist/types/index.d.ts +25 -5
- package/dist/types/media-chrome.d.ts +6 -0
- package/dist/types/mux-embed.d.ts +594 -0
- package/dist/types/pdt.d.ts +7 -0
- package/dist/types/types.d.ts +14 -10
- package/dist/types/util.d.ts +3 -1
- package/dist/types-ts3.4/errors.d.ts +2 -1
- package/dist/types-ts3.4/index.d.ts +25 -5
- package/dist/types-ts3.4/media-chrome.d.ts +7 -0
- package/dist/types-ts3.4/mux-embed.d.ts +566 -0
- package/dist/types-ts3.4/pdt.d.ts +7 -0
- package/dist/types-ts3.4/types.d.ts +14 -10
- package/dist/types-ts3.4/util.d.ts +3 -1
- package/package.json +6 -6
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/// <reference path="mux-embed.d.ts" />
|
|
1
2
|
import { Options } from 'mux-embed';
|
|
3
|
+
import { MediaError } from './errors';
|
|
2
4
|
import { HlsInterface as Hls } from './hls';
|
|
3
5
|
type KeyTypes = string | number | symbol;
|
|
4
6
|
type Maybe<T> = T | null | undefined;
|
|
5
7
|
export declare const isKeyOf: <T extends {} = any>(k: KeyTypes, o: Maybe<T>) => k is keyof T;
|
|
6
8
|
export type ValueOf<T> = T[keyof T];
|
|
7
|
-
export type Metadata = Partial<Options['data']>;
|
|
9
|
+
export type Metadata = Partial<Required<Options>['data']>;
|
|
10
|
+
type MetaData = Metadata;
|
|
8
11
|
export type PlaybackEngine = Hls;
|
|
9
12
|
export type PlaybackCore = {
|
|
10
13
|
engine?: PlaybackEngine;
|
|
@@ -17,13 +20,11 @@ export type AutoplayTypes = {
|
|
|
17
20
|
};
|
|
18
21
|
export declare const AutoplayTypes: AutoplayTypes;
|
|
19
22
|
export type Autoplay = boolean | ValueOf<AutoplayTypes>;
|
|
23
|
+
export type HlsPlaylistTypes = 'VOD' | 'EVENT' | null | undefined;
|
|
20
24
|
export type StreamTypes = {
|
|
21
|
-
VOD: 'on-demand';
|
|
22
25
|
ON_DEMAND: 'on-demand';
|
|
23
26
|
LIVE: 'live';
|
|
24
|
-
|
|
25
|
-
DVR: 'live:dvr';
|
|
26
|
-
LL_DVR: 'll-live:dvr';
|
|
27
|
+
UNKNOWN: 'unknown';
|
|
27
28
|
};
|
|
28
29
|
export declare const StreamTypes: StreamTypes;
|
|
29
30
|
export type PlaybackTypes = {
|
|
@@ -57,7 +58,7 @@ export type CuePoint<T = any> = {
|
|
|
57
58
|
value: T;
|
|
58
59
|
};
|
|
59
60
|
export type MuxMediaPropTypes = {
|
|
60
|
-
envKey:
|
|
61
|
+
envKey: MetaData['env_key'];
|
|
61
62
|
debug: Options['debug'] & Hls['config']['debug'];
|
|
62
63
|
metadata: Partial<Options['data']>;
|
|
63
64
|
maxResolution: string;
|
|
@@ -66,19 +67,22 @@ export type MuxMediaPropTypes = {
|
|
|
66
67
|
errorTranslator: Options['errorTranslator'];
|
|
67
68
|
disableCookies: Options['disableCookies'];
|
|
68
69
|
playbackId: string;
|
|
69
|
-
playerInitTime:
|
|
70
|
+
playerInitTime: MetaData['player_init_time'];
|
|
70
71
|
preferPlayback: ValueOf<PlaybackTypes> | undefined;
|
|
71
72
|
type: MediaTypes;
|
|
72
73
|
streamType: ValueOf<StreamTypes>;
|
|
74
|
+
targetLiveWindow: number;
|
|
75
|
+
liveEdgeStart: number;
|
|
73
76
|
startTime: Hls['config']['startPosition'];
|
|
74
77
|
autoPlay?: Autoplay;
|
|
75
78
|
autoplay?: Autoplay;
|
|
76
79
|
preferCmcd: ValueOf<CmcdTypes> | undefined;
|
|
80
|
+
error?: HTMLMediaElement['error'] | MediaError;
|
|
77
81
|
};
|
|
78
|
-
export type HTMLMediaElementProps = Partial<Pick<HTMLMediaElement, 'src' | 'preload'>>;
|
|
82
|
+
export type HTMLMediaElementProps = Partial<Pick<HTMLMediaElement, 'src' | 'preload' | 'error' | 'seekable'>>;
|
|
79
83
|
export type MuxMediaProps = HTMLMediaElementProps & MuxMediaPropTypes;
|
|
80
84
|
export type MuxMediaPropsInternal = MuxMediaProps & {
|
|
81
|
-
playerSoftwareName:
|
|
82
|
-
playerSoftwareVersion:
|
|
85
|
+
playerSoftwareName: MetaData['player_software_name'];
|
|
86
|
+
playerSoftwareVersion: MetaData['player_software_version'];
|
|
83
87
|
};
|
|
84
88
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MuxMediaProps } from './types';
|
|
1
|
+
import { HlsPlaylistTypes, MuxMediaProps } from './types';
|
|
2
2
|
type addEventListenerWithTeardown = <K extends keyof HTMLMediaElementEventMap, T extends EventTarget = HTMLMediaElement>(mediaEl: HTMLMediaElement, type: K, listener: (this: T, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions, target?: T | HTMLMediaElement) => void;
|
|
3
3
|
export declare const addEventListenerWithTeardown: addEventListenerWithTeardown;
|
|
4
4
|
export declare function inSeekableRange(seekable: TimeRanges, duration: number, time: number): boolean;
|
|
@@ -7,5 +7,7 @@ export declare const toPlaybackIdParts: (playbackIdWithOptionalParams: string) =
|
|
|
7
7
|
string?
|
|
8
8
|
];
|
|
9
9
|
export declare const getType: (props: Partial<Pick<MuxMediaProps, 'type' | 'src'>>) => "" | import("./types").MediaTypes;
|
|
10
|
+
export declare const toStreamTypeFromPlaylistType: (playlistType: HlsPlaylistTypes) => "on-demand" | "live";
|
|
11
|
+
export declare const toTargetLiveWindowFromPlaylistType: (playlistType: HlsPlaylistTypes) => number;
|
|
10
12
|
export declare const inferMimeTypeFromURL: (url: string) => "" | "application/vnd.apple.mpegurl" | "video/mp4";
|
|
11
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/playback-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Core library for media playback in the browser shared by mux elements",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -42,15 +42,16 @@
|
|
|
42
42
|
"build:esm-module": "esbuild --metafile=./dist/module.json src/index.ts --target=es2019 --bundle --sourcemap --format=esm --outfile=./dist/playback-core.mjs",
|
|
43
43
|
"build:cjs": "esbuild --metafile=./dist/cjs.json src/index.ts --target=es2019 --bundle --sourcemap --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:mux-embed --external:hls.js",
|
|
44
44
|
"build:iife": "esbuild --metafile=./dist/iife.json src/index.ts --target=es2019 --bundle --sourcemap --format=iife --outfile=./dist/playback-core.js",
|
|
45
|
-
"
|
|
45
|
+
"prebuild:types": "shx mkdir -p ./dist/types && shx cp ../../types/** ./dist/types/",
|
|
46
|
+
"build:types": "tsc",
|
|
46
47
|
"postbuild:types": "downlevel-dts ./dist/types ./dist/types-ts3.4 --to=3.4",
|
|
47
48
|
"build": "npm-run-all --parallel 'build:esm --minify' 'build:iife --minify' 'build:cjs --minify' 'build:esm-module --minify'",
|
|
48
49
|
"create-release-notes": "create-release-notes ./CHANGELOG.md",
|
|
49
50
|
"publish-release": "../../scripts/publish.sh"
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
|
-
"hls.js": "1.
|
|
53
|
-
"mux-embed": "^4.
|
|
53
|
+
"hls.js": "1.4.0",
|
|
54
|
+
"mux-embed": "^4.24.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@mux/test-esm-exports": "0.1.0",
|
|
@@ -63,9 +64,8 @@
|
|
|
63
64
|
"esbuild": "^0.15.7",
|
|
64
65
|
"eslint": "^8.24.0",
|
|
65
66
|
"npm-run-all": "^4.1.5",
|
|
66
|
-
"shared-polyfills": "0.1.0",
|
|
67
67
|
"shx": "^0.3.4",
|
|
68
68
|
"typescript": "^4.9.4"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "0bf180baa5b87fb2e4f6671396adf20c9fa8bc80"
|
|
71
71
|
}
|