@videojs/mux-audio 10.7.0 → 10.8.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.
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HTMLVideoAdapter } from "@videojs/media/dom";
|
|
2
|
+
import { MUX_ALTERNATIVE_MEDIA_SUGGESTION, MuxMixin, SpfPlaybackMixin } from "@videojs/mux-video/spf";
|
|
3
3
|
import { HlsAudioMpegTsAdapter } from "@videojs/spf/adapters/hls-audio-mpeg-ts";
|
|
4
4
|
//#region src/spf/adapter.ts
|
|
5
|
+
/** The SPF Media `MuxAudioAdapter` plays through, with the Mux error copy pointing at the hls.js-backed flavor. */
|
|
6
|
+
var SpfAudioDelegate = class extends HlsAudioMpegTsAdapter {
|
|
7
|
+
static get alternativeMediaSuggestion() {
|
|
8
|
+
return MUX_ALTERNATIVE_MEDIA_SUGGESTION;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const SpfAudioAdapter = SpfPlaybackMixin(HTMLVideoAdapter, SpfAudioDelegate);
|
|
5
12
|
/**
|
|
6
13
|
* The Mux Media over the SPF audio-only HLS engine.
|
|
7
14
|
*
|
|
@@ -18,14 +25,18 @@ import { HlsAudioMpegTsAdapter } from "@videojs/spf/adapters/hls-audio-mpeg-ts";
|
|
|
18
25
|
* element ignores it either way. Mux publishes neither for a genuinely audio-only asset, so those URLs 404 — see the
|
|
19
26
|
* known shortcoming on the video flavor, which shares the derivation.
|
|
20
27
|
*
|
|
28
|
+
* Like the video flavor, it hands a source to the browser's own HLS support when SPF can't play it: on a browser
|
|
29
|
+
* without Media Source Extensions (iPhone Safari before iOS 17.1), for a source that isn't HLS (a static audio
|
|
30
|
+
* rendition), or when `source.preferPlayback` is `'native'`.
|
|
31
|
+
*
|
|
21
32
|
* An audio-only playback ID packaged as MPEG-TS plays: the flavor transmuxes it with the audio-only feature (no H.264
|
|
22
33
|
* framing bundled; see `@videojs/spf/adapters/hls-audio-mpeg-ts`). A plus-tier _video_ asset plays too: Mux muxes its
|
|
23
34
|
* audio into the video segments, so this fetches the lowest-bandwidth variant's segments and keeps only their AAC.
|
|
24
35
|
*/
|
|
25
|
-
var MuxAudioAdapter = class extends MuxMixin(
|
|
36
|
+
var MuxAudioAdapter = class extends MuxMixin(SpfAudioAdapter) {
|
|
26
37
|
static {
|
|
27
38
|
this.defaultProps = {
|
|
28
|
-
...
|
|
39
|
+
...SpfAudioAdapter.defaultProps,
|
|
29
40
|
src: "",
|
|
30
41
|
source: null
|
|
31
42
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HTMLVideoAdapter } from "@videojs/media/dom";
|
|
2
|
+
import { MuxSource, MuxVideoAdapterProps, SpfPlaybackProps } from "@videojs/mux-video/spf";
|
|
3
3
|
import { HlsAudioMpegTsAdapter } from "@videojs/spf/adapters/hls-audio-mpeg-ts";
|
|
4
4
|
//#region src/spf/adapter.d.ts
|
|
5
|
-
|
|
5
|
+
/** The Mux audio flavor's props: the same `src` and structured `source` as the video flavor's. */
|
|
6
|
+
export type MuxAudioAdapterProps = MuxVideoAdapterProps;
|
|
7
|
+
declare const MuxAudioAdapter_base: import("@videojs/utils/types").Constructor<Omit<Omit<HTMLVideoAdapter, keyof import("@videojs/mux-video/spf").SpfPlaybackAPI<Spf>> & import("@videojs/mux-video/spf").SpfPlaybackAPI<HlsAudioMpegTsAdapter>, "source"> & import("@videojs/mux-video/spf").MuxAdapterAPI<MuxSource>, []> & Omit<import("@videojs/utils/types").Constructor<Omit<HTMLVideoAdapter, keyof import("@videojs/mux-video/spf").SpfPlaybackAPI<Spf>> & import("@videojs/mux-video/spf").SpfPlaybackAPI<HlsAudioMpegTsAdapter>, []> & Omit<typeof HTMLVideoAdapter, "defaultProps" | "prototype"> & {
|
|
8
|
+
readonly defaultProps: SpfPlaybackProps;
|
|
9
|
+
}, "defaultProps" | "prototype"> & {
|
|
6
10
|
readonly alternativeMediaSuggestion: string | undefined;
|
|
7
|
-
readonly defaultProps: MuxAdapterProps
|
|
11
|
+
readonly defaultProps: import("@videojs/mux-video/spf").MuxAdapterProps<MuxSource>;
|
|
8
12
|
};
|
|
9
13
|
/**
|
|
10
14
|
* The Mux Media over the SPF audio-only HLS engine.
|
|
@@ -22,12 +26,16 @@ declare const MuxAudioAdapter_base: import("@videojs/utils/types").Constructor<O
|
|
|
22
26
|
* element ignores it either way. Mux publishes neither for a genuinely audio-only asset, so those URLs 404 — see the
|
|
23
27
|
* known shortcoming on the video flavor, which shares the derivation.
|
|
24
28
|
*
|
|
29
|
+
* Like the video flavor, it hands a source to the browser's own HLS support when SPF can't play it: on a browser
|
|
30
|
+
* without Media Source Extensions (iPhone Safari before iOS 17.1), for a source that isn't HLS (a static audio
|
|
31
|
+
* rendition), or when `source.preferPlayback` is `'native'`.
|
|
32
|
+
*
|
|
25
33
|
* An audio-only playback ID packaged as MPEG-TS plays: the flavor transmuxes it with the audio-only feature (no H.264
|
|
26
34
|
* framing bundled; see `@videojs/spf/adapters/hls-audio-mpeg-ts`). A plus-tier _video_ asset plays too: Mux muxes its
|
|
27
35
|
* audio into the video segments, so this fetches the lowest-bandwidth variant's segments and keeps only their AAC.
|
|
28
36
|
*/
|
|
29
37
|
export declare class MuxAudioAdapter extends MuxAudioAdapter_base {
|
|
30
|
-
static readonly defaultProps: Omit<
|
|
38
|
+
static readonly defaultProps: Omit<SpfPlaybackProps, 'src' | 'source'> & MuxAudioAdapterProps;
|
|
31
39
|
}
|
|
32
40
|
//#endregion
|
|
33
41
|
//# sourceMappingURL=adapter.d.ts.map
|
package/dist/dev/spf/adapter.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HTMLVideoAdapter } from "@videojs/media/dom";
|
|
2
|
+
import { MUX_ALTERNATIVE_MEDIA_SUGGESTION, MuxMixin, SpfPlaybackMixin } from "@videojs/mux-video/spf";
|
|
3
3
|
import { HlsAudioMpegTsAdapter } from "@videojs/spf/adapters/hls-audio-mpeg-ts";
|
|
4
4
|
//#region src/spf/adapter.ts
|
|
5
|
+
/** The SPF Media `MuxAudioAdapter` plays through, with the Mux error copy pointing at the hls.js-backed flavor. */
|
|
6
|
+
var SpfAudioDelegate = class extends HlsAudioMpegTsAdapter {
|
|
7
|
+
static get alternativeMediaSuggestion() {
|
|
8
|
+
return MUX_ALTERNATIVE_MEDIA_SUGGESTION;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const SpfAudioAdapter = SpfPlaybackMixin(HTMLVideoAdapter, SpfAudioDelegate);
|
|
5
12
|
/**
|
|
6
13
|
* The Mux Media over the SPF audio-only HLS engine.
|
|
7
14
|
*
|
|
@@ -18,14 +25,18 @@ import { HlsAudioMpegTsAdapter } from "@videojs/spf/adapters/hls-audio-mpeg-ts";
|
|
|
18
25
|
* element ignores it either way. Mux publishes neither for a genuinely audio-only asset, so those URLs 404 — see the
|
|
19
26
|
* known shortcoming on the video flavor, which shares the derivation.
|
|
20
27
|
*
|
|
28
|
+
* Like the video flavor, it hands a source to the browser's own HLS support when SPF can't play it: on a browser
|
|
29
|
+
* without Media Source Extensions (iPhone Safari before iOS 17.1), for a source that isn't HLS (a static audio
|
|
30
|
+
* rendition), or when `source.preferPlayback` is `'native'`.
|
|
31
|
+
*
|
|
21
32
|
* An audio-only playback ID packaged as MPEG-TS plays: the flavor transmuxes it with the audio-only feature (no H.264
|
|
22
33
|
* framing bundled; see `@videojs/spf/adapters/hls-audio-mpeg-ts`). A plus-tier _video_ asset plays too: Mux muxes its
|
|
23
34
|
* audio into the video segments, so this fetches the lowest-bandwidth variant's segments and keeps only their AAC.
|
|
24
35
|
*/
|
|
25
|
-
var MuxAudioAdapter = class extends MuxMixin(
|
|
36
|
+
var MuxAudioAdapter = class extends MuxMixin(SpfAudioAdapter) {
|
|
26
37
|
static {
|
|
27
38
|
this.defaultProps = {
|
|
28
|
-
...
|
|
39
|
+
...SpfAudioAdapter.defaultProps,
|
|
29
40
|
src: "",
|
|
30
41
|
source: null
|
|
31
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","names":[],"sources":["../../../src/spf/adapter.ts"],"sourcesContent":["// Only the
|
|
1
|
+
{"version":3,"file":"adapter.js","names":[],"sources":["../../../src/spf/adapter.ts"],"sourcesContent":["// Only the mixins are used from `@videojs/mux-video/spf`. Its `MuxVideoAdapter` (and the full HLS engine behind it) is\n// left for the consumer's bundler to drop, which `sideEffects: false` on that package allows, so this entry stays\n// audio-only.\nimport { HTMLVideoAdapter } from '@videojs/media/dom';\nimport {\n MUX_ALTERNATIVE_MEDIA_SUGGESTION,\n MuxMixin,\n type MuxSource,\n type MuxVideoAdapterProps,\n SpfPlaybackMixin,\n type SpfPlaybackProps,\n} from '@videojs/mux-video/spf';\nimport { HlsAudioMpegTsAdapter } from '@videojs/spf/adapters/hls-audio-mpeg-ts';\n\n/** The Mux audio flavor's props: the same `src` and structured `source` as the video flavor's. */\nexport type MuxAudioAdapterProps = MuxVideoAdapterProps;\n\n/** The SPF Media `MuxAudioAdapter` plays through, with the Mux error copy pointing at the hls.js-backed flavor. */\nclass SpfAudioDelegate extends HlsAudioMpegTsAdapter {\n static override get alternativeMediaSuggestion(): string | undefined {\n return MUX_ALTERNATIVE_MEDIA_SUGGESTION;\n }\n}\n\n// Over the video host adapter, as the hls.js-backed `MuxAudioAdapter` is (it\n// extends the video Media), so both flavors present one surface. The engine\n// underneath is audio-only either way.\nconst SpfAudioAdapter = SpfPlaybackMixin<typeof HTMLVideoAdapter, HlsAudioMpegTsAdapter>(\n HTMLVideoAdapter,\n SpfAudioDelegate\n);\n\n/**\n * The Mux Media over the SPF audio-only HLS engine.\n *\n * Same Mux surface as the video flavor — `src`, the structured `source`, and the derived `contentData` all come from\n * the shared mixin — over the subtractive engine, so only the audio renditions of whatever the playback ID names are\n * fetched. That is the one place this diverges from the hls.js-backed `<mux-audio>`, which runs the full engine and\n * downloads video renditions it never shows.\n *\n * `source.drm` is accepted but inert, unlike on the video flavor: the audio-only engine composes no EME. Mux encrypts\n * video renditions and leaves audio clear, so a protected playback ID still plays here.\n *\n * `contentData` is kept rather than dropped, for the same reason its hls.js counterpart has it: a playback ID played as\n * audio is usually a _video_ asset, whose poster and storyboard exist and which an audio skin may well want. The\n * element ignores it either way. Mux publishes neither for a genuinely audio-only asset, so those URLs 404 — see the\n * known shortcoming on the video flavor, which shares the derivation.\n *\n * Like the video flavor, it hands a source to the browser's own HLS support when SPF can't play it: on a browser\n * without Media Source Extensions (iPhone Safari before iOS 17.1), for a source that isn't HLS (a static audio\n * rendition), or when `source.preferPlayback` is `'native'`.\n *\n * An audio-only playback ID packaged as MPEG-TS plays: the flavor transmuxes it with the audio-only feature (no H.264\n * framing bundled; see `@videojs/spf/adapters/hls-audio-mpeg-ts`). A plus-tier _video_ asset plays too: Mux muxes its\n * audio into the video segments, so this fetches the lowest-bandwidth variant's segments and keeps only their AAC.\n */\nexport class MuxAudioAdapter extends MuxMixin<typeof SpfAudioAdapter, MuxSource>(SpfAudioAdapter) {\n static override readonly defaultProps: Omit<SpfPlaybackProps, 'src' | 'source'> & MuxAudioAdapterProps = {\n ...SpfAudioAdapter.defaultProps,\n src: '',\n source: null,\n };\n}\n"],"mappings":";;;;;AAkBA,IAAM,mBAAN,cAA+B,sBAAsB;CACnD,WAAoB,6BAAiD;EACnE,OAAO;CACT;AACF;AAKA,MAAM,kBAAkB,iBACtB,kBACA,gBACF;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,kBAAb,cAAqC,SAA4C,eAAe,CAAC,CAAC;;EACS,KAAA,eAAA;GACvG,GAAG,gBAAgB;GACnB,KAAK;GACL,QAAQ;EACV;;AACF"}
|
package/dist/dev/spf.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MuxAudioAdapter } from "./spf/adapter.js";
|
|
1
|
+
import { MuxAudioAdapter, MuxAudioAdapterProps } from "./spf/adapter.js";
|
|
2
2
|
import { MuxContentData, MuxSourceBase } from "@videojs/mux-video";
|
|
3
|
-
import { MuxAdapterAPI, MuxAdapterProps } from "@videojs/mux-video/spf";
|
|
4
|
-
export { type MuxAdapterAPI, type MuxAdapterProps, MuxAudioAdapter, type MuxContentData, type MuxSourceBase };
|
|
3
|
+
import { MuxAdapterAPI, MuxAdapterProps, MuxSource } from "@videojs/mux-video/spf";
|
|
4
|
+
export { type MuxAdapterAPI, type MuxAdapterProps, MuxAudioAdapter, type MuxAudioAdapterProps, type MuxContentData, type MuxSource, type MuxSourceBase };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@videojs/mux-audio",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.0",
|
|
4
4
|
"description": "Mux audio playback adapter for Video.js, over hls.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hls",
|
|
@@ -40,9 +40,10 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@videojs/
|
|
44
|
-
"@videojs/
|
|
45
|
-
"@videojs/
|
|
43
|
+
"@videojs/media": "10.8.0",
|
|
44
|
+
"@videojs/mux-video": "10.8.0",
|
|
45
|
+
"@videojs/spf": "10.8.0",
|
|
46
|
+
"@videojs/utils": "10.8.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"jsdom": "^26.1.0",
|