@mux/playback-core 0.15.1 → 0.16.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/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/dist/playback-core.js +30 -29
- package/dist/playback-core.js.map +4 -4
- package/dist/playback-core.mjs +30 -29
- package/dist/playback-core.mjs.map +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/tracks.d.ts +17 -1
- package/dist/types/types.d.ts +7 -2
- package/dist/types/util.d.ts +1 -1
- package/dist/types-ts3.4/index.d.ts +2 -2
- package/dist/types-ts3.4/tracks.d.ts +17 -1
- package/dist/types-ts3.4/types.d.ts +6 -1
- package/dist/types-ts3.4/util.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../src/types.ts","../src/util.ts","../src/autoplay.ts","../src/errors.ts","../src/preload.ts","../src/tracks.ts","../src/index.ts","../../../types/media-chrome.d.ts","../../../types/mux-embed.d.ts","../../../types/mux.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f","
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../src/types.ts","../src/util.ts","../src/autoplay.ts","../src/errors.ts","../src/preload.ts","../src/tracks.ts","../src/index.ts","../../../types/media-chrome.d.ts","../../../types/mux-embed.d.ts","../../../types/mux.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f","889063bdda67270a139b95c1323d214cbf028b19bac7da09982be33e2927e8af",{"version":"04805c25f4f3f9d9656acfc384ea47b6e1f46330ea1a36a038d82da74bc4541a","signature":"b00ecdc37bd286a7746ecdd2fb1403e84efcee710da123d9c08cf08dac488bf3"},{"version":"cda7db617e050c1ab1bad4323787f71c9249a32b1c093eb68f1703253c70a528","signature":"5365c69fdbb9f6f27c86d784adc7dbcac71e6f391b94468007095b4f6e993f65"},{"version":"f3a5aa00f603445ed61dcc8bbb8034f0fc697e63d05571ed7c21d9712fb4fbd5","signature":"5a6e81e28183631d440aedfbfa700c011b883b23d224ad0563106ff2c8de6a21"},{"version":"19d0b22f4d25a0720bd13093c6043aa5790d264c866c3f73b6a5e7417300fb35","signature":"8b1a6692156440f6585937b6b8de1c2692e7cac5c43aeb8893bfbd293f719552"},{"version":"33a7c8c6e9c79e94f4b71eddf5466737a12026eb1215daa85621b5c4f3524193","signature":"594247a3e85c76e671668ae878b41d5e11ad4dbeb32717b567300d2426bd4f8b"},{"version":"dcde3fca17de48371b0b110cf165bf7ff3cd177bcada7758b54224089ab7f143","signature":"f37af7d9608201a19cca4a298a057a0bd1babb2cb08caac3abcd054d105076a7"},{"version":"b6117dd1de4e8a837237e4c762de3e95facfbc1e1e7f76d8ffc7c9faa26424e8","signature":"0bc4d498aef24c591d8a4598d190b8bdfd5e5c6f6d38db9be8e14fd80e60f291"},"3cf4c7825a6c0ef1965e8906b85844aafdcdda9d95c8b4bcfcb3a20811cfd0b1","c5a4764697efe3b6b4eaf19b3dc1880cf3df665d30ec93e212233c29a2fa7207",{"version":"a092979673af6906d766c907c9bf0ae97c7bed1f0d9e69d870ce4d4505a51edd","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":5,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[37,38,39],[37,38,39,40,41,42,43,46],[38,39],[37,46],[38],[37],[37,38,41,43,46],[37,38]],"referencedMap":[[40,1],[44,2],[42,3],[43,1],[38,4],[39,5],[47,6]],"exportedModulesMap":[[40,5],[44,7],[42,5],[43,8],[38,4],[39,5],[47,6]],"semanticDiagnosticsPerFile":[37,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,36,35,32,33,34,1,10,9,40,41,44,42,43,38,39,45,46,47],"latestChangedDtsFile":"./types/index.d.ts"},"version":"4.9.4"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import mux from 'mux-embed';
|
|
2
2
|
import Hls from 'hls.js';
|
|
3
3
|
import { MediaError } from './errors';
|
|
4
|
-
import { addTextTrack, removeTextTrack } from './tracks';
|
|
4
|
+
import { addTextTrack, removeTextTrack, addCuePoints, getCuePoints, getActiveCuePoint, setupCuePoints, getCuePointsTrack } from './tracks';
|
|
5
5
|
import { StreamTypes, type ValueOf, type PlaybackCore, type MuxMediaProps, type MuxMediaPropsInternal } from './types';
|
|
6
|
-
export { mux, Hls, MediaError, addTextTrack, removeTextTrack };
|
|
6
|
+
export { mux, Hls, MediaError, addTextTrack, removeTextTrack, addCuePoints, getCuePoints, getActiveCuePoint, getCuePointsTrack, setupCuePoints, };
|
|
7
7
|
export * from './types';
|
|
8
8
|
export declare const generatePlayerInitTime: () => any;
|
|
9
9
|
export declare const generateUUID: any;
|
package/dist/types/tracks.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import Hls from 'hls.js';
|
|
2
|
+
import { CuePoint } from './types';
|
|
2
3
|
export declare function setupTracks(mediaEl: HTMLMediaElement, hls: Pick<Hls, 'on' | 'once' | 'subtitleTracks' | 'subtitleTrack'>): void;
|
|
3
|
-
export declare function addTextTrack(mediaEl: HTMLMediaElement, kind: TextTrackKind, label: string, lang?: string, id?: string): TextTrack
|
|
4
|
+
export declare function addTextTrack(mediaEl: HTMLMediaElement, kind: TextTrackKind, label: string, lang?: string, id?: string): TextTrack;
|
|
4
5
|
export declare function removeTextTrack(mediaEl: HTMLMediaElement, track: TextTrack): void;
|
|
6
|
+
export type CuePointsConfig = {
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const DefaultCuePointsConfig: CuePointsConfig;
|
|
10
|
+
export declare const getCuePointsTrack: (mediaEl: HTMLMediaElement, { label }?: CuePointsConfig) => TextTrack | undefined;
|
|
11
|
+
export declare function addCuePoints<T>(mediaEl: HTMLMediaElement, cuePoints: CuePoint<T>[], cuePointsConfig?: CuePointsConfig): Promise<TextTrack>;
|
|
12
|
+
export declare function getCuePoints(mediaEl: HTMLMediaElement, cuePointsConfig?: CuePointsConfig): {
|
|
13
|
+
time: number;
|
|
14
|
+
value: any;
|
|
15
|
+
}[];
|
|
16
|
+
export declare function getActiveCuePoint(mediaEl: HTMLMediaElement, cuePointsConfig?: CuePointsConfig): {
|
|
17
|
+
time: number;
|
|
18
|
+
value: any;
|
|
19
|
+
} | undefined;
|
|
20
|
+
export declare function setupCuePoints(mediaEl: HTMLMediaElement, cuePointsConfig?: CuePointsConfig): Promise<TextTrack>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Options } from 'mux-embed';
|
|
2
|
-
import Hls
|
|
1
|
+
import type { Options } from 'mux-embed';
|
|
2
|
+
import type Hls from 'hls.js';
|
|
3
|
+
import type { HlsConfig } from 'hls.js';
|
|
3
4
|
type KeyTypes = string | number | symbol;
|
|
4
5
|
type Maybe<T> = T | null | undefined;
|
|
5
6
|
export declare const isKeyOf: <T extends {} = any>(k: KeyTypes, o: Maybe<T>) => k is keyof T;
|
|
@@ -52,6 +53,10 @@ export type MediaTypes = ValueOf<ExtensionMimeTypeMap> | keyof MimeTypeShorthand
|
|
|
52
53
|
/** @TODO Figure out a way to "downgrade" derived types below to early TS syntax (e.g. 3.4) instead of explicit versions here (CJP) */
|
|
53
54
|
| 'hls';
|
|
54
55
|
export declare const allMediaTypes: MediaTypes[];
|
|
56
|
+
export type CuePoint<T = any> = {
|
|
57
|
+
time: number;
|
|
58
|
+
value: T;
|
|
59
|
+
};
|
|
55
60
|
export type MuxMediaPropTypes = {
|
|
56
61
|
envKey: Options['data']['env_key'];
|
|
57
62
|
debug: Options['debug'] & Hls['config']['debug'];
|
package/dist/types/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MuxMediaProps } from './types';
|
|
2
|
-
type addEventListenerWithTeardown = <K extends keyof HTMLMediaElementEventMap>(mediaEl: HTMLMediaElement, type: K, listener: (this:
|
|
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;
|
|
5
5
|
export declare const toPlaybackIdParts: (playbackIdWithOptionalParams: string) => [string, string?];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import mux from 'mux-embed';
|
|
2
2
|
import Hls from 'hls.js';
|
|
3
3
|
import { MediaError } from './errors';
|
|
4
|
-
import { addTextTrack, removeTextTrack } from './tracks';
|
|
4
|
+
import { addTextTrack, removeTextTrack, addCuePoints, getCuePoints, getActiveCuePoint, setupCuePoints, getCuePointsTrack } from './tracks';
|
|
5
5
|
import { StreamTypes, ValueOf, PlaybackCore, MuxMediaProps, MuxMediaPropsInternal } from './types';
|
|
6
|
-
export { mux, Hls, MediaError, addTextTrack, removeTextTrack };
|
|
6
|
+
export { mux, Hls, MediaError, addTextTrack, removeTextTrack, addCuePoints, getCuePoints, getActiveCuePoint, getCuePointsTrack, setupCuePoints, };
|
|
7
7
|
export * from './types';
|
|
8
8
|
export declare const generatePlayerInitTime: () => any;
|
|
9
9
|
export declare const generateUUID: any;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import Hls from 'hls.js';
|
|
2
|
+
import { CuePoint } from './types';
|
|
2
3
|
export declare function setupTracks(mediaEl: HTMLMediaElement, hls: Pick<Hls, 'on' | 'once' | 'subtitleTracks' | 'subtitleTrack'>): void;
|
|
3
|
-
export declare function addTextTrack(mediaEl: HTMLMediaElement, kind: TextTrackKind, label: string, lang?: string, id?: string): TextTrack
|
|
4
|
+
export declare function addTextTrack(mediaEl: HTMLMediaElement, kind: TextTrackKind, label: string, lang?: string, id?: string): TextTrack;
|
|
4
5
|
export declare function removeTextTrack(mediaEl: HTMLMediaElement, track: TextTrack): void;
|
|
6
|
+
export type CuePointsConfig = {
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const DefaultCuePointsConfig: CuePointsConfig;
|
|
10
|
+
export declare const getCuePointsTrack: (mediaEl: HTMLMediaElement, { label }?: CuePointsConfig) => TextTrack | undefined;
|
|
11
|
+
export declare function addCuePoints<T>(mediaEl: HTMLMediaElement, cuePoints: CuePoint<T>[], cuePointsConfig?: CuePointsConfig): Promise<TextTrack>;
|
|
12
|
+
export declare function getCuePoints(mediaEl: HTMLMediaElement, cuePointsConfig?: CuePointsConfig): {
|
|
13
|
+
time: number;
|
|
14
|
+
value: any;
|
|
15
|
+
}[];
|
|
16
|
+
export declare function getActiveCuePoint(mediaEl: HTMLMediaElement, cuePointsConfig?: CuePointsConfig): {
|
|
17
|
+
time: number;
|
|
18
|
+
value: any;
|
|
19
|
+
} | undefined;
|
|
20
|
+
export declare function setupCuePoints(mediaEl: HTMLMediaElement, cuePointsConfig?: CuePointsConfig): Promise<TextTrack>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Options } from 'mux-embed';
|
|
2
|
-
import Hls
|
|
2
|
+
import Hls from 'hls.js';
|
|
3
|
+
import { HlsConfig } from 'hls.js';
|
|
3
4
|
type KeyTypes = string | number | symbol;
|
|
4
5
|
type Maybe<T> = T | null | undefined;
|
|
5
6
|
export declare const isKeyOf: <T extends {} = any>(k: KeyTypes, o: Maybe<T>) => k is keyof T;
|
|
@@ -52,6 +53,10 @@ export type MediaTypes = ValueOf<ExtensionMimeTypeMap> | keyof MimeTypeShorthand
|
|
|
52
53
|
/** @TODO Figure out a way to "downgrade" derived types below to early TS syntax (e.g. 3.4) instead of explicit versions here (CJP) */
|
|
53
54
|
| 'hls';
|
|
54
55
|
export declare const allMediaTypes: MediaTypes[];
|
|
56
|
+
export type CuePoint<T = any> = {
|
|
57
|
+
time: number;
|
|
58
|
+
value: T;
|
|
59
|
+
};
|
|
55
60
|
export type MuxMediaPropTypes = {
|
|
56
61
|
envKey: Options['data']['env_key'];
|
|
57
62
|
debug: Options['debug'] & Hls['config']['debug'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MuxMediaProps } from './types';
|
|
2
|
-
type addEventListenerWithTeardown = <K extends keyof HTMLMediaElementEventMap>(mediaEl: HTMLMediaElement, type: K, listener: (this:
|
|
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;
|
|
5
5
|
export declare const toPlaybackIdParts: (playbackIdWithOptionalParams: string) => [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/playback-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"clean": "shx rm -rf dist/",
|
|
32
32
|
"lint": "eslint src/ --ext .js,.jsx,.ts,.tsx",
|
|
33
|
-
"test": "web-test-runner
|
|
33
|
+
"test": "web-test-runner **/*.test.js --port 8004 --coverage --config test/web-test-runner.config.mjs --root-dir ../..",
|
|
34
34
|
"posttest": "replace 'SF:src/' 'SF:packages/playback-core/src/' coverage/lcov.info --silent",
|
|
35
35
|
"dev:cjs": "yarn build:cjs --watch=forever",
|
|
36
36
|
"dev:esm": "yarn build:esm --watch=forever",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"publish-release": "../../scripts/publish.sh"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"hls.js": "1.
|
|
52
|
+
"hls.js": "1.3.1",
|
|
53
53
|
"mux-embed": "^4.14.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"shx": "^0.3.4",
|
|
68
68
|
"typescript": "^4.9.4"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "12ab63889a8a965587f6ea974d9c5b80d01d09da"
|
|
71
71
|
}
|