@mux/mux-player 0.1.0-beta.21
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/CHANGELOG.md +281 -0
- package/LICENSE +9 -0
- package/README.md +231 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +161 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/dialog.ts.html +247 -0
- package/coverage/lcov-report/src/errors.ts.html +574 -0
- package/coverage/lcov-report/src/helpers.ts.html +478 -0
- package/coverage/lcov-report/src/html.ts.html +580 -0
- package/coverage/lcov-report/src/index.html +251 -0
- package/coverage/lcov-report/src/index.ts.html +2941 -0
- package/coverage/lcov-report/src/logger.ts.html +163 -0
- package/coverage/lcov-report/src/media-chrome/dialog.ts.html +661 -0
- package/coverage/lcov-report/src/media-chrome/index.html +131 -0
- package/coverage/lcov-report/src/media-chrome/time-display.ts.html +295 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/airplay.svg.html +109 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/captions-off.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/captions-on.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-enter.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-exit.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/index.html +326 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/pause.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/pip-enter.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/pip-exit.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/play.svg.html +100 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/seek-backward.svg.html +124 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/seek-forward.svg.html +124 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-high.svg.html +103 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-low.svg.html +103 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-medium.svg.html +103 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-off.svg.html +103 -0
- package/coverage/lcov-report/src/media-theme-mux/icons.ts.html +184 -0
- package/coverage/lcov-report/src/media-theme-mux/index.html +146 -0
- package/coverage/lcov-report/src/media-theme-mux/media-theme-mux.ts.html +1279 -0
- package/coverage/lcov-report/src/media-theme-mux/styles.css.html +586 -0
- package/coverage/lcov-report/src/styles.css.html +211 -0
- package/coverage/lcov-report/src/template.ts.html +463 -0
- package/coverage/lcov-report/src/utils.ts.html +385 -0
- package/coverage/lcov-report/src/video-api.ts.html +979 -0
- package/coverage/lcov.info +4058 -0
- package/dist/index.cjs.js +1432 -0
- package/dist/index.mjs +709 -0
- package/dist/mux-player.js +1478 -0
- package/dist/mux-player.mjs +1478 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/dialog.d.ts +6 -0
- package/dist/types/errors.d.ts +6 -0
- package/dist/types/helpers.d.ts +26 -0
- package/dist/types/html.d.ts +18 -0
- package/dist/types/index.d.ts +199 -0
- package/dist/types/logger.d.ts +5 -0
- package/dist/types/media-chrome/dialog.d.ts +12 -0
- package/dist/types/media-chrome/time-display.d.ts +9 -0
- package/dist/types/media-theme-mux/icons.d.ts +15 -0
- package/dist/types/media-theme-mux/media-theme-mux.d.ts +29 -0
- package/dist/types/template.d.ts +5 -0
- package/dist/types/utils.d.ts +10 -0
- package/dist/types/video-api.d.ts +64 -0
- package/dist/types-ts3.4/dialog.d.ts +6 -0
- package/dist/types-ts3.4/errors.d.ts +6 -0
- package/dist/types-ts3.4/helpers.d.ts +26 -0
- package/dist/types-ts3.4/html.d.ts +18 -0
- package/dist/types-ts3.4/index.d.ts +180 -0
- package/dist/types-ts3.4/logger.d.ts +5 -0
- package/dist/types-ts3.4/media-chrome/dialog.d.ts +12 -0
- package/dist/types-ts3.4/media-chrome/time-display.d.ts +9 -0
- package/dist/types-ts3.4/media-theme-mux/icons.d.ts +15 -0
- package/dist/types-ts3.4/media-theme-mux/media-theme-mux.d.ts +29 -0
- package/dist/types-ts3.4/template.d.ts +5 -0
- package/dist/types-ts3.4/utils.d.ts +10 -0
- package/dist/types-ts3.4/video-api.d.ts +53 -0
- package/lang/en.json +32 -0
- package/lang/nl.json +31 -0
- package/package.json +107 -0
- package/src/dialog.ts +54 -0
- package/src/errors.ts +163 -0
- package/src/helpers.ts +131 -0
- package/src/html.ts +165 -0
- package/src/index.ts +952 -0
- package/src/logger.ts +26 -0
- package/src/media-chrome/dialog.ts +192 -0
- package/src/media-chrome/time-display.ts +70 -0
- package/src/media-theme-mux/icons/airplay.svg +8 -0
- package/src/media-theme-mux/icons/captions-off.svg +5 -0
- package/src/media-theme-mux/icons/captions-on.svg +5 -0
- package/src/media-theme-mux/icons/fullscreen-enter.svg +5 -0
- package/src/media-theme-mux/icons/fullscreen-exit.svg +5 -0
- package/src/media-theme-mux/icons/pause.svg +5 -0
- package/src/media-theme-mux/icons/pip-enter.svg +5 -0
- package/src/media-theme-mux/icons/pip-exit.svg +5 -0
- package/src/media-theme-mux/icons/play.svg +5 -0
- package/src/media-theme-mux/icons/seek-backward.svg +13 -0
- package/src/media-theme-mux/icons/seek-forward.svg +13 -0
- package/src/media-theme-mux/icons/volume-high.svg +6 -0
- package/src/media-theme-mux/icons/volume-low.svg +6 -0
- package/src/media-theme-mux/icons/volume-medium.svg +6 -0
- package/src/media-theme-mux/icons/volume-off.svg +6 -0
- package/src/media-theme-mux/icons.ts +33 -0
- package/src/media-theme-mux/media-theme-mux.ts +398 -0
- package/src/media-theme-mux/styles.css +167 -0
- package/src/styles.css +42 -0
- package/src/template.ts +126 -0
- package/src/types.d.ts +52 -0
- package/src/utils.ts +100 -0
- package/src/video-api.ts +298 -0
- package/test/errors.test.js +169 -0
- package/test/helpers.test.js +78 -0
- package/test/player.test.js +696 -0
- package/test/template.test.js +70 -0
- package/test/utils.test.js +21 -0
- package/test/web-test-runner.config.mjs +29 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import '@mux/playback-core';
|
|
2
|
+
import { MediaController } from 'media-chrome';
|
|
3
|
+
import { MediaError } from '@mux/mux-video';
|
|
4
|
+
import { Metadata } from '@mux/playback-core';
|
|
5
|
+
import VideoApiElement from './video-api';
|
|
6
|
+
export { MediaError };
|
|
7
|
+
export declare type Tokens = {
|
|
8
|
+
playback?: string;
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
storyboard?: string;
|
|
11
|
+
};
|
|
12
|
+
declare type MediaController = Element & {
|
|
13
|
+
media: HTMLVideoElement;
|
|
14
|
+
};
|
|
15
|
+
declare class MuxPlayerElement extends VideoApiElement {
|
|
16
|
+
private "MuxPlayerElement.#private";
|
|
17
|
+
static readonly observedAttributes: string[];
|
|
18
|
+
constructor();
|
|
19
|
+
readonly theme: Element | null | undefined;
|
|
20
|
+
readonly mediaController: MediaController | null | undefined;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string): void;
|
|
24
|
+
readonly hasPlayed: boolean;
|
|
25
|
+
readonly inLiveWindow: boolean | undefined;
|
|
26
|
+
/*
|
|
27
|
+
* @deprecated please use ._hls instead
|
|
28
|
+
*/
|
|
29
|
+
readonly hls: import("hls.js").default | undefined;
|
|
30
|
+
readonly _hls: import("hls.js").default | undefined;
|
|
31
|
+
readonly mux: Readonly<import("../../../types/mux").MuxOnVideoElement | import("../../../types/mux").DeletedMuxOnVideoElement | undefined>;
|
|
32
|
+
/*
|
|
33
|
+
* Get the thumbnailTime offset used for the poster image.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
* Set the thumbnailTime offset used for the poster image.
|
|
37
|
+
*/
|
|
38
|
+
audio: boolean;
|
|
39
|
+
/*
|
|
40
|
+
* Get the thumbnailTime offset used for the poster image.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
* Set the thumbnailTime offset used for the poster image.
|
|
44
|
+
*/
|
|
45
|
+
thumbnailTime: number | undefined;
|
|
46
|
+
/*
|
|
47
|
+
* Get the primary color used by the player.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
* Set the primary color used by the player.
|
|
51
|
+
*/
|
|
52
|
+
primaryColor: string | undefined;
|
|
53
|
+
/*
|
|
54
|
+
* Get the secondary color used by the player.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
* Set the secondary color used by the player.
|
|
58
|
+
*/
|
|
59
|
+
secondaryColor: string | undefined;
|
|
60
|
+
/*
|
|
61
|
+
* Get the offset applied to the forward seek button.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
* Set the offset applied to the forward seek button.
|
|
65
|
+
*/
|
|
66
|
+
forwardSeekOffset: number | undefined;
|
|
67
|
+
/*
|
|
68
|
+
* Get the offset applied to the backward seek button.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
* Set the offset applied to the forward seek button.
|
|
72
|
+
*/
|
|
73
|
+
backwardSeekOffset: number | undefined;
|
|
74
|
+
/*
|
|
75
|
+
* Get the boolean value of default hidden captions.
|
|
76
|
+
* By default returns false so captions are enabled on initial load.
|
|
77
|
+
*/
|
|
78
|
+
readonly defaultHiddenCaptions: boolean;
|
|
79
|
+
/*
|
|
80
|
+
* Get the player software name. Used by Mux Data.
|
|
81
|
+
*/
|
|
82
|
+
readonly playerSoftwareName: string;
|
|
83
|
+
/*
|
|
84
|
+
* Get the player software version. Used by Mux Data.
|
|
85
|
+
*/
|
|
86
|
+
readonly playerSoftwareVersion: any;
|
|
87
|
+
/*
|
|
88
|
+
* Get the beacon collection domain. Used by Mux Data.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
* Set the beacon collection domain. Used by Mux Data.
|
|
92
|
+
*/
|
|
93
|
+
beaconCollectionDomain: string | undefined;
|
|
94
|
+
/*
|
|
95
|
+
* Get Mux asset playback id.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
* Set Mux asset playback id.
|
|
99
|
+
*/
|
|
100
|
+
playbackId: string | undefined;
|
|
101
|
+
/*
|
|
102
|
+
* Get Mux asset custom domain.
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
* Set Mux asset custom domain.
|
|
106
|
+
*/
|
|
107
|
+
customDomain: string | undefined;
|
|
108
|
+
/*
|
|
109
|
+
* Get Mux Data env key.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
* Set Mux Data env key.
|
|
113
|
+
*/
|
|
114
|
+
envKey: string | undefined;
|
|
115
|
+
/*
|
|
116
|
+
* Get video engine debug flag.
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
* Set video engine debug flag.
|
|
120
|
+
*/
|
|
121
|
+
debug: boolean;
|
|
122
|
+
/*
|
|
123
|
+
* Get stream type.
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
* Set stream type.
|
|
127
|
+
*/
|
|
128
|
+
streamType: string | null;
|
|
129
|
+
/*
|
|
130
|
+
* Get the start time.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
* Set the start time.
|
|
134
|
+
*/
|
|
135
|
+
startTime: number | undefined;
|
|
136
|
+
/*
|
|
137
|
+
* Get the preference flag for using media source.
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
* Set the preference flag for using media source.
|
|
141
|
+
*/
|
|
142
|
+
preferMse: boolean;
|
|
143
|
+
/*
|
|
144
|
+
* Get the metadata object for Mux Data.
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
* Set the metadata object for Mux Data.
|
|
148
|
+
*/
|
|
149
|
+
metadata: Readonly<Metadata> | undefined;
|
|
150
|
+
/*
|
|
151
|
+
* Get the signing tokens for the Mux asset URL's.
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
* Set the signing tokens for the Mux asset URL's.
|
|
155
|
+
*/
|
|
156
|
+
tokens: Tokens;
|
|
157
|
+
/*
|
|
158
|
+
* Get the playback token for signing the src URL.
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
* Set the playback token for signing the src URL.
|
|
162
|
+
*/
|
|
163
|
+
playbackToken: string | undefined;
|
|
164
|
+
/*
|
|
165
|
+
* Get the thumbnail token for signing the poster URL.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
* Set the thumbnail token for signing the poster URL.
|
|
169
|
+
*/
|
|
170
|
+
thumbnailToken: string | undefined;
|
|
171
|
+
/*
|
|
172
|
+
* Get the storyboard token for signing the storyboard URL.
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
* Set the storyboard token for signing the storyboard URL.
|
|
176
|
+
*/
|
|
177
|
+
storyboardToken: string | undefined;
|
|
178
|
+
}
|
|
179
|
+
export declare function getVideoAttribute(el: MuxPlayerElement, name: string): string | null;
|
|
180
|
+
export default MuxPlayerElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare class MediaDialog extends HTMLElement {
|
|
2
|
+
static styles: string;
|
|
3
|
+
static template: HTMLTemplateElement;
|
|
4
|
+
static observedAttributes: string[];
|
|
5
|
+
_previouslyFocusedElement?: Element | null;
|
|
6
|
+
constructor();
|
|
7
|
+
show(): void;
|
|
8
|
+
close(): void;
|
|
9
|
+
attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string): void;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
}
|
|
12
|
+
export default MediaDialog;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare class MxpTimeDisplay extends HTMLElement {
|
|
2
|
+
static styles: string;
|
|
3
|
+
static template: HTMLTemplateElement;
|
|
4
|
+
timeDisplayEl: HTMLElement | null | undefined;
|
|
5
|
+
constructor();
|
|
6
|
+
toggleTimeDisplay(): void;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
}
|
|
9
|
+
export default MxpTimeDisplay;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const Airplay: () => import("@github/template-parts").TemplateInstance;
|
|
2
|
+
export declare const CaptionsOff: () => import("@github/template-parts").TemplateInstance;
|
|
3
|
+
export declare const CaptionsOn: () => import("@github/template-parts").TemplateInstance;
|
|
4
|
+
export declare const FullscreenEnter: () => import("@github/template-parts").TemplateInstance;
|
|
5
|
+
export declare const FullscreenExit: () => import("@github/template-parts").TemplateInstance;
|
|
6
|
+
export declare const Pause: () => import("@github/template-parts").TemplateInstance;
|
|
7
|
+
export declare const PipEnter: () => import("@github/template-parts").TemplateInstance;
|
|
8
|
+
export declare const PipExit: () => import("@github/template-parts").TemplateInstance;
|
|
9
|
+
export declare const Play: () => import("@github/template-parts").TemplateInstance;
|
|
10
|
+
export declare const SeekBackward: (p: any) => import("@github/template-parts").TemplateInstance;
|
|
11
|
+
export declare const SeekForward: (p: any) => import("@github/template-parts").TemplateInstance;
|
|
12
|
+
export declare const VolumeHigh: () => import("@github/template-parts").TemplateInstance;
|
|
13
|
+
export declare const VolumeLow: () => import("@github/template-parts").TemplateInstance;
|
|
14
|
+
export declare const VolumeMedium: () => import("@github/template-parts").TemplateInstance;
|
|
15
|
+
export declare const VolumeOff: () => import("@github/template-parts").TemplateInstance;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import 'media-chrome';
|
|
2
|
+
import '../media-chrome/time-display';
|
|
3
|
+
declare type ThemeMuxTemplateProps = {
|
|
4
|
+
streamType: string;
|
|
5
|
+
audio: boolean;
|
|
6
|
+
playerSize: string;
|
|
7
|
+
defaultHiddenCaptions: boolean;
|
|
8
|
+
hasCaptions: boolean;
|
|
9
|
+
forwardSeekOffset: number;
|
|
10
|
+
backwardSeekOffset: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const AudioVodChrome: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
13
|
+
export declare const AudioDvrChrome: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
14
|
+
export declare const AudioLiveChrome: (_props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
15
|
+
export declare const VodChromeExtraSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
16
|
+
export declare const VodChromeSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
17
|
+
export declare const VodChromeLarge: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
18
|
+
export declare const LiveChromeExtraSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
19
|
+
export declare const LiveChromeSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
20
|
+
export declare const LiveChromeLarge: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
21
|
+
export declare const DvrChromeExtraSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
22
|
+
export declare const DvrChromeSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
23
|
+
export declare const DvrChromeLarge: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
|
|
24
|
+
declare class MediaThemeMux extends HTMLElement {
|
|
25
|
+
static readonly observedAttributes: string[];
|
|
26
|
+
constructor();
|
|
27
|
+
attributeChangedCallback(): void;
|
|
28
|
+
}
|
|
29
|
+
export default MediaThemeMux;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './media-theme-mux/media-theme-mux';
|
|
2
|
+
import './dialog';
|
|
3
|
+
import { MuxTemplateProps } from './types';
|
|
4
|
+
export declare const template: (props: MuxTemplateProps) => import("./html").TemplateResult;
|
|
5
|
+
export declare const content: (props: MuxTemplateProps) => import("./html").TemplateResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function i18n(str: string, translate?: boolean): any;
|
|
2
|
+
export declare function stylePropsToString(props: any): string | undefined;
|
|
3
|
+
export declare function kebabCase(name: string): string;
|
|
4
|
+
export declare function camelCase(name: string): string;
|
|
5
|
+
export declare function uniqueId(prefix: string): string;
|
|
6
|
+
export declare function toNumberOrUndefined(val: any): number | undefined;
|
|
7
|
+
export declare function toQuery(obj: Record<string, any>): string;
|
|
8
|
+
export declare function toParams(obj: Record<string, any>): URLSearchParams;
|
|
9
|
+
export declare function parseJwt(token: string): any;
|
|
10
|
+
export declare const containsComposedNode: (rootNode: Node, childNode?: Node | Element | null | undefined) => boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import MuxVideoElement from '@mux/mux-video';
|
|
2
|
+
export declare type CastOptions = {
|
|
3
|
+
receiverApplicationId: string;
|
|
4
|
+
autoJoinPolicy: string;
|
|
5
|
+
androidReceiverCompatible: boolean;
|
|
6
|
+
language: string;
|
|
7
|
+
resumeSavedSession: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare type MuxVideoElementExt = MuxVideoElement & {
|
|
10
|
+
requestCast(options: CastOptions): Promise<undefined>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Gets called from mux-player when mux-video is rendered and upgraded.
|
|
14
|
+
* We might just merge VideoApiElement in MuxPlayerElement and remove this?
|
|
15
|
+
*/
|
|
16
|
+
export declare function initVideoApi(el: VideoApiElement): void;
|
|
17
|
+
declare class VideoApiElement extends HTMLElement {
|
|
18
|
+
static readonly observedAttributes: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Create a HTMLVideoElement like API with opt-in methods to expose publicly.
|
|
21
|
+
* This class is intentionally not extending MuxVideoElement but composing it
|
|
22
|
+
* to opt in methods and not expose too much. More flexibility in the future.
|
|
23
|
+
*/
|
|
24
|
+
constructor();
|
|
25
|
+
attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string): void;
|
|
26
|
+
play(): Promise<void> | undefined;
|
|
27
|
+
pause(): void;
|
|
28
|
+
requestCast(options: CastOptions): Promise<undefined> | undefined;
|
|
29
|
+
readonly media: MuxVideoElementExt | null | undefined;
|
|
30
|
+
/*
|
|
31
|
+
* @deprecated please use .media instead
|
|
32
|
+
*/
|
|
33
|
+
readonly video: MuxVideoElementExt | null | undefined;
|
|
34
|
+
readonly paused: boolean;
|
|
35
|
+
readonly duration: number;
|
|
36
|
+
readonly ended: boolean;
|
|
37
|
+
readonly buffered: TimeRanges | undefined;
|
|
38
|
+
readonly readyState: number;
|
|
39
|
+
readonly videoWidth: number | undefined;
|
|
40
|
+
readonly videoHeight: number | undefined;
|
|
41
|
+
currentTime: number;
|
|
42
|
+
volume: number;
|
|
43
|
+
src: string | null;
|
|
44
|
+
poster: string;
|
|
45
|
+
playbackRate: number;
|
|
46
|
+
crossOrigin: string | null;
|
|
47
|
+
autoplay: boolean;
|
|
48
|
+
loop: boolean;
|
|
49
|
+
muted: boolean;
|
|
50
|
+
playsInline: boolean;
|
|
51
|
+
preload: string | null;
|
|
52
|
+
}
|
|
53
|
+
export default VideoApiElement;
|
package/lang/en.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"(opens in a new window)": "(opens in a new window)",
|
|
3
|
+
"Network Error": "Network Error",
|
|
4
|
+
"Video is not currently available": "Video is not currently available",
|
|
5
|
+
"The live stream or video file are not yet ready.": "The live stream or video file are not yet ready.",
|
|
6
|
+
"This playback-id may belong to a live stream that is not currently active or an asset that is not ready.": "This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",
|
|
7
|
+
"Video does not exist": "Video does not exist",
|
|
8
|
+
"This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.": "This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",
|
|
9
|
+
"The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.": "The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.",
|
|
10
|
+
"Invalid playback URL": "Invalid playback URL",
|
|
11
|
+
"The video URL or playback-token are formatted with incorrect or incomplete information.": "The video URL or playback-token are formatted with incorrect or incomplete information.",
|
|
12
|
+
"403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.": "403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",
|
|
13
|
+
"Video URL has expired": "Video URL has expired",
|
|
14
|
+
"The video’s secured playback-token has expired.": "The video’s secured playback-token has expired.",
|
|
15
|
+
"This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.": "This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",
|
|
16
|
+
"Video URL is formatted incorrectly": "Video URL is formatted incorrectly",
|
|
17
|
+
"The video’s playback ID does not match the one encoded in the playback-token.": "The video’s playback ID does not match the one encoded in the playback-token.",
|
|
18
|
+
"The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.": "The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",
|
|
19
|
+
"The playback-token is formatted with incorrect information.": "The playback-token is formatted with incorrect information.",
|
|
20
|
+
"The playback-token has an incorrect aud value: {tokenType}. aud value should be v.": "The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",
|
|
21
|
+
"403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.": "403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",
|
|
22
|
+
"Media Error": "Media Error",
|
|
23
|
+
"Source Not Supported": "Source Not Supported",
|
|
24
|
+
"Error": "Error",
|
|
25
|
+
"Your device appears to be offline": "Your device appears to be offline",
|
|
26
|
+
"Check your internet connection and try reloading this video.": "Check your internet connection and try reloading this video.",
|
|
27
|
+
"The provided thumbnail-token should have audience value 't' instead of '{aud}'.": "The provided thumbnail-token should have audience value 't' instead of '{aud}'.",
|
|
28
|
+
"The provided storyboard-token should have audience value 's' instead of '{aud}'.": "The provided storyboard-token should have audience value 's' instead of '{aud}'.",
|
|
29
|
+
"No stream-type value supplied. Defaulting to \\": "No stream-type value supplied. Defaulting to \\",
|
|
30
|
+
"Invalid stream-type value supplied: \\": "Invalid stream-type value supplied: \\",
|
|
31
|
+
"Read more: ": "Read more: "
|
|
32
|
+
}
|
package/lang/nl.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"(opens in a new window)": "(opent in een nieuw venster)",
|
|
3
|
+
"Network Error": "Network Error",
|
|
4
|
+
"Video is not currently available": "Video is not currently available",
|
|
5
|
+
"The live stream or video file are not yet ready.": "The live stream or video file are not yet ready.",
|
|
6
|
+
"This playback-id may belong to a live stream that is not currently active or an asset that is not ready.": "This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",
|
|
7
|
+
"Video does not exist": "Video does not exist",
|
|
8
|
+
"This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.": "This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",
|
|
9
|
+
"Invalid playback URL": "Invalid playback URL",
|
|
10
|
+
"The video URL or playback-token are formatted with incorrect or incomplete information.": "The video URL or playback-token are formatted with incorrect or incomplete information.",
|
|
11
|
+
"403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.": "403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",
|
|
12
|
+
"Video URL has expired": "Video URL has expired",
|
|
13
|
+
"The video’s secured playback-token has expired.": "The video’s secured playback-token has expired.",
|
|
14
|
+
"This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.": "This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",
|
|
15
|
+
"Video URL is formatted incorrectly": "Video URL is formatted incorrectly",
|
|
16
|
+
"The video’s playback ID does not match the one encoded in the playback-token.": "The video’s playback ID does not match the one encoded in the playback-token.",
|
|
17
|
+
"The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.": "The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",
|
|
18
|
+
"The playback-token is formatted with incorrect information.": "The playback-token is formatted with incorrect information.",
|
|
19
|
+
"The playback-token has an incorrect aud value: {tokenType}. aud value should be v.": "The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",
|
|
20
|
+
"403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.": "403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",
|
|
21
|
+
"Media Error": "Media Error",
|
|
22
|
+
"Source Not Supported": "Source Not Supported",
|
|
23
|
+
"Error": "Error",
|
|
24
|
+
"Your device appears to be offline": "Your device appears to be offline",
|
|
25
|
+
"Check your internet connection and try reloading this video.": "Check your internet connection and try reloading this video.",
|
|
26
|
+
"The provided thumbnail-token should have audience value 't' instead of '{aud}'.": "The provided thumbnail-token should have audience value 't' instead of '{aud}'.",
|
|
27
|
+
"The provided storyboard-token should have audience value 's' instead of '{aud}'.": "The provided storyboard-token should have audience value 's' instead of '{aud}'.",
|
|
28
|
+
"No stream-type value supplied. Defaulting to \\": "No stream-type value supplied. Defaulting to \\",
|
|
29
|
+
"Invalid stream-type value supplied: \\": "Invalid stream-type value supplied: \\",
|
|
30
|
+
"Read more: ": "Read more: "
|
|
31
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mux/mux-player",
|
|
3
|
+
"version": "0.1.0-beta.21",
|
|
4
|
+
"description": "An open source Mux player web component that Just Works™",
|
|
5
|
+
"main": "./dist/index.cjs.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"browser": "./dist/index.mjs",
|
|
8
|
+
"unpkg": "./dist/mux-player.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.cjs.js",
|
|
12
|
+
"default": "./dist/index.cjs.js"
|
|
13
|
+
},
|
|
14
|
+
"types": "dist/types-ts3.4/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.3.5": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types/index.d.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/muxinc/elements",
|
|
25
|
+
"directory": "packages/mux-player"
|
|
26
|
+
},
|
|
27
|
+
"author": "Mux, Inc.",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"scripts": {
|
|
30
|
+
"clean": "shx rm -rf dist/",
|
|
31
|
+
"lint": "eslint src/ --ext .js,.jsx,.ts,.tsx",
|
|
32
|
+
"test": "web-test-runner **/*test.js --port 8001 --coverage --config test/web-test-runner.config.mjs --root-dir ../..",
|
|
33
|
+
"posttest": "replace 'SF:src/' 'SF:packages/mux-player/src/' coverage/lcov.info --silent",
|
|
34
|
+
"i18n": "yarn build:esm --keep-names && i18n-utils dist/index.mjs ./lang",
|
|
35
|
+
"dev:iife": "open-process | yarn build:iife --watch",
|
|
36
|
+
"dev:esm": "open-process | yarn build:esm --watch",
|
|
37
|
+
"dev:esm-module": "open-process | yarn build:esm-module --watch",
|
|
38
|
+
"dev:cjs": "open-process | yarn build:cjs --watch",
|
|
39
|
+
"dev:types": "yarn build:types -w",
|
|
40
|
+
"dev": "npm-run-all --parallel dev:types dev:esm dev:cjs dev:esm-module dev:iife",
|
|
41
|
+
"build:esm": "esbuilder src/index.ts --format=esm --out-extension:.js=.mjs",
|
|
42
|
+
"build:esm-module": "esbuilder src/index.ts --format=esm-module --out-extension:.js=.mjs",
|
|
43
|
+
"build:iife": "esbuilder src/index.ts --format=iife --out-extension:.js=.js",
|
|
44
|
+
"build:cjs": "esbuilder src/index.ts --format=cjs --out-extension:.js=.cjs.js",
|
|
45
|
+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir './dist/types' && downlevel-dts ./dist/types ./dist/types-ts3.4",
|
|
46
|
+
"build": "npm-run-all --parallel build:types 'build:esm -- --minify' 'build:iife -- --minify' 'build:cjs -- --minify' 'build:esm-module -- --minify'",
|
|
47
|
+
"prebuild": "yarn clean",
|
|
48
|
+
"prepublishOnly": "yarn build",
|
|
49
|
+
"create-release-notes": "create-release-notes ./CHANGELOG.md",
|
|
50
|
+
"publish-release": "../../scripts/publish.sh"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@github/template-parts": "^0.5.3",
|
|
54
|
+
"@mux/mux-video": "0.8.0",
|
|
55
|
+
"@mux/playback-core": "0.8.0",
|
|
56
|
+
"media-chrome": "0.6.9"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@mux/open-process": "0.1.0",
|
|
60
|
+
"@mux/test-esm-exports": "0.1.0",
|
|
61
|
+
"@open-wc/testing": "^3.0.3",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
|
63
|
+
"@typescript-eslint/parser": "^5.14.0",
|
|
64
|
+
"@web/dev-server-esbuild": "^0.2.16",
|
|
65
|
+
"@web/dev-server-import-maps": "^0.0.6",
|
|
66
|
+
"@web/test-runner": "^0.13.26",
|
|
67
|
+
"downlevel-dts": "^0.9.0",
|
|
68
|
+
"esbuild": "^0.13.13",
|
|
69
|
+
"eslint": "^7.11.0",
|
|
70
|
+
"npm-run-all": "^4.1.5",
|
|
71
|
+
"replace": "^1.2.1",
|
|
72
|
+
"shx": "^0.3.4",
|
|
73
|
+
"typescript": "^4.5.2"
|
|
74
|
+
},
|
|
75
|
+
"eslintConfig": {
|
|
76
|
+
"env": {
|
|
77
|
+
"browser": true,
|
|
78
|
+
"es6": true,
|
|
79
|
+
"node": true,
|
|
80
|
+
"mocha": true
|
|
81
|
+
},
|
|
82
|
+
"parser": "@typescript-eslint/parser",
|
|
83
|
+
"plugins": [
|
|
84
|
+
"@typescript-eslint",
|
|
85
|
+
"@mux/i18n"
|
|
86
|
+
],
|
|
87
|
+
"extends": [
|
|
88
|
+
"eslint:recommended",
|
|
89
|
+
"plugin:@typescript-eslint/recommended"
|
|
90
|
+
],
|
|
91
|
+
"parserOptions": {
|
|
92
|
+
"ecmaVersion": 2021,
|
|
93
|
+
"sourceType": "module"
|
|
94
|
+
},
|
|
95
|
+
"globals": {
|
|
96
|
+
"globalThis": false
|
|
97
|
+
},
|
|
98
|
+
"rules": {
|
|
99
|
+
"no-shadow": "error",
|
|
100
|
+
"no-extra-boolean-cast": 0,
|
|
101
|
+
"@mux/i18n/no-substitutions": "error",
|
|
102
|
+
"@typescript-eslint/ban-ts-comment": 0,
|
|
103
|
+
"@typescript-eslint/no-explicit-any": 0
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"gitHead": "1eb2c585afc831907ef8246be31d1010adc1575c"
|
|
107
|
+
}
|
package/src/dialog.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import MediaDialog from './media-chrome/dialog';
|
|
2
|
+
|
|
3
|
+
const template = document.createElement('template');
|
|
4
|
+
template.innerHTML = `
|
|
5
|
+
<style>
|
|
6
|
+
${MediaDialog.styles}
|
|
7
|
+
|
|
8
|
+
.close {
|
|
9
|
+
background: none;
|
|
10
|
+
color: inherit;
|
|
11
|
+
border: none;
|
|
12
|
+
padding: 0;
|
|
13
|
+
font: inherit;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
outline: inherit;
|
|
16
|
+
width: 28px;
|
|
17
|
+
height: 28px;
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 1rem;
|
|
20
|
+
right: 1rem;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
|
|
24
|
+
<div class="dialog">
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<slot name="close">
|
|
29
|
+
<button class="close" tabindex="0">
|
|
30
|
+
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
31
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
32
|
+
</svg>
|
|
33
|
+
</button>
|
|
34
|
+
</slot>
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
class MxpDialog extends MediaDialog {
|
|
38
|
+
static template: HTMLTemplateElement = template;
|
|
39
|
+
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
|
|
43
|
+
this.shadowRoot?.querySelector('.close')?.addEventListener('click', () => {
|
|
44
|
+
this.close();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!globalThis.customElements.get('mxp-dialog')) {
|
|
50
|
+
globalThis.customElements.define('mxp-dialog', MxpDialog);
|
|
51
|
+
(globalThis as any).MxpDialog = MxpDialog;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default MxpDialog;
|