@videojs/mux-audio 10.0.0-rc.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/LICENSE +20 -0
- package/README.md +27 -0
- package/dist/default/index.js +7 -0
- package/dist/default/index.js.map +1 -0
- package/dist/default/spf/adapter.js +29 -0
- package/dist/default/spf/adapter.js.map +1 -0
- package/dist/default/spf.js +2 -0
- package/dist/dev/index.d.ts +6 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +7 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/dev/spf/adapter.d.ts +26 -0
- package/dist/dev/spf/adapter.d.ts.map +1 -0
- package/dist/dev/spf/adapter.js +29 -0
- package/dist/dev/spf/adapter.js.map +1 -0
- package/dist/dev/spf.d.ts +4 -0
- package/dist/dev/spf.js +2 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2025-present Video.js contributors
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
14
|
+
|
|
15
|
+
------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
Trademark Notice:
|
|
18
|
+
“Video.js” is a registered trademark of Brightcove Inc.
|
|
19
|
+
The project is maintained independently by the open-source community,
|
|
20
|
+
governed by the Video.js Technical Steering Committee.
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @videojs/mux-audio
|
|
2
|
+
|
|
3
|
+
The Video.js playback adapter for Mux-hosted audio, over [hls.js](https://github.com/video-dev/hls.js). `MuxAudioAdapter`
|
|
4
|
+
extends the Mux video adapter from `@videojs/mux-video` and plays through an `<audio>` element, so audio installs by the
|
|
5
|
+
media it plays.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @videojs/html @videojs/mux-audio
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @videojs/react @videojs/mux-audio
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import '@videojs/html/media/mux-audio';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { MuxAudio } from '@videojs/react/media/mux-audio';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
[Apache-2.0](../../LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { MuxVideoAdapter } from '@videojs/mux-video';\n\nexport type { MuxSource, MuxVideoAdapterProps as MuxAudioAdapterProps } from '@videojs/mux-video';\n\n// TODO(mux): audio extending video is upside down. The hls.js-backed Mux behavior should move to a shared base that a\n// video and an audio adapter both extend; until then this class exists so audio installs by the media it plays and has\n// a home for audio-only behavior.\nexport class MuxAudioAdapter extends MuxVideoAdapter {}\n"],"mappings":";;AAOA,IAAa,kBAAb,cAAqC,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MuxMixin } from "@videojs/mux-video/spf";
|
|
2
|
+
import { HlsAudioAdapter } from "@videojs/spf/hls-audio";
|
|
3
|
+
//#region src/spf/adapter.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Mux Media over the SPF audio-only HLS engine.
|
|
6
|
+
*
|
|
7
|
+
* Same Mux surface as the video flavor — `src`, the structured `source`, and the derived `contentData` all come from
|
|
8
|
+
* the shared mixin — over the subtractive engine, so only the audio renditions of whatever the playback ID names are
|
|
9
|
+
* fetched. That is the one place this diverges from the hls.js-backed `<mux-audio>`, which runs the full engine and
|
|
10
|
+
* downloads video renditions it never shows.
|
|
11
|
+
*
|
|
12
|
+
* `contentData` is kept rather than dropped, for the same reason its hls.js counterpart has it: a playback ID played as
|
|
13
|
+
* audio is usually a _video_ asset, whose poster and storyboard exist and which an audio skin may well want. The
|
|
14
|
+
* element ignores it either way. Mux publishes neither for a genuinely audio-only asset, so those URLs 404 — see the
|
|
15
|
+
* known shortcoming on the video flavor, which shares the derivation.
|
|
16
|
+
*/
|
|
17
|
+
var MuxAudioAdapter = class extends MuxMixin(HlsAudioAdapter) {
|
|
18
|
+
static {
|
|
19
|
+
this.defaultProps = {
|
|
20
|
+
...HlsAudioAdapter.defaultProps,
|
|
21
|
+
src: "",
|
|
22
|
+
source: null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { MuxAudioAdapter };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","names":[],"sources":["../../../src/spf/adapter.ts"],"sourcesContent":["// Only the mixin is 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 { type MuxAdapterProps, MuxMixin } from '@videojs/mux-video/spf';\nimport { HlsAudioAdapter, type HlsAudioAdapterProps } from '@videojs/spf/hls-audio';\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 * `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 */\nexport class MuxAudioAdapter extends MuxMixin(HlsAudioAdapter) {\n static override readonly defaultProps: Omit<HlsAudioAdapterProps, 'src'> & MuxAdapterProps = {\n ...HlsAudioAdapter.defaultProps,\n src: '',\n source: null,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAa,kBAAb,cAAqC,SAAS,eAAe,CAAC,CAAC;;EACgC,KAAA,eAAA;GAC3F,GAAG,gBAAgB;GACnB,KAAK;GACL,QAAQ;EACV;;AACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MuxSource, MuxVideoAdapter, MuxVideoAdapterProps as MuxAudioAdapterProps } from "@videojs/mux-video";
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
declare class MuxAudioAdapter extends MuxVideoAdapter {}
|
|
4
|
+
//#endregion
|
|
5
|
+
export { MuxAudioAdapter, type MuxAudioAdapterProps, type MuxSource };
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;cAOa,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { MuxVideoAdapter } from '@videojs/mux-video';\n\nexport type { MuxSource, MuxVideoAdapterProps as MuxAudioAdapterProps } from '@videojs/mux-video';\n\n// TODO(mux): audio extending video is upside down. The hls.js-backed Mux behavior should move to a shared base that a\n// video and an audio adapter both extend; until then this class exists so audio installs by the media it plays and has\n// a home for audio-only behavior.\nexport class MuxAudioAdapter extends MuxVideoAdapter {}\n"],"mappings":";;AAOA,IAAa,kBAAb,cAAqC,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MuxAdapterProps } from "@videojs/mux-video/spf";
|
|
2
|
+
import { HlsAudioAdapter, HlsAudioAdapterProps } from "@videojs/spf/hls-audio";
|
|
3
|
+
//#region src/spf/adapter.d.ts
|
|
4
|
+
declare const MuxAudioAdapter_base: import("@videojs/utils/types").Constructor<HlsAudioAdapter & import("@videojs/mux-video/spf").MuxAdapterAPI, any[]> & Omit<typeof HlsAudioAdapter, "prototype"> & {
|
|
5
|
+
readonly alternativeMediaSuggestion: string | undefined;
|
|
6
|
+
readonly defaultProps: MuxAdapterProps;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The Mux Media over the SPF audio-only HLS engine.
|
|
10
|
+
*
|
|
11
|
+
* Same Mux surface as the video flavor — `src`, the structured `source`, and the derived `contentData` all come from
|
|
12
|
+
* the shared mixin — over the subtractive engine, so only the audio renditions of whatever the playback ID names are
|
|
13
|
+
* fetched. That is the one place this diverges from the hls.js-backed `<mux-audio>`, which runs the full engine and
|
|
14
|
+
* downloads video renditions it never shows.
|
|
15
|
+
*
|
|
16
|
+
* `contentData` is kept rather than dropped, for the same reason its hls.js counterpart has it: a playback ID played as
|
|
17
|
+
* audio is usually a _video_ asset, whose poster and storyboard exist and which an audio skin may well want. The
|
|
18
|
+
* element ignores it either way. Mux publishes neither for a genuinely audio-only asset, so those URLs 404 — see the
|
|
19
|
+
* known shortcoming on the video flavor, which shares the derivation.
|
|
20
|
+
*/
|
|
21
|
+
declare class MuxAudioAdapter extends MuxAudioAdapter_base {
|
|
22
|
+
static readonly defaultProps: Omit<HlsAudioAdapterProps, 'src'> & MuxAdapterProps;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { MuxAudioAdapter };
|
|
26
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","names":[],"sources":["../../../src/spf/adapter.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAmBa,wBAAwB;kBACV,cAAc,KAAK,+BAA+B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MuxMixin } from "@videojs/mux-video/spf";
|
|
2
|
+
import { HlsAudioAdapter } from "@videojs/spf/hls-audio";
|
|
3
|
+
//#region src/spf/adapter.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Mux Media over the SPF audio-only HLS engine.
|
|
6
|
+
*
|
|
7
|
+
* Same Mux surface as the video flavor — `src`, the structured `source`, and the derived `contentData` all come from
|
|
8
|
+
* the shared mixin — over the subtractive engine, so only the audio renditions of whatever the playback ID names are
|
|
9
|
+
* fetched. That is the one place this diverges from the hls.js-backed `<mux-audio>`, which runs the full engine and
|
|
10
|
+
* downloads video renditions it never shows.
|
|
11
|
+
*
|
|
12
|
+
* `contentData` is kept rather than dropped, for the same reason its hls.js counterpart has it: a playback ID played as
|
|
13
|
+
* audio is usually a _video_ asset, whose poster and storyboard exist and which an audio skin may well want. The
|
|
14
|
+
* element ignores it either way. Mux publishes neither for a genuinely audio-only asset, so those URLs 404 — see the
|
|
15
|
+
* known shortcoming on the video flavor, which shares the derivation.
|
|
16
|
+
*/
|
|
17
|
+
var MuxAudioAdapter = class extends MuxMixin(HlsAudioAdapter) {
|
|
18
|
+
static {
|
|
19
|
+
this.defaultProps = {
|
|
20
|
+
...HlsAudioAdapter.defaultProps,
|
|
21
|
+
src: "",
|
|
22
|
+
source: null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { MuxAudioAdapter };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","names":[],"sources":["../../../src/spf/adapter.ts"],"sourcesContent":["// Only the mixin is 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 { type MuxAdapterProps, MuxMixin } from '@videojs/mux-video/spf';\nimport { HlsAudioAdapter, type HlsAudioAdapterProps } from '@videojs/spf/hls-audio';\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 * `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 */\nexport class MuxAudioAdapter extends MuxMixin(HlsAudioAdapter) {\n static override readonly defaultProps: Omit<HlsAudioAdapterProps, 'src'> & MuxAdapterProps = {\n ...HlsAudioAdapter.defaultProps,\n src: '',\n source: null,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAa,kBAAb,cAAqC,SAAS,eAAe,CAAC,CAAC;;EACgC,KAAA,eAAA;GAC3F,GAAG,gBAAgB;GACnB,KAAK;GACL,QAAQ;EACV;;AACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MuxAudioAdapter } from "./spf/adapter.js";
|
|
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 };
|
package/dist/dev/spf.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@videojs/mux-audio",
|
|
3
|
+
"version": "10.0.0-rc.1",
|
|
4
|
+
"description": "Mux audio playback adapter for Video.js, over hls.js",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"hls",
|
|
7
|
+
"media",
|
|
8
|
+
"mux",
|
|
9
|
+
"streaming",
|
|
10
|
+
"videojs"
|
|
11
|
+
],
|
|
12
|
+
"license": "Apache-2.0",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/videojs/v10",
|
|
16
|
+
"directory": "packages/adapters/mux-audio"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"main": "dist/default/index.js",
|
|
24
|
+
"module": "dist/default/index.js",
|
|
25
|
+
"types": "dist/dev/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/dev/index.d.ts",
|
|
29
|
+
"development": "./dist/dev/index.js",
|
|
30
|
+
"default": "./dist/default/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./spf": {
|
|
33
|
+
"types": "./dist/dev/spf.d.ts",
|
|
34
|
+
"development": "./dist/dev/spf.js",
|
|
35
|
+
"default": "./dist/default/spf.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@videojs/mux-video": "10.0.0-rc.1",
|
|
43
|
+
"@videojs/utils": "10.0.0-rc.1",
|
|
44
|
+
"@videojs/spf": "10.0.0-rc.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"jsdom": "^26.1.0",
|
|
48
|
+
"vite-plus": "0.2.8",
|
|
49
|
+
"vitest": "4.1.10"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build:watch": "vp pack --watch ./src --no-clean",
|
|
53
|
+
"dev": "pnpm run build:watch",
|
|
54
|
+
"test": "vp test run",
|
|
55
|
+
"test:watch": "vp test",
|
|
56
|
+
"clean": "rimraf --glob dist types '*.tsbuildinfo'"
|
|
57
|
+
}
|
|
58
|
+
}
|