node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

9
server/node_modules/@mux/mux-video/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) 2021 Mux, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

312
server/node_modules/@mux/mux-video/README.md generated vendored Normal file
View File

@@ -0,0 +1,312 @@
<p align="center">
<h1 align="center">&lt;mux-video/&gt;</h1>
<a href="https://npmcharts.com/compare/@mux/mux-video?interval=30"><img src="https://img.shields.io/npm/dm/@mux/mux-video.svg?sanitize=true" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/@mux/mux-video"><img src="https://img.shields.io/npm/v/@mux/mux-video.svg?sanitize=true" alt="Version"></a>
<a href="https://www.npmjs.com/package/@mux/mux-video"><img src="https://img.shields.io/npm/l/@mux/mux-video.svg?sanitize=true" alt="License"></a>
</p>
# Introduction
`<mux-video></mux-video>` is a Mux-flavored HTML5 video element.
If you are familiar with using `<video />` + [Hls.js](https://github.com/video-dev/hls.js) in your application, then you'll feel right at home with this web component.
# Installation
If you're using `npm` or `yarn`, install that way:
## Package manager
```
yarn add @mux/mux-video
```
or
```
npm i @mux/mux-video
```
Then, import the library into your application with either `import` or `require`:
```js
import '@mux/mux-video';
```
or
```js
require('@mux/mux-video');
```
## CDN option
Alternatively, use the CDN hosted version of this package:
```html
<script src="https://cdn.jsdelivr.net/npm/@mux/mux-video@0"></script>
```
If you are using ECMAScript modules, you can also load the `mux-video.mjs` file with `type=module`:
```html
<script type="module" src="https://cdn.jsdelivr.net/npm/@mux/mux-video@0/dist/mux-video.mjs"></script>
```
## Features and benefits
Without `<mux-video>` if you want to use the browser built-in HTML5 video element for playback you would have to wire up [Hls.js](https://github.com/video-dev/hls.js) and [Mux Data](https://docs.mux.com/guides/data/monitor-hls-js) yourself.
`<mux-video>` will automatically handle recoverable errors that happen during video playback. This is particularly handy for live streams that may experience disconnects.
`<mux-video>` will use the optimial Hls.js settings for Mux Video so you don't have to worry about that. `<mux-video>` will also periodically test new versions of Hls.js and upgrade to known stable versions so you don't have to worry about upgrading to a new version of Hls.js yourself.
## Usage
Loading this library in the browser will register a [custom web component](https://developer.mozilla.org/en-US/docs/Web/Web_Components) for `<mux-video>`.
Now you are free to use this web component in your HTML, just as you would with the HTML5 `<video>` element.
```html
<body>
<mux-video
playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
controls
></mux-video>
</body>
```
Attributes:
- `playback-id`: This is the playback ID for your Mux Asset or Mux Live Stream. The playback-id is the variable you may have used before to construct a `.m3u8` hls url like this:`https://stream.mux.com/{PLAYBACK_ID}.m3u8`. [Mux Docs](https://docs.mux.com/guides/video/play-your-videos#1-get-your-playback-id)
- `env-key`: This is the environment key for Mux Data. Note that this is different than your API Key. Get your env key from the "Mux Data" part of the Mux Dashboard. If undefined and you are playing a Mux Video asset, the environment will be inferred.
<img src="../../images/env-key.png" alt="Mux Data dashboard env key"></img>
- `max-resolution`: This can be used to cap or expand the maximum resolution of the video delivered. When using signed URLs this attribute will not work and instead you will need to include the `max_resolution` parameter in your signed token.
- `min-resolution`: This can be used to to cap or expand the minimum resolution of the video delivered. When using signed URLs this attribute will not work and instead you will need to include the `min_resolution` parameter in your signed token.
- `rendition-order`: Set to `"desc"` to make the renditions of the video delivered be sorted in descending resolution order, which can impact the initial resolution loaded. When using signed URLs this attribute will not work and instead you will need to include the `rendition_order` parameter in your signed token.
- `program-start-time`: Apply PDT-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the beginning of the media stream.
- `program-end-time`: Apply PDT-based [instant clips](https://docs.mux.com/guides/create-instant-clips) to the end of the media stream.
- `metadata-video-title`: This is an arbitrary title for your video that will be passed in as metadata into Mux Data. Adding a title will give you useful context in your Mux Data dashboard. (optional, but encouraged)
- `metadata-viewer-user-id`: If you have a logged-in user this should be an anonymized ID value that maps back to the user in your database. Take care to not expose personal identifiable information like names, usernames or email addresses. (optional, but encouraged)
- `metadata-video-id`: This is an arbitrary ID that should map back to a record of this video in your database.
- `metadata-*`: This syntax can be used to pass any other Mux Data metadata fields, for example `metadata-sub-property-id="123"`
- `start-time: number (seconds)`: Set this to start playback of your media at some time other than 0 (or the "live edge" for live/"DVR" content).
- `disable-tracking`: Disables Mux Data tracking. For more, check out the [Mux Docs](https://docs.mux.com/guides/data/monitor-html5-video-element#features)
- `disable-cookies`: Disables cookies used by Mux Data. For more, check out the [Mux Docs](https://docs.mux.com/guides/data/monitor-html5-video-element#disable-cookies).
All the other attributes that you would use on a `<video>` element like `poster`, `controls`, `muted` and `autoplay` are available and will work the same as they do with the HTML5 video element. One sidenote about `autoplay` though -- [read this to understand why that might not always work as expected](https://docs.mux.com/guides/video/web-autoplay-your-videos).
### Advanced: more metadata
To go above and beyond `metadata-*` attributes
To set other available metadata fields use the `metadata` property on the `<mux-video>` element like so:
```html
<mux-video
playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
controls
>
</mux-video>
<script>
const muxVideo = document.querySelector('mux-video');
muxVideo.metadata = {
experiment_name: 'landing_page_v3',
video_content_type: 'clip',
video_series: 'season 1',
};
</script>
```
Instead of using the `metadata` property, you also have the option to specify a remote URL for fetching metadata asynchronously. In the example below you would have an API server running at `https://api.myapp.com/` and the specified endpoint should respond with JSON in the form of something like this:
```json
{
"experiment_name": "landing_page_v3",
"video_content_type": "clip",
"video_series": "season 1"
}
```
When `metadata-url` is specified then `<mux-video>` will asychronously fetch the extra metadata without blocking the initial startup time.
```html
<mux-video
playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
metadata-url="https://api.myapp.com/v1/metadata-endpoint.json"
controls
>
</mux-video>
```
Take a look at the [metadata guide](https://docs.mux.com/guides/data/make-your-data-actionable-with-metadata) to view an exhaustive list of available values.
### Advanced: prefer-playback
By default `<mux-video>` will try to use native playback via the underlying `<video>` tag whenever possible.
However, it can also instead use an in-code player when the browser browser supports [Media Source Extension](https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API).
This includes MSE in Mac OS Safari.
If you prefer to use the in-code MSE-based engine (currently hls.js) whenever possible, then set the `prefer-playback` attribute to `mse`.
```html
<mux-video
playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
prefer-playback="mse"
controls
>
</mux-video>
```
### Advanced: type
By default `<mux-video>` will try to figure out the type of media you're trying to play (for example, an HLS/m3u8 media source, an mp4, etc.) based the extension of the file from the `src` attribute's url. This allows `<mux-video>` to determine whether it can/should use an in-code player or native playback. By way of example, the code below has an identifiable "mp4" extension, so `<mux-video>` will rely on native plyaback via the underlying `<video/>` tag.
```html
<mux-video
src="https://stream.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/high.mp4"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
prefer-playback="mse"
controls
>
</mux-video>
```
Sometimes, however, your `src` URL may not have an identifiable extension. In these cases, we recommend relying on the `type` attribute, similar to the `<source/>` tag's [type attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source#attr-type). Below is an example of explicitly declaring the MIME type for an HLS/m3u8 media source:
```html
<mux-video
src="https://stream.notmux.com/path/to/an/hls/source/playlist"
type="application/vnd.apple.mpegurl"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
prefer-playback="mse"
controls
>
</mux-video>
```
Or, for convenience, we also support the shorthand `type="hls`:
```html
<mux-video
src="https://stream.notmux.com/path/to/an/hls/source/playlist"
type="hls"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
prefer-playback="mse"
controls
>
</mux-video>
```
### Advanced: Signed URLs and other playback query params
Mux supports a number of query parameters on HLS playback URLs. Most commonly is the `token=` param [used for signed URLs](https://docs.mux.com/guides/video/secure-video-playback).
In order to use `token=` -- or any other query params, pass them through with the `playback-id` attribute:
```
playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe?token=jwt-signed-token"
```
### Advanced: CuePoints
`<mux-video>` has an extended API for working with CuePoints metadata. This includes the `addCuePoints()` method to add CuePoints, `cuePoints` and `activeCuePoint` properties to get all CuePoints or the current active CuePoint (based on the element's `currentTime`), and the `cuepointchange` event, which fires whenever the `activeCuePoint` changes. The "shape" of a CuePoint is `{ time: number; value: any; }`, where `time` is the playback time you want the `CuePoint` to begin, and `value` is whatever (JSON-serializable) value is appropriate for your CuePoint use case.
To add CuePoints via `addCuePoint()`, simply pass in an array of CuePoints (as described above). Note that CuePoints are tied to the loaded media source, so: (a) you'll need to wait until the media source (`src` or `playback-id`) has loaded before adding any CuePoints; and (b) the CuePoints will be removed if you `unload()` the current media source or change it by re-setting e.g. `playback-id`. Below is a simple example of using CuePoints:
```html
<mux-video
playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
controls
>
</mux-video>
<script>
const muxVideoEl = document.querySelector('mux-video');
function addCuePointsToElement() {
const cuePoints = [
{ time: 1, value: 'Simple Value' },
{ time: 3, value: { complex: 'Complex Object', duration: 2 } },
{ time: 10, value: true },
{ time: 15, value: { anything: 'That can be serialized to JSON and makes sense for your use case' } }
];
muxVideoEl.addCuePoints(cuePoints);
}
function cuePointChangeListener() {
// Do something with the activeCuePoint here.
console.log('Active CuePoint!', muxVideoEl.activeCuePoint);
}
//
muxVideoEl.addEventListener('cuepointchange', cuePointChangeListener);
// Here, we're `duration` and `'durationchange'` to determine if the `<mux-video>` element has loaded src. This also gives
// us the opportunity to compare our intended CuePoints against the duration of the media source.
// Note that you could use other events, such as `'loadedmetadata'` if that makes more sense for your use case.
if (playerEl.duration) {
addCuePointsToElement();
} else {
muxVideoEl.addEventListener('durationchange', addCuePointsToElement, { once: true });
}
</script>
```
One last thing to note about CuePoints: Although they only have a single `time` value, if a user seeks between the `time` of two CuePoints, the `cuepointchange` event will still fire and the `activeCuePoint` will be the earlier CuePoint. Using the example above for reference, we have a CuePoint with a `time` of `3` and another with a `time` of `10`. If a user seeks to `8`, the `activeCuePoint` will be the CuePoint with the `time` of `3`. This is intentional to cover as many use cases as possible. If you only care about the `activeCuePoint` when the `currentTime` is roughly
the same as the `time`, you can add some simple logic to account for that, e.g.:
```js
function cuePointChangeListener() {
// Only do something with the activeCuePoint if we're playing "near" its `time`.
const MARGIN_OF_ERROR = 1;
if (Math.abs(muxVideoEl.currentTime - muxVideoEl.activeCuePoint.time) <= MARGIN_OF_ERROR) {
console.log('Active CuePoint playing near its time!', muxVideoEl.activeCuePoint);
}
}
```
### Advanced: Use with React+TypeScript
Even though we don't (yet!) have our own `React` version of `<mux-video>`, you can still use it in your `React` app. However, if you're also using TypeScript, make sure you add the following TypeScript definitions, since custom elements (like as `<mux-video>`) will not be recognized as [Intrinsic Elements](https://www.typescriptlang.org/docs/handbook/jsx.html#intrinsic-elements):
```typescript
interface MuxVideoHTMLAttributes<T> extends React.VideoHTMLAttributes<T> {
debug?: boolean;
autoplay?: boolean;
}
declare global {
namespace JSX {
interface IntrinsicElements {
'mux-video': React.DetailedHTMLProps<MuxVideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
}
}
}
```
### Advanced: Overriding Stream Type
Stream Type is an [extended media ui API](https://github.com/video-dev/media-ui-extensions/blob/main/proposals/0010-stream-type.md) that can be used with UI libraries such as [Media Chrome](https://www.media-chrome.org/en/get-started). By default and in general, you can/should rely on the stream type inferred from the `src`/`playbackId`. However, for some advanced use cases, you may want to override this value or set it in advance of loading media to either `"live"` or `"on-demand"`.
# FAQ
### If I'm using Mux, do I have to use this library?
No, you do not. The way Mux delivers HLS video is compliant with the HLS spec. Any video player that supports HLS will work with Mux Video.
### If I'm not using Mux Video, can I still use this library?
You sure can! Instead of passing in `playback-id=""` attribute, pass in `src=""` with an HLS url. You can still use `env-key=""` to get all the features of Mux Data with your non-Mux video.

44
server/node_modules/@mux/mux-video/dist/index.cjs.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

44
server/node_modules/@mux/mux-video/dist/index.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

106
server/node_modules/@mux/mux-video/dist/mux-video.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

106
server/node_modules/@mux/mux-video/dist/mux-video.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
export declare const isMaybeBrowser: () => boolean;
export declare const isMaybeServer: () => boolean;
export declare const getPlayerVersion: () => string;

View File

@@ -0,0 +1,147 @@
import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core';
import { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue, Chapter, CuePoint } from '@mux/playback-core';
import { CustomVideoElement, Events as VideoEvents } from 'custom-media-element';
import { HlsConfig } from 'hls.js';
export declare const Attributes: {
readonly BEACON_COLLECTION_DOMAIN: "beacon-collection-domain";
readonly CUSTOM_DOMAIN: "custom-domain";
readonly DEBUG: "debug";
readonly DISABLE_TRACKING: "disable-tracking";
readonly DISABLE_COOKIES: "disable-cookies";
readonly DRM_TOKEN: "drm-token";
readonly PLAYBACK_TOKEN: "playback-token";
readonly ENV_KEY: "env-key";
readonly MAX_RESOLUTION: "max-resolution";
readonly MIN_RESOLUTION: "min-resolution";
readonly RENDITION_ORDER: "rendition-order";
readonly PROGRAM_START_TIME: "program-start-time";
readonly PROGRAM_END_TIME: "program-end-time";
readonly ASSET_START_TIME: "asset-start-time";
readonly ASSET_END_TIME: "asset-end-time";
readonly METADATA_URL: "metadata-url";
readonly PLAYBACK_ID: "playback-id";
readonly PLAYER_SOFTWARE_NAME: "player-software-name";
readonly PLAYER_SOFTWARE_VERSION: "player-software-version";
readonly PREFER_CMCD: "prefer-cmcd";
readonly PREFER_PLAYBACK: "prefer-playback";
readonly START_TIME: "start-time";
readonly STREAM_TYPE: "stream-type";
readonly TARGET_LIVE_WINDOW: "target-live-window";
readonly LIVE_EDGE_OFFSET: "live-edge-offset";
readonly TYPE: "type";
};
declare class MuxVideoBaseElement extends CustomVideoElement implements Partial<MuxMediaProps> {
private "MuxVideoBaseElement.#private";
static readonly observedAttributes: string[];
constructor();
preferCmcd: ValueOf<CmcdTypes> | undefined;
readonly playerInitTime: number;
playerSoftwareName: string | undefined;
playerSoftwareVersion: string | undefined;
readonly _hls: PlaybackEngine | undefined;
readonly mux: Readonly<HTMLVideoElement['mux']> | undefined;
readonly error: globalThis.MediaError | null;
errorTranslator: ((errorEvent: any) => any) | undefined;
src: string;
type: ValueOf<ExtensionMimeTypeMap> | undefined;
/*@ts-ignore
@ts-ignore */
autoplay: Autoplay;
preload: "" | "none" | "metadata" | "auto";
debug: boolean;
disableTracking: boolean;
disableCookies: boolean;
startTime: number | undefined;
playbackId: string | undefined;
maxResolution: MaxResolutionValue | undefined;
minResolution: MinResolutionValue | undefined;
renditionOrder: RenditionOrderValue | undefined;
programStartTime: number | undefined;
programEndTime: number | undefined;
assetStartTime: number | undefined;
assetEndTime: number | undefined;
customDomain: string | undefined;
drmToken: string | undefined;
/*
* Get the playback token for signing the src URL.
* Set the playback token for signing the src URL.
*/
playbackToken: string | undefined;
tokens: {
drm?: string;
playback?: string;
thumbnail?: string;
storyboard?: string;
};
readonly ended: boolean;
envKey: string | undefined;
beaconCollectionDomain: string | undefined;
streamType: ValueOf<StreamTypes> | undefined;
targetLiveWindow: number | undefined;
readonly liveEdgeStart: number;
liveEdgeOffset: number | undefined;
readonly seekable: TimeRanges;
addCuePoints<T = any>(cuePoints: CuePoint<T>[]): Promise<TextTrack>;
readonly activeCuePoint: {
time: number;
value: any;
} | undefined;
readonly cuePoints: {
time: number;
value: any;
}[];
addChapters(chapters: Chapter[]): Promise<TextTrack>;
readonly activeChapter: {
startTime: number;
endTime: number;
value: string;
} | undefined;
readonly chapters: {
startTime: number;
endTime: number;
value: string;
}[];
getStartDate(): Date;
readonly currentPdt: Date;
preferPlayback: ValueOf<PlaybackTypes> | undefined;
metadata: Readonly<Metadata> | undefined;
_hlsConfig: Readonly<Partial<HlsConfig>> | undefined;
load(): void;
unload(): void;
attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string | null): void;
connectedCallback(): void;
disconnectedCallback(): void;
}
declare const MuxVideoElement_base: import("media-tracks").WithMediaTracks<typeof MuxVideoBaseElement>;
declare class MuxVideoElement extends MuxVideoElement_base {
private "MuxVideoElement.#private";
readonly muxCastCustomData: {
readonly mux: {
readonly playbackId: string | undefined;
readonly minResolution: MinResolutionValue | undefined;
readonly maxResolution: MaxResolutionValue | undefined;
readonly renditionOrder: "desc" | undefined;
readonly customDomain: string | undefined;
/** @TODO Add this.tokens to MuxVideoElement (CJP) */
readonly tokens: {
readonly drm: string | undefined;
};
readonly envKey: string | undefined;
readonly metadata: Readonly<Partial<import("mux-embed").Metadata>> | undefined;
readonly disableCookies: boolean;
readonly disableTracking: boolean;
readonly beaconCollectionDomain: string | undefined;
readonly startTime: number | undefined;
readonly preferCmcd: ValueOf<CmcdTypes> | undefined;
};
};
castCustomData: Record<string, any> | undefined;
}
type MuxVideoElementType = typeof MuxVideoElement;
declare global {
var MuxVideoElement: MuxVideoElementType;
}
export { PlaybackEngine, PlaybackEngine as Hls, ExtensionMimeTypeMap as MimeTypes, MediaError, VideoEvents };
export default MuxVideoElement;

View File

@@ -0,0 +1,4 @@
type GlobalThis = typeof globalThis;
declare const internalGlobalThis: GlobalThis;
declare const internalDocument: Document;
export { internalGlobalThis as globalThis, internalDocument as document };

View File

@@ -0,0 +1,3 @@
export declare const isMaybeBrowser: () => boolean;
export declare const isMaybeServer: () => boolean;
export declare const getPlayerVersion: () => string;

View File

@@ -0,0 +1,185 @@
import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core';
import type { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue, Chapter, CuePoint } from '@mux/playback-core';
import { CustomVideoElement, Events as VideoEvents } from 'custom-media-element';
import type { HlsConfig } from 'hls.js';
export declare const Attributes: {
readonly BEACON_COLLECTION_DOMAIN: "beacon-collection-domain";
readonly CUSTOM_DOMAIN: "custom-domain";
readonly DEBUG: "debug";
readonly DISABLE_TRACKING: "disable-tracking";
readonly DISABLE_COOKIES: "disable-cookies";
readonly DRM_TOKEN: "drm-token";
readonly PLAYBACK_TOKEN: "playback-token";
readonly ENV_KEY: "env-key";
readonly MAX_RESOLUTION: "max-resolution";
readonly MIN_RESOLUTION: "min-resolution";
readonly RENDITION_ORDER: "rendition-order";
readonly PROGRAM_START_TIME: "program-start-time";
readonly PROGRAM_END_TIME: "program-end-time";
readonly ASSET_START_TIME: "asset-start-time";
readonly ASSET_END_TIME: "asset-end-time";
readonly METADATA_URL: "metadata-url";
readonly PLAYBACK_ID: "playback-id";
readonly PLAYER_SOFTWARE_NAME: "player-software-name";
readonly PLAYER_SOFTWARE_VERSION: "player-software-version";
readonly PREFER_CMCD: "prefer-cmcd";
readonly PREFER_PLAYBACK: "prefer-playback";
readonly START_TIME: "start-time";
readonly STREAM_TYPE: "stream-type";
readonly TARGET_LIVE_WINDOW: "target-live-window";
readonly LIVE_EDGE_OFFSET: "live-edge-offset";
readonly TYPE: "type";
};
declare class MuxVideoBaseElement extends CustomVideoElement implements Partial<MuxMediaProps> {
#private;
static get observedAttributes(): string[];
constructor();
get preferCmcd(): ValueOf<CmcdTypes> | undefined;
set preferCmcd(value: ValueOf<CmcdTypes> | undefined);
get playerInitTime(): number;
get playerSoftwareName(): string | undefined;
set playerSoftwareName(value: string | undefined);
get playerSoftwareVersion(): string | undefined;
set playerSoftwareVersion(value: string | undefined);
get _hls(): PlaybackEngine | undefined;
get mux(): Readonly<HTMLVideoElement['mux']> | undefined;
get error(): globalThis.MediaError | null;
get errorTranslator(): ((errorEvent: any) => any) | undefined;
set errorTranslator(value: ((errorEvent: any) => any) | undefined);
get src(): string;
set src(val: string);
get type(): ValueOf<ExtensionMimeTypeMap> | undefined;
set type(val: ValueOf<ExtensionMimeTypeMap> | undefined);
/** @ts-ignore */
get autoplay(): Autoplay;
/** @ts-ignore */
set autoplay(val: Autoplay);
get preload(): "" | "none" | "metadata" | "auto";
set preload(val: "" | "none" | "metadata" | "auto");
get debug(): boolean;
set debug(val: boolean);
get disableTracking(): boolean;
set disableTracking(val: boolean);
get disableCookies(): boolean;
set disableCookies(val: boolean);
get startTime(): number | undefined;
set startTime(val: number | undefined);
get playbackId(): string | undefined;
set playbackId(val: string | undefined);
get maxResolution(): MaxResolutionValue | undefined;
set maxResolution(val: MaxResolutionValue | undefined);
get minResolution(): MinResolutionValue | undefined;
set minResolution(val: MinResolutionValue | undefined);
get renditionOrder(): RenditionOrderValue | undefined;
set renditionOrder(val: RenditionOrderValue | undefined);
get programStartTime(): number | undefined;
set programStartTime(val: number | undefined);
get programEndTime(): number | undefined;
set programEndTime(val: number | undefined);
get assetStartTime(): number | undefined;
set assetStartTime(val: number | undefined);
get assetEndTime(): number | undefined;
set assetEndTime(val: number | undefined);
get customDomain(): string | undefined;
set customDomain(val: string | undefined);
get drmToken(): string | undefined;
set drmToken(val: string | undefined);
/**
* Get the playback token for signing the src URL.
*/
get playbackToken(): string | undefined;
/**
* Set the playback token for signing the src URL.
*/
set playbackToken(val: string | undefined);
get tokens(): {
drm?: string;
playback?: string;
thumbnail?: string;
storyboard?: string;
};
set tokens(val: {
drm?: string;
playback?: string;
thumbnail?: string;
storyboard?: string;
});
get ended(): boolean;
get envKey(): string | undefined;
set envKey(val: string | undefined);
get beaconCollectionDomain(): string | undefined;
set beaconCollectionDomain(val: string | undefined);
get streamType(): ValueOf<StreamTypes> | undefined;
set streamType(val: ValueOf<StreamTypes> | undefined);
get targetLiveWindow(): number | undefined;
set targetLiveWindow(val: number | undefined);
get liveEdgeStart(): number;
get liveEdgeOffset(): number | undefined;
set liveEdgeOffset(val: number | undefined);
get seekable(): TimeRanges;
addCuePoints<T = any>(cuePoints: CuePoint<T>[]): Promise<TextTrack>;
get activeCuePoint(): {
time: number;
value: any;
} | undefined;
get cuePoints(): {
time: number;
value: any;
}[];
addChapters(chapters: Chapter[]): Promise<TextTrack>;
get activeChapter(): {
startTime: number;
endTime: number;
value: string;
} | undefined;
get chapters(): {
startTime: number;
endTime: number;
value: string;
}[];
getStartDate(): Date;
get currentPdt(): Date;
get preferPlayback(): ValueOf<PlaybackTypes> | undefined;
set preferPlayback(val: ValueOf<PlaybackTypes> | undefined);
get metadata(): Readonly<Metadata> | undefined;
set metadata(val: Readonly<Metadata> | undefined);
get _hlsConfig(): Readonly<Partial<HlsConfig>> | undefined;
set _hlsConfig(val: Readonly<Partial<HlsConfig>> | undefined);
load(): void;
unload(): void;
attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string | null): void;
connectedCallback(): void;
disconnectedCallback(): void;
}
declare const MuxVideoElement_base: import("media-tracks").WithMediaTracks<typeof MuxVideoBaseElement>;
declare class MuxVideoElement extends MuxVideoElement_base {
#private;
get muxCastCustomData(): {
readonly mux: {
readonly playbackId: string | undefined;
readonly minResolution: MinResolutionValue | undefined;
readonly maxResolution: MaxResolutionValue | undefined;
readonly renditionOrder: "desc" | undefined;
readonly customDomain: string | undefined;
/** @TODO Add this.tokens to MuxVideoElement (CJP) */
readonly tokens: {
readonly drm: string | undefined;
};
readonly envKey: string | undefined;
readonly metadata: Readonly<Partial<import("mux-embed").Metadata>> | undefined;
readonly disableCookies: boolean;
readonly disableTracking: boolean;
readonly beaconCollectionDomain: string | undefined;
readonly startTime: number | undefined;
readonly preferCmcd: ValueOf<CmcdTypes> | undefined;
};
};
get castCustomData(): Record<string, any> | undefined;
set castCustomData(val: Record<string, any> | undefined);
}
type MuxVideoElementType = typeof MuxVideoElement;
declare global {
var MuxVideoElement: MuxVideoElementType;
}
export { PlaybackEngine, PlaybackEngine as Hls, ExtensionMimeTypeMap as MimeTypes, MediaError, VideoEvents };
export default MuxVideoElement;

View File

@@ -0,0 +1,4 @@
type GlobalThis = typeof globalThis;
declare const internalGlobalThis: GlobalThis;
declare const internalDocument: Document;
export { internalGlobalThis as globalThis, internalDocument as document };

91
server/node_modules/@mux/mux-video/package.json generated vendored Normal file
View File

@@ -0,0 +1,91 @@
{
"name": "@mux/mux-video",
"version": "0.22.0",
"description": "A custom mux video element for the browser that Just Works™",
"keywords": [
"video",
"mux",
"player",
"hls",
"web-component"
],
"main": "./dist/index.cjs.js",
"module": "./dist/index.mjs",
"browser": "./dist/index.mjs",
"unpkg": "./dist/mux-video.js",
"jsdelivr": "./dist/mux-video.js",
"typesVersions": {
"<4.3.5": {
".": [
"./dist/types-ts3.4/index.d.ts"
]
},
"*": {
".": [
"./dist/types/index.d.ts"
]
}
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs.js",
"default": "./dist/index.cjs.js",
"types@<4.3.5": "./dist/types-ts3.4/index.d.ts",
"types": "./dist/types/index.d.ts"
}
},
"types": "./dist/types/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/muxinc/elements",
"directory": "packages/mux-video"
},
"author": "Mux, Inc.",
"license": "MIT",
"scripts": {
"clean": "shx rm -rf dist/ && shx rm -rf src/polyfills",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint src/ --ext .js,.jsx,.ts,.tsx",
"test": "web-test-runner **/*test.js --port 8002 --coverage --config test/web-test-runner.config.mjs --root-dir ../..",
"posttest": "replace 'SF:src/' 'SF:packages/mux-video/src/' coverage/lcov.info --silent",
"dev:iife": "yarn build:iife --watch=forever",
"dev:cjs": "yarn build:cjs --watch=forever",
"dev:esm": "yarn build:esm --watch=forever",
"dev:esm-module": "yarn build:esm-module --watch=forever",
"dev:types": "yarn build:types -w",
"dev": "npm-run-all --parallel dev:types dev:esm dev:cjs dev:iife",
"build:esm": "esbuild src/index.ts --target=es2019 --external:@mux/* --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm-module": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/module.json --format=esm --outfile=./dist/mux-video.mjs --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.ts --target=es2019 --external:@mux/* --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:iife": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/iife.json --format=iife --outfile=./dist/mux-video.js --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"copypolyfills": "shx mkdir -p src/polyfills && shx cp ../../shared/polyfills/index.ts ./src/polyfills/index.ts",
"build:types": "tsc",
"postbuild:types": "downlevel-dts ./dist/types ./dist/types-ts3.4",
"build": "npm-run-all --parallel 'build:esm --minify' 'build:iife --minify' 'build:cjs --minify' 'build:esm-module --minify'",
"create-release-notes": "create-release-notes ./CHANGELOG.md",
"publish-release": "../../scripts/publish.sh"
},
"dependencies": {
"@mux/playback-core": "0.27.0",
"castable-video": "~1.1.0",
"custom-media-element": "~1.3.1",
"media-tracks": "~0.3.2"
},
"devDependencies": {
"@open-wc/testing": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"@web/dev-server-esbuild": "^1.0.2",
"@web/dev-server-import-maps": "^0.2.1",
"@web/test-runner": "^0.18.2",
"downlevel-dts": "^0.11.0",
"esbuild": "^0.19.8",
"eslint": "^9.9.1",
"hls.js": "~1.5.11",
"npm-run-all": "^4.1.5",
"replace": "^1.2.1",
"shx": "^0.3.4",
"typescript": "^5.5.4"
},
"gitHead": "e1d17f4ce383e95489fc778d3c5bda3b89a27b5b"
}