@mattebox/player-diagnostics 0.1.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.
- package/LICENSE +21 -0
- package/NOTICE +24 -0
- package/README.md +45 -0
- package/dist/cdn/mattebox-player-diagnostics.min.js +124 -0
- package/dist/charts.d.ts +35 -0
- package/dist/charts.d.ts.map +1 -0
- package/dist/charts.js +401 -0
- package/dist/charts.js.map +1 -0
- package/dist/element.d.ts +62 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/element.js +677 -0
- package/dist/element.js.map +1 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/asyncToGenerator.js +27 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/defineProperty.js +12 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/objectSpread2.js +25 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/typeof.js +11 -0
- package/dist/es2015/charts.js +380 -0
- package/dist/es2015/element.js +651 -0
- package/dist/es2015/format.js +38 -0
- package/dist/es2015/host.js +34 -0
- package/dist/es2015/icon.js +46 -0
- package/dist/es2015/index.js +15 -0
- package/dist/es2015/report.js +145 -0
- package/dist/es2015/sampler.js +196 -0
- package/dist/es2015/style.js +135 -0
- package/dist/es2015/support.js +351 -0
- package/dist/es2015/trace.js +99 -0
- package/dist/format.d.ts +20 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +45 -0
- package/dist/format.js.map +1 -0
- package/dist/host.d.ts +19 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +38 -0
- package/dist/host.js.map +1 -0
- package/dist/icon.d.ts +31 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/icon.js +44 -0
- package/dist/icon.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/report.d.ts +140 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +125 -0
- package/dist/report.js.map +1 -0
- package/dist/sampler.d.ts +68 -0
- package/dist/sampler.d.ts.map +1 -0
- package/dist/sampler.js +208 -0
- package/dist/sampler.js.map +1 -0
- package/dist/style.d.ts +10 -0
- package/dist/style.d.ts.map +1 -0
- package/dist/style.js +133 -0
- package/dist/style.js.map +1 -0
- package/dist/support.d.ts +46 -0
- package/dist/support.d.ts.map +1 -0
- package/dist/support.js +247 -0
- package/dist/support.js.map +1 -0
- package/dist/trace.d.ts +14 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/trace.js +100 -0
- package/dist/trace.js.map +1 -0
- package/package.json +59 -0
package/dist/style.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The element's stylesheet. The button is drawn the way the player's own
|
|
3
|
+
* buttons are, in a copy: the player's styles are internal, and a control
|
|
4
|
+
* of the page's own carries its own sheet. Tokens come through the
|
|
5
|
+
* `--mbx-*` custom properties the player sets, which inherit through light
|
|
6
|
+
* DOM; the chart colours have defaults here and a page overrides them the
|
|
7
|
+
* same way. Nothing carries `!important`, so a page's `::part()` rule wins.
|
|
8
|
+
*/
|
|
9
|
+
export const STYLE = `
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
position: relative;
|
|
13
|
+
--mbx-chart-1: #5aa9e0;
|
|
14
|
+
--mbx-chart-2: #6fbf8f;
|
|
15
|
+
--mbx-chart-3: #d9a83f;
|
|
16
|
+
--mbx-chart-4: #e05a6e;
|
|
17
|
+
--mbx-chart-5: #a98fe0;
|
|
18
|
+
}
|
|
19
|
+
:host([hidden]) { display: none; }
|
|
20
|
+
:host([inline]) { display: block; }
|
|
21
|
+
[part~="button"] {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
flex: none;
|
|
26
|
+
width: 40px;
|
|
27
|
+
height: 40px;
|
|
28
|
+
padding: 0;
|
|
29
|
+
font: inherit;
|
|
30
|
+
color: inherit;
|
|
31
|
+
background: transparent;
|
|
32
|
+
border: 0;
|
|
33
|
+
border-radius: var(--mbx-radius);
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
opacity: 0.9;
|
|
36
|
+
}
|
|
37
|
+
[part~="button"]:hover { opacity: 1; }
|
|
38
|
+
[part~="button"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
39
|
+
[part~="icon"], ::slotted(*) { width: 1.75em; height: 1.75em; fill: currentColor; }
|
|
40
|
+
:host([inline]) [part~="button"] { display: none; }
|
|
41
|
+
[part~="panel"] {
|
|
42
|
+
position: absolute;
|
|
43
|
+
right: 0;
|
|
44
|
+
bottom: 100%;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
width: 560px;
|
|
47
|
+
margin-bottom: 8px;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
color: var(--mbx-text, #f2f3f5);
|
|
52
|
+
background: rgba(16, 17, 20, 0.95);
|
|
53
|
+
border-radius: var(--mbx-radius, 4px);
|
|
54
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
|
|
55
|
+
font: 400 12px/1.5 var(--mbx-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
56
|
+
text-align: left;
|
|
57
|
+
white-space: normal;
|
|
58
|
+
}
|
|
59
|
+
[part~="panel"][hidden] { display: none; }
|
|
60
|
+
:host([inline]) [part~="panel"] {
|
|
61
|
+
position: static;
|
|
62
|
+
width: auto;
|
|
63
|
+
max-height: none;
|
|
64
|
+
margin: 0;
|
|
65
|
+
box-shadow: none;
|
|
66
|
+
border-radius: 0;
|
|
67
|
+
}
|
|
68
|
+
[part~="head"] {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 4px;
|
|
72
|
+
padding: 6px 8px;
|
|
73
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
|
74
|
+
}
|
|
75
|
+
[part~="tab"], [part~="chart-tab"] {
|
|
76
|
+
font: inherit;
|
|
77
|
+
color: var(--mbx-muted, #9aa0a6);
|
|
78
|
+
background: transparent;
|
|
79
|
+
border: 0;
|
|
80
|
+
border-radius: var(--mbx-radius, 4px);
|
|
81
|
+
padding: 3px 8px;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
}
|
|
84
|
+
[part~="tab"][aria-selected="true"], [part~="chart-tab"][aria-selected="true"] {
|
|
85
|
+
color: var(--mbx-text, #f2f3f5);
|
|
86
|
+
background: rgba(255, 255, 255, 0.12);
|
|
87
|
+
}
|
|
88
|
+
[part~="copy"], [part~="close"], [part~="window"] {
|
|
89
|
+
font: inherit;
|
|
90
|
+
color: inherit;
|
|
91
|
+
background: transparent;
|
|
92
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
93
|
+
border-radius: var(--mbx-radius, 4px);
|
|
94
|
+
padding: 2px 8px;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
}
|
|
97
|
+
[part~="copy"] { margin-left: auto; }
|
|
98
|
+
[part~="window"] { margin-left: auto; }
|
|
99
|
+
[part~="window"] option { color: #000; }
|
|
100
|
+
[part~="tab"]:focus-visible, [part~="chart-tab"]:focus-visible, [part~="copy"]:focus-visible,
|
|
101
|
+
[part~="close"]:focus-visible, [part~="window"]:focus-visible {
|
|
102
|
+
outline: 2px solid var(--mbx-accent, #5b8cff);
|
|
103
|
+
outline-offset: -2px;
|
|
104
|
+
}
|
|
105
|
+
[part~="body"] { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px; }
|
|
106
|
+
[part~="page"][hidden] { display: none; }
|
|
107
|
+
[part~="rows"] { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
|
|
108
|
+
[part~="key"] { color: var(--mbx-muted, #9aa0a6); white-space: nowrap; }
|
|
109
|
+
[part~="value"] { margin: 0; overflow-wrap: anywhere; }
|
|
110
|
+
[part~="heading"] {
|
|
111
|
+
margin: 10px 0 4px;
|
|
112
|
+
font-size: 11px;
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
letter-spacing: 0.06em;
|
|
115
|
+
text-transform: uppercase;
|
|
116
|
+
color: var(--mbx-muted, #9aa0a6);
|
|
117
|
+
}
|
|
118
|
+
[part~="heading"]:first-child { margin-top: 0; }
|
|
119
|
+
[part~="note"] { margin: 0; color: var(--mbx-muted, #9aa0a6); }
|
|
120
|
+
[part~="chart-tabs"] { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }
|
|
121
|
+
[part~="chart"] { display: block; width: 100%; height: 160px; }
|
|
122
|
+
[part~="legend"] { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--mbx-muted, #9aa0a6); }
|
|
123
|
+
[part~="swatch"] { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: middle; }
|
|
124
|
+
[part~="readout"] { margin-top: 4px; }
|
|
125
|
+
[part~="table"] { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
|
|
126
|
+
[part~="cell"] { padding: 2px 6px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; font-weight: 400; }
|
|
127
|
+
[part~="label"] { color: var(--mbx-muted, #9aa0a6); }
|
|
128
|
+
[part~="ok"] { color: var(--mbx-chart-2); }
|
|
129
|
+
[part~="bad"] { color: var(--mbx-chart-4); }
|
|
130
|
+
[part~="na"] { color: var(--mbx-muted, #9aa0a6); }
|
|
131
|
+
[part~="ok"], [part~="bad"], [part~="na"], [part~="maybe"] { font-weight: 600; }
|
|
132
|
+
`;
|
|
133
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2HpB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What this browser can do, probed the way the engine's playground probes
|
|
3
|
+
* it: the platform APIs, the codecs through MSE, the element and Media
|
|
4
|
+
* Capabilities, and the DRM key systems with their security levels,
|
|
5
|
+
* schemes, persistence, identifiers and output protection. Every probe is
|
|
6
|
+
* bounded by a timeout, and the whole run is cached for the page: it does
|
|
7
|
+
* not change while the page lives, and the key-system probes are not free.
|
|
8
|
+
* Nothing here touches the engine.
|
|
9
|
+
*/
|
|
10
|
+
/** A probe's answer: yes, no, not applicable, maybe, or a text of its own. */
|
|
11
|
+
export type Cell = 'yes' | 'no' | 'na' | 'maybe' | (string & {});
|
|
12
|
+
export interface PlatformRow {
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly value: Cell;
|
|
15
|
+
}
|
|
16
|
+
export interface CodecRow {
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly codec: string;
|
|
19
|
+
readonly kind: 'video' | 'audio';
|
|
20
|
+
/** Through MSE, in fMP4 and in WebM. */
|
|
21
|
+
readonly mse: Cell;
|
|
22
|
+
readonly webm: Cell;
|
|
23
|
+
/** The video element's own `canPlayType`. */
|
|
24
|
+
readonly element: Cell;
|
|
25
|
+
/** Media Capabilities: smooth and power-efficient at 1080p30, or stereo 128 kbps. */
|
|
26
|
+
readonly smooth: Cell;
|
|
27
|
+
readonly efficient: Cell;
|
|
28
|
+
}
|
|
29
|
+
export interface DrmRow {
|
|
30
|
+
readonly label: string;
|
|
31
|
+
readonly keySystem: string | null;
|
|
32
|
+
readonly level: Cell;
|
|
33
|
+
readonly schemes: Cell;
|
|
34
|
+
readonly persistent: Cell;
|
|
35
|
+
readonly identifier: Cell;
|
|
36
|
+
readonly hdcp: Cell;
|
|
37
|
+
}
|
|
38
|
+
export interface Support {
|
|
39
|
+
readonly userAgent: string;
|
|
40
|
+
readonly platform: readonly PlatformRow[];
|
|
41
|
+
readonly codecs: readonly CodecRow[];
|
|
42
|
+
readonly drm: readonly DrmRow[];
|
|
43
|
+
}
|
|
44
|
+
/** Probes the browser once per page and answers from the cache after. */
|
|
45
|
+
export declare function probeSupport(): Promise<Support>;
|
|
46
|
+
//# sourceMappingURL=support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../src/support.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACjC,wCAAwC;IACxC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AA+RD,yEAAyE;AACzE,wBAAgB,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAU/C"}
|
package/dist/support.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What this browser can do, probed the way the engine's playground probes
|
|
3
|
+
* it: the platform APIs, the codecs through MSE, the element and Media
|
|
4
|
+
* Capabilities, and the DRM key systems with their security levels,
|
|
5
|
+
* schemes, persistence, identifiers and output protection. Every probe is
|
|
6
|
+
* bounded by a timeout, and the whole run is cached for the page: it does
|
|
7
|
+
* not change while the page lives, and the key-system probes are not free.
|
|
8
|
+
* Nothing here touches the engine.
|
|
9
|
+
*/
|
|
10
|
+
const CODECS = [
|
|
11
|
+
{ label: 'H.264 High 4.0', codec: 'avc1.640028', kind: 'video', containers: ['mp4'] },
|
|
12
|
+
{ label: 'H.264 Baseline', codec: 'avc1.42e01e', kind: 'video', containers: ['mp4'] },
|
|
13
|
+
{ label: 'H.265 / HEVC Main', codec: 'hvc1.1.6.L123.B0', kind: 'video', containers: ['mp4'] },
|
|
14
|
+
{ label: 'VP9 Profile 0', codec: 'vp09.00.40.08', kind: 'video', containers: ['mp4', 'webm'] },
|
|
15
|
+
{ label: 'AV1 Main', codec: 'av01.0.08M.08', kind: 'video', containers: ['mp4', 'webm'] },
|
|
16
|
+
{ label: 'AAC-LC', codec: 'mp4a.40.2', kind: 'audio', containers: ['mp4'] },
|
|
17
|
+
{ label: 'HE-AAC', codec: 'mp4a.40.5', kind: 'audio', containers: ['mp4'] },
|
|
18
|
+
{ label: 'Opus', codec: 'opus', kind: 'audio', containers: ['mp4', 'webm'] },
|
|
19
|
+
{ label: 'FLAC', codec: 'flac', kind: 'audio', containers: ['mp4'] },
|
|
20
|
+
{ label: 'AC-3', codec: 'ac-3', kind: 'audio', containers: ['mp4'] },
|
|
21
|
+
{ label: 'E-AC-3', codec: 'ec-3', kind: 'audio', containers: ['mp4'] },
|
|
22
|
+
];
|
|
23
|
+
const KEY_SYSTEMS = [
|
|
24
|
+
{
|
|
25
|
+
label: 'Widevine',
|
|
26
|
+
keySystems: ['com.widevine.alpha'],
|
|
27
|
+
levels: [
|
|
28
|
+
['HW_SECURE_ALL', 'L1'],
|
|
29
|
+
['HW_SECURE_DECODE', 'L1'],
|
|
30
|
+
['HW_SECURE_CRYPTO', 'L2'],
|
|
31
|
+
['SW_SECURE_DECODE', 'L3'],
|
|
32
|
+
['SW_SECURE_CRYPTO', 'L3'],
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'PlayReady',
|
|
37
|
+
keySystems: ['com.microsoft.playready.recommendation', 'com.microsoft.playready'],
|
|
38
|
+
levels: [
|
|
39
|
+
['3000', 'SL3000'],
|
|
40
|
+
['2000', 'SL2000'],
|
|
41
|
+
['150', 'SL150'],
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{ label: 'FairPlay', keySystems: ['com.apple.fps', 'com.apple.fps.1_0'], levels: [] },
|
|
45
|
+
{ label: 'ClearKey', keySystems: ['org.w3.clearkey'], levels: [] },
|
|
46
|
+
];
|
|
47
|
+
const HDCP_VERSIONS = ['1.0', '1.1', '1.2', '1.3', '1.4', '2.0', '2.1', '2.2', '2.3'];
|
|
48
|
+
const VIDEO_TYPE = 'video/mp4; codecs="avc1.42e01e"';
|
|
49
|
+
const VIDEO_TYPE_ALT = 'video/mp4; codecs="vp09.00.10.08"';
|
|
50
|
+
const AUDIO_TYPE = 'audio/mp4; codecs="mp4a.40.2"';
|
|
51
|
+
const AUDIO_TYPE_ALT = 'audio/mp4; codecs="opus"';
|
|
52
|
+
/** A probe that never answers is a no: some CDMs hang instead of rejecting. */
|
|
53
|
+
function withTimeout(promise, fallback, ms = 4000) {
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
const timer = setTimeout(() => resolve(fallback), ms);
|
|
56
|
+
promise.then((value) => {
|
|
57
|
+
clearTimeout(timer);
|
|
58
|
+
resolve(value);
|
|
59
|
+
}, () => {
|
|
60
|
+
clearTimeout(timer);
|
|
61
|
+
resolve(fallback);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function has(name) {
|
|
66
|
+
return name in globalThis ? 'yes' : 'no';
|
|
67
|
+
}
|
|
68
|
+
function platform() {
|
|
69
|
+
let changeType = 'no';
|
|
70
|
+
try {
|
|
71
|
+
if (typeof MediaSource !== 'undefined' && 'changeType' in SourceBuffer.prototype) {
|
|
72
|
+
changeType = 'yes';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
changeType = 'no';
|
|
77
|
+
}
|
|
78
|
+
return [
|
|
79
|
+
{ label: 'Secure context', value: window.isSecureContext ? 'yes' : 'no' },
|
|
80
|
+
{ label: 'MediaSource', value: has('MediaSource') },
|
|
81
|
+
{ label: 'ManagedMediaSource', value: has('ManagedMediaSource') },
|
|
82
|
+
{ label: 'SourceBuffer.changeType', value: changeType },
|
|
83
|
+
{ label: 'Encrypted Media (EME)', value: has('MediaKeys') },
|
|
84
|
+
{
|
|
85
|
+
label: 'MediaCapabilities',
|
|
86
|
+
value: navigator.mediaCapabilities !== undefined ? 'yes' : 'no',
|
|
87
|
+
},
|
|
88
|
+
{ label: 'WebCodecs', value: has('VideoDecoder') },
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
function mseSupports(type) {
|
|
92
|
+
try {
|
|
93
|
+
return typeof MediaSource !== 'undefined' && MediaSource.isTypeSupported(type);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function elementSupports(type) {
|
|
100
|
+
const answer = document.createElement('video').canPlayType(type);
|
|
101
|
+
return answer === 'probably' ? 'yes' : answer === 'maybe' ? 'maybe' : 'no';
|
|
102
|
+
}
|
|
103
|
+
async function decodingInfo(probe) {
|
|
104
|
+
const capabilities = navigator.mediaCapabilities;
|
|
105
|
+
if (capabilities?.decodingInfo === undefined)
|
|
106
|
+
return { smooth: 'na', efficient: 'na' };
|
|
107
|
+
const contentType = `${probe.kind}/${probe.containers[0]}; codecs="${probe.codec}"`;
|
|
108
|
+
const config = probe.kind === 'video'
|
|
109
|
+
? {
|
|
110
|
+
type: 'media-source',
|
|
111
|
+
video: { contentType, width: 1920, height: 1080, bitrate: 6_000_000, framerate: 30 },
|
|
112
|
+
}
|
|
113
|
+
: { type: 'media-source', audio: { contentType, channels: '2', bitrate: 128_000 } };
|
|
114
|
+
const info = await withTimeout(capabilities.decodingInfo(config), null);
|
|
115
|
+
if (info === null)
|
|
116
|
+
return { smooth: 'na', efficient: 'na' };
|
|
117
|
+
if (!info.supported)
|
|
118
|
+
return { smooth: 'no', efficient: 'no' };
|
|
119
|
+
return { smooth: info.smooth ? 'yes' : 'no', efficient: info.powerEfficient ? 'yes' : 'no' };
|
|
120
|
+
}
|
|
121
|
+
async function codec(probe) {
|
|
122
|
+
const cell = (container) => probe.containers.includes(container)
|
|
123
|
+
? mseSupports(`${probe.kind}/${container}; codecs="${probe.codec}"`)
|
|
124
|
+
? 'yes'
|
|
125
|
+
: 'no'
|
|
126
|
+
: 'na';
|
|
127
|
+
const { smooth, efficient } = await decodingInfo(probe);
|
|
128
|
+
return {
|
|
129
|
+
label: probe.label,
|
|
130
|
+
codec: probe.codec,
|
|
131
|
+
kind: probe.kind,
|
|
132
|
+
mse: cell('mp4'),
|
|
133
|
+
webm: cell('webm'),
|
|
134
|
+
element: elementSupports(`${probe.kind}/${probe.containers[0]}; codecs="${probe.codec}"`),
|
|
135
|
+
smooth,
|
|
136
|
+
efficient,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function videoAlternates(extra = {}) {
|
|
140
|
+
return [
|
|
141
|
+
{ contentType: VIDEO_TYPE, ...extra },
|
|
142
|
+
{ contentType: VIDEO_TYPE_ALT, ...extra },
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
function baseConfig(extra = {}) {
|
|
146
|
+
return {
|
|
147
|
+
initDataTypes: ['cenc', 'keyids', 'sinf', 'skd'],
|
|
148
|
+
videoCapabilities: videoAlternates(),
|
|
149
|
+
audioCapabilities: [{ contentType: AUDIO_TYPE }, { contentType: AUDIO_TYPE_ALT }],
|
|
150
|
+
...extra,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function requestAccess(keySystem, config) {
|
|
154
|
+
if (typeof navigator.requestMediaKeySystemAccess !== 'function')
|
|
155
|
+
return Promise.resolve(null);
|
|
156
|
+
return withTimeout(navigator.requestMediaKeySystemAccess(keySystem, [config]).then((access) => access, () => null), null);
|
|
157
|
+
}
|
|
158
|
+
const NONE = (label) => ({
|
|
159
|
+
label,
|
|
160
|
+
keySystem: null,
|
|
161
|
+
level: 'na',
|
|
162
|
+
schemes: 'na',
|
|
163
|
+
persistent: 'na',
|
|
164
|
+
identifier: 'na',
|
|
165
|
+
hdcp: 'na',
|
|
166
|
+
});
|
|
167
|
+
async function keySystem(probe) {
|
|
168
|
+
let system = null;
|
|
169
|
+
let access = null;
|
|
170
|
+
for (const candidate of probe.keySystems) {
|
|
171
|
+
access = await requestAccess(candidate, baseConfig());
|
|
172
|
+
if (access !== null) {
|
|
173
|
+
system = candidate;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (system === null || access === null)
|
|
178
|
+
return NONE(probe.label);
|
|
179
|
+
let level = probe.levels.length === 0 ? 'n/a for this system' : 'none granted';
|
|
180
|
+
for (const [robustness, name] of probe.levels) {
|
|
181
|
+
const granted = await requestAccess(system, baseConfig({ videoCapabilities: videoAlternates({ robustness }) }));
|
|
182
|
+
if (granted !== null) {
|
|
183
|
+
level = `${name} (${robustness})`;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Only a scheme the browser echoes back counts: an old EME grants any.
|
|
188
|
+
const echoed = [];
|
|
189
|
+
let schemeApi = false;
|
|
190
|
+
for (const scheme of ['cenc', 'cbcs']) {
|
|
191
|
+
const granted = await requestAccess(system, baseConfig({ videoCapabilities: videoAlternates({ encryptionScheme: scheme }) }));
|
|
192
|
+
const answer = granted
|
|
193
|
+
?.getConfiguration()
|
|
194
|
+
.videoCapabilities?.find((c) => c.contentType !== '')?.encryptionScheme;
|
|
195
|
+
if (answer !== undefined && answer !== null)
|
|
196
|
+
schemeApi = true;
|
|
197
|
+
if (answer === scheme)
|
|
198
|
+
echoed.push(scheme);
|
|
199
|
+
}
|
|
200
|
+
const schemes = !schemeApi
|
|
201
|
+
? 'unknown (no API)'
|
|
202
|
+
: echoed.length === 0
|
|
203
|
+
? 'none'
|
|
204
|
+
: echoed.join(', ');
|
|
205
|
+
const persistent = await requestAccess(system, baseConfig({ persistentState: 'required', sessionTypes: ['persistent-license'] }));
|
|
206
|
+
const identifier = await requestAccess(system, baseConfig({ distinctiveIdentifier: 'required' }));
|
|
207
|
+
let hdcp = 'na';
|
|
208
|
+
try {
|
|
209
|
+
const keys = (await withTimeout(access.createMediaKeys(), null));
|
|
210
|
+
if (keys !== null && typeof keys.getStatusForPolicy === 'function') {
|
|
211
|
+
let best = null;
|
|
212
|
+
for (const version of HDCP_VERSIONS) {
|
|
213
|
+
const status = await withTimeout(keys.getStatusForPolicy({ minHdcpVersion: version }), 'unknown');
|
|
214
|
+
if (status !== 'usable')
|
|
215
|
+
break;
|
|
216
|
+
best = version;
|
|
217
|
+
}
|
|
218
|
+
hdcp = best === null ? 'no output protection' : `up to ${best}`;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
hdcp = 'na';
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
label: probe.label,
|
|
226
|
+
keySystem: system,
|
|
227
|
+
level,
|
|
228
|
+
schemes,
|
|
229
|
+
persistent: persistent !== null ? 'yes' : 'no',
|
|
230
|
+
identifier: identifier !== null ? 'yes' : 'no',
|
|
231
|
+
hdcp,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
let cached = null;
|
|
235
|
+
/** Probes the browser once per page and answers from the cache after. */
|
|
236
|
+
export function probeSupport() {
|
|
237
|
+
if (cached === null) {
|
|
238
|
+
cached = (async () => ({
|
|
239
|
+
userAgent: navigator.userAgent,
|
|
240
|
+
platform: platform(),
|
|
241
|
+
codecs: await Promise.all(CODECS.map(codec)),
|
|
242
|
+
drm: await Promise.all(KEY_SYSTEMS.map(keySystem)),
|
|
243
|
+
}))();
|
|
244
|
+
}
|
|
245
|
+
return cached;
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../src/support.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgDH,MAAM,MAAM,GAA0B;IACpC,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE;IACrF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d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A trace entry as the element keeps it: slimmed the way the engine's
|
|
3
|
+
* playground slims one before it goes anywhere, and made plain. A manifest
|
|
4
|
+
* is a summary of its tracks and renditions with segment counts, a
|
|
5
|
+
* playlist refresh a count, the bytes of a segment their length, a
|
|
6
|
+
* scheduled message the same again, and a `tracks:changed` emit its name.
|
|
7
|
+
* A raw entry references the whole presentation, so five hundred of them
|
|
8
|
+
* serialize to megabytes on HLS; slimmed, a history is a few hundred
|
|
9
|
+
* kilobytes at most, and holds nothing the engine does not hold anyway.
|
|
10
|
+
*/
|
|
11
|
+
import type { TraceEntry } from 'mattebox';
|
|
12
|
+
/** One entry, slimmed and plain. */
|
|
13
|
+
export declare function slimEntry(entry: TraceEntry): unknown;
|
|
14
|
+
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAiC,UAAU,EAAE,MAAM,UAAU,CAAC;AAyF1E,oCAAoC;AACpC,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAQpD"}
|
package/dist/trace.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** Segments as a count, whatever their addressing. */
|
|
2
|
+
function segmentCount(segments) {
|
|
3
|
+
if (Array.isArray(segments))
|
|
4
|
+
return segments.length;
|
|
5
|
+
if (typeof segments === 'object' && segments !== null && 'kind' in segments) {
|
|
6
|
+
return String(segments.kind);
|
|
7
|
+
}
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
/** A presentation as its shape: the periods, the tracks, the renditions, and how many segments each has. */
|
|
11
|
+
function slimPresentation(presentation) {
|
|
12
|
+
return {
|
|
13
|
+
id: presentation.id,
|
|
14
|
+
isLive: presentation.isLive,
|
|
15
|
+
duration: presentation.duration ?? null,
|
|
16
|
+
live: presentation.live ?? null,
|
|
17
|
+
periods: presentation.periods.map((period) => ({
|
|
18
|
+
id: period.id,
|
|
19
|
+
start: period.start,
|
|
20
|
+
duration: period.duration ?? null,
|
|
21
|
+
tracks: period.tracks.map((track) => ({
|
|
22
|
+
id: track.id,
|
|
23
|
+
contentType: track.contentType,
|
|
24
|
+
mimeType: track.mimeType,
|
|
25
|
+
lang: track.lang ?? null,
|
|
26
|
+
role: track.role ?? null,
|
|
27
|
+
protected: track.protection !== null && track.protection.schemes.length > 0,
|
|
28
|
+
renditions: track.renditions.map((r) => ({
|
|
29
|
+
id: r.id,
|
|
30
|
+
bitrate: r.bitrate,
|
|
31
|
+
width: r.width ?? null,
|
|
32
|
+
height: r.height ?? null,
|
|
33
|
+
codecs: r.codecs,
|
|
34
|
+
segments: segmentCount(r.segments),
|
|
35
|
+
})),
|
|
36
|
+
})),
|
|
37
|
+
})),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function slimMessage(msg) {
|
|
41
|
+
switch (msg.type) {
|
|
42
|
+
case 'MANIFEST_LOADED':
|
|
43
|
+
return { type: msg.type, presentation: slimPresentation(msg.presentation) };
|
|
44
|
+
case 'PLAYLIST_REFRESHED':
|
|
45
|
+
return { ...msg, segments: segmentCount(msg.segments) };
|
|
46
|
+
case 'SEGMENT_LOADED':
|
|
47
|
+
return { ...msg, bytes: length(msg.bytes) };
|
|
48
|
+
default:
|
|
49
|
+
return msg;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** A payload's length, whether it is still bytes or already the engine's `{ $bytes }` marker. */
|
|
53
|
+
function length(value) {
|
|
54
|
+
if (value instanceof ArrayBuffer || ArrayBuffer.isView(value))
|
|
55
|
+
return value.byteLength;
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
function slimEffect(effect) {
|
|
59
|
+
if (effect.kind === 'emit' && effect.event === 'tracks:changed') {
|
|
60
|
+
return { kind: effect.kind, event: effect.event };
|
|
61
|
+
}
|
|
62
|
+
// A scheduled message is a whole message, a manifest refresh among them.
|
|
63
|
+
// biome-ignore lint/suspicious/noThenProperty: `then` is the schedule effect's field name in the engine's message taxonomy
|
|
64
|
+
if (effect.kind === 'schedule')
|
|
65
|
+
return { ...effect, then: slimMessage(effect.then) };
|
|
66
|
+
const out = {};
|
|
67
|
+
for (const [key, value] of Object.entries(effect)) {
|
|
68
|
+
out[key] = length(value);
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* JSON with the values a trace carries that JSON does not: byte buffers as
|
|
74
|
+
* their length, maps as objects, sets as arrays, functions and DOM nodes
|
|
75
|
+
* as their names.
|
|
76
|
+
*/
|
|
77
|
+
function serializable(_key, value) {
|
|
78
|
+
if (value instanceof ArrayBuffer || ArrayBuffer.isView(value))
|
|
79
|
+
return value.byteLength;
|
|
80
|
+
if (value instanceof Map)
|
|
81
|
+
return Object.fromEntries(value);
|
|
82
|
+
if (value instanceof Set)
|
|
83
|
+
return [...value];
|
|
84
|
+
if (typeof value === 'function')
|
|
85
|
+
return '[function]';
|
|
86
|
+
if (typeof Node !== 'undefined' && value instanceof Node)
|
|
87
|
+
return `[${value.nodeName}]`;
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
/** One entry, slimmed and plain. */
|
|
91
|
+
export function slimEntry(entry) {
|
|
92
|
+
const slim = {
|
|
93
|
+
t: entry.t,
|
|
94
|
+
msg: slimMessage(entry.msg),
|
|
95
|
+
effects: entry.effects.map(slimEffect),
|
|
96
|
+
digest: entry.digest,
|
|
97
|
+
};
|
|
98
|
+
return JSON.parse(JSON.stringify(slim, serializable));
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAYA,sDAAsD;AACtD,SAAS,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,CAAC;QACtC,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CAAC;IACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAY,CAAC;AACnE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mattebox/player-diagnostics",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "<mbx-diagnostics>: playback stats, charts, engine state and browser support inside <mattebox-player>, and a report to send.",
|
|
5
|
+
"author": "Josep Boix Requesens",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jboix/mattebox-player.git",
|
|
9
|
+
"directory": "packages/diagnostics"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/jboix/mattebox-player#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/jboix/mattebox-player/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mattebox",
|
|
17
|
+
"player",
|
|
18
|
+
"custom-element",
|
|
19
|
+
"diagnostics",
|
|
20
|
+
"stats",
|
|
21
|
+
"video"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": true,
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=20.19"
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/es2015/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"modern": "./dist/index.js",
|
|
35
|
+
"default": "./dist/es2015/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"NOTICE"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"clean": "rm -rf dist",
|
|
45
|
+
"build": "npm run clean && npm run build:modern && npm run build:es2015 && npm run build:cdn",
|
|
46
|
+
"build:modern": "tsc -p tsconfig.build.json",
|
|
47
|
+
"build:es2015": "rolldown -c rolldown.dist.config.mjs",
|
|
48
|
+
"build:cdn": "rolldown -c rolldown.cdn.config.mjs",
|
|
49
|
+
"check:package": "publint && attw --pack . --format table --no-emoji",
|
|
50
|
+
"release:ci": "semantic-release"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@mattebox/player-core": "^0.1.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@mattebox/player": ">=0.1.0",
|
|
57
|
+
"mattebox": "^0.3.0"
|
|
58
|
+
}
|
|
59
|
+
}
|