@moq/watch 0.2.7 → 0.2.8
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/package.json +4 -4
- package/support/index.d.ts.map +1 -1
- package/support/index.js +11 -9
- package/support/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moq/watch",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"description": "Watch Media over QUIC broadcasts",
|
|
6
6
|
"license": "(MIT OR Apache-2.0)",
|
|
7
7
|
"repository": "github:moq-dev/moq",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"./support/element.js"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@moq/hang": "^0.2.
|
|
37
|
-
"@moq/lite": "^0.2.
|
|
38
|
-
"@moq/signals": "^0.1.
|
|
36
|
+
"@moq/hang": "^0.2.3",
|
|
37
|
+
"@moq/lite": "^0.2.1",
|
|
38
|
+
"@moq/signals": "^0.1.6",
|
|
39
39
|
"@moq/ui-core": "^0.1.0"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/support/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/support/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAElD,MAAM,MAAM,KAAK,GAAG;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IACnB,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,KAAK,CAAC;IAC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AAC;CACF,CAAC;AA8CF,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CA0BjD"}
|
package/support/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const d = navigator.userAgent.toLowerCase().includes("firefox"),
|
|
1
|
+
const d = navigator.userAgent.toLowerCase().includes("firefox"), o = {
|
|
2
2
|
aac: "mp4a.40.2",
|
|
3
3
|
opus: "opus",
|
|
4
4
|
av1: "av01.0.08M.08",
|
|
@@ -7,29 +7,31 @@ const d = navigator.userAgent.toLowerCase().includes("firefox"), r = {
|
|
|
7
7
|
vp9: "vp09.00.10.08",
|
|
8
8
|
vp8: "vp8"
|
|
9
9
|
};
|
|
10
|
-
async function t(
|
|
10
|
+
async function t(a) {
|
|
11
11
|
return globalThis.AudioDecoder ? (await AudioDecoder.isConfigSupported({
|
|
12
|
-
codec:
|
|
12
|
+
codec: o[a],
|
|
13
13
|
numberOfChannels: 2,
|
|
14
14
|
sampleRate: 48e3
|
|
15
15
|
})).supported === !0 : !1;
|
|
16
16
|
}
|
|
17
|
-
async function e(
|
|
18
|
-
const
|
|
19
|
-
codec:
|
|
17
|
+
async function e(a) {
|
|
18
|
+
const r = await VideoDecoder.isConfigSupported({
|
|
19
|
+
codec: o[a],
|
|
20
20
|
hardwareAcceleration: "prefer-software"
|
|
21
21
|
}), n = await VideoDecoder.isConfigSupported({
|
|
22
|
-
codec:
|
|
22
|
+
codec: o[a],
|
|
23
23
|
hardwareAcceleration: "prefer-hardware"
|
|
24
24
|
});
|
|
25
25
|
return {
|
|
26
26
|
hardware: d || n.config?.hardwareAcceleration !== "prefer-hardware" ? void 0 : n.supported === !0,
|
|
27
|
-
software:
|
|
27
|
+
software: r.supported === !0
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async function p() {
|
|
31
31
|
return {
|
|
32
|
-
|
|
32
|
+
// Firefox's WebTransport drops server-initiated bidi streams, so we force the
|
|
33
|
+
// WebSocket fallback. Report "partial" to surface the degraded path in UI.
|
|
34
|
+
webtransport: typeof WebTransport < "u" ? d ? "partial" : "full" : "partial",
|
|
33
35
|
audio: {
|
|
34
36
|
decoding: {
|
|
35
37
|
aac: await t("aac"),
|
package/support/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/support/index.ts"],"sourcesContent":["// https://bugzilla.mozilla.org/show_bug.cgi?id=1967793\nconst isFirefox = navigator.userAgent.toLowerCase().includes(\"firefox\");\n\nexport type Partial = \"full\" | \"partial\" | \"none\";\n\nexport type Codec = {\n\thardware?: boolean; // undefined when we can't detect hardware acceleration\n\tsoftware: boolean;\n};\n\nexport type Audio = {\n\taac: boolean;\n\topus: Partial;\n};\n\nexport type Video = {\n\th264: Codec;\n\th265: Codec;\n\tvp8: Codec;\n\tvp9: Codec;\n\tav1: Codec;\n};\n\nexport type Full = {\n\twebtransport: Partial;\n\taudio: {\n\t\tdecoding: Audio;\n\t\trender: boolean;\n\t};\n\tvideo: {\n\t\tdecoding: Video | undefined;\n\t\trender: boolean;\n\t};\n};\n\n// Pick a codec string for each codec.\n// This is not strictly correct, as browsers may not support every profile or level.\nconst CODECS = {\n\taac: \"mp4a.40.2\",\n\topus: \"opus\",\n\tav1: \"av01.0.08M.08\",\n\th264: \"avc1.640028\",\n\th265: \"hev1.1.6.L93.B0\",\n\tvp9: \"vp09.00.10.08\",\n\tvp8: \"vp8\",\n};\n\nasync function audioDecoderSupported(codec: keyof typeof CODECS): Promise<boolean> {\n\tif (!globalThis.AudioDecoder) return false;\n\n\tconst res = await AudioDecoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\tnumberOfChannels: 2,\n\t\tsampleRate: 48000,\n\t});\n\n\treturn res.supported === true;\n}\n\nasync function videoDecoderSupported(codec: keyof typeof CODECS): Promise<Codec> {\n\tconst software = await VideoDecoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\thardwareAcceleration: \"prefer-software\",\n\t});\n\n\tconst hardware = await VideoDecoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\thardwareAcceleration: \"prefer-hardware\",\n\t});\n\n\t// We can't reliably detect hardware encoding on Firefox: https://github.com/w3c/webcodecs/issues/896\n\tconst unknown = isFirefox || hardware.config?.hardwareAcceleration !== \"prefer-hardware\";\n\n\treturn {\n\t\thardware: unknown ? undefined : hardware.supported === true,\n\t\tsoftware: software.supported === true,\n\t};\n}\n\nexport async function isSupported(): Promise<Full> {\n\treturn {\n\t\twebtransport: typeof WebTransport !== \"undefined\" ? \"full\" : \"partial\",\n\t\taudio: {\n\t\t\tdecoding: {\n\t\t\t\taac: await audioDecoderSupported(\"aac\"),\n\t\t\t\topus: (await audioDecoderSupported(\"opus\")) ? \"full\" : \"partial\",\n\t\t\t},\n\t\t\trender: typeof AudioContext !== \"undefined\" && typeof AudioBufferSourceNode !== \"undefined\",\n\t\t},\n\t\tvideo: {\n\t\t\tdecoding:\n\t\t\t\ttypeof VideoDecoder !== \"undefined\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\th264: await videoDecoderSupported(\"h264\"),\n\t\t\t\t\t\t\th265: await videoDecoderSupported(\"h265\"),\n\t\t\t\t\t\t\tvp8: await videoDecoderSupported(\"vp8\"),\n\t\t\t\t\t\t\tvp9: await videoDecoderSupported(\"vp9\"),\n\t\t\t\t\t\t\tav1: await videoDecoderSupported(\"av1\"),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\trender: typeof OffscreenCanvas !== \"undefined\" && typeof CanvasRenderingContext2D !== \"undefined\",\n\t\t},\n\t};\n}\n"],"names":["isFirefox","CODECS","audioDecoderSupported","codec","videoDecoderSupported","software","hardware","isSupported"],"mappings":"AACA,MAAMA,IAAY,UAAU,UAAU,YAAA,EAAc,SAAS,SAAS,GAoChEC,IAAS;AAAA,EACd,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AACN;AAEA,eAAeC,EAAsBC,GAA8C;AAClF,SAAK,WAAW,gBAEJ,MAAM,aAAa,kBAAkB;AAAA,IAChD,OAAOF,EAAOE,CAAK;AAAA,IACnB,kBAAkB;AAAA,IAClB,YAAY;AAAA,EAAA,CACZ,GAEU,cAAc,KARY;AAStC;AAEA,eAAeC,EAAsBD,GAA4C;AAChF,QAAME,IAAW,MAAM,aAAa,kBAAkB;AAAA,IACrD,OAAOJ,EAAOE,CAAK;AAAA,IACnB,sBAAsB;AAAA,EAAA,CACtB,GAEKG,IAAW,MAAM,aAAa,kBAAkB;AAAA,IACrD,OAAOL,EAAOE,CAAK;AAAA,IACnB,sBAAsB;AAAA,EAAA,CACtB;AAKD,SAAO;AAAA,IACN,UAHeH,KAAaM,EAAS,QAAQ,yBAAyB,oBAGlD,SAAYA,EAAS,cAAc;AAAA,IACvD,UAAUD,EAAS,cAAc;AAAA,EAAA;AAEnC;AAEA,eAAsBE,IAA6B;AAClD,SAAO;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/support/index.ts"],"sourcesContent":["// https://bugzilla.mozilla.org/show_bug.cgi?id=1967793\nconst isFirefox = navigator.userAgent.toLowerCase().includes(\"firefox\");\n\nexport type Partial = \"full\" | \"partial\" | \"none\";\n\nexport type Codec = {\n\thardware?: boolean; // undefined when we can't detect hardware acceleration\n\tsoftware: boolean;\n};\n\nexport type Audio = {\n\taac: boolean;\n\topus: Partial;\n};\n\nexport type Video = {\n\th264: Codec;\n\th265: Codec;\n\tvp8: Codec;\n\tvp9: Codec;\n\tav1: Codec;\n};\n\nexport type Full = {\n\twebtransport: Partial;\n\taudio: {\n\t\tdecoding: Audio;\n\t\trender: boolean;\n\t};\n\tvideo: {\n\t\tdecoding: Video | undefined;\n\t\trender: boolean;\n\t};\n};\n\n// Pick a codec string for each codec.\n// This is not strictly correct, as browsers may not support every profile or level.\nconst CODECS = {\n\taac: \"mp4a.40.2\",\n\topus: \"opus\",\n\tav1: \"av01.0.08M.08\",\n\th264: \"avc1.640028\",\n\th265: \"hev1.1.6.L93.B0\",\n\tvp9: \"vp09.00.10.08\",\n\tvp8: \"vp8\",\n};\n\nasync function audioDecoderSupported(codec: keyof typeof CODECS): Promise<boolean> {\n\tif (!globalThis.AudioDecoder) return false;\n\n\tconst res = await AudioDecoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\tnumberOfChannels: 2,\n\t\tsampleRate: 48000,\n\t});\n\n\treturn res.supported === true;\n}\n\nasync function videoDecoderSupported(codec: keyof typeof CODECS): Promise<Codec> {\n\tconst software = await VideoDecoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\thardwareAcceleration: \"prefer-software\",\n\t});\n\n\tconst hardware = await VideoDecoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\thardwareAcceleration: \"prefer-hardware\",\n\t});\n\n\t// We can't reliably detect hardware encoding on Firefox: https://github.com/w3c/webcodecs/issues/896\n\tconst unknown = isFirefox || hardware.config?.hardwareAcceleration !== \"prefer-hardware\";\n\n\treturn {\n\t\thardware: unknown ? undefined : hardware.supported === true,\n\t\tsoftware: software.supported === true,\n\t};\n}\n\nexport async function isSupported(): Promise<Full> {\n\treturn {\n\t\t// Firefox's WebTransport drops server-initiated bidi streams, so we force the\n\t\t// WebSocket fallback. Report \"partial\" to surface the degraded path in UI.\n\t\twebtransport: typeof WebTransport !== \"undefined\" ? (isFirefox ? \"partial\" : \"full\") : \"partial\",\n\t\taudio: {\n\t\t\tdecoding: {\n\t\t\t\taac: await audioDecoderSupported(\"aac\"),\n\t\t\t\topus: (await audioDecoderSupported(\"opus\")) ? \"full\" : \"partial\",\n\t\t\t},\n\t\t\trender: typeof AudioContext !== \"undefined\" && typeof AudioBufferSourceNode !== \"undefined\",\n\t\t},\n\t\tvideo: {\n\t\t\tdecoding:\n\t\t\t\ttypeof VideoDecoder !== \"undefined\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\th264: await videoDecoderSupported(\"h264\"),\n\t\t\t\t\t\t\th265: await videoDecoderSupported(\"h265\"),\n\t\t\t\t\t\t\tvp8: await videoDecoderSupported(\"vp8\"),\n\t\t\t\t\t\t\tvp9: await videoDecoderSupported(\"vp9\"),\n\t\t\t\t\t\t\tav1: await videoDecoderSupported(\"av1\"),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\trender: typeof OffscreenCanvas !== \"undefined\" && typeof CanvasRenderingContext2D !== \"undefined\",\n\t\t},\n\t};\n}\n"],"names":["isFirefox","CODECS","audioDecoderSupported","codec","videoDecoderSupported","software","hardware","isSupported"],"mappings":"AACA,MAAMA,IAAY,UAAU,UAAU,YAAA,EAAc,SAAS,SAAS,GAoChEC,IAAS;AAAA,EACd,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AACN;AAEA,eAAeC,EAAsBC,GAA8C;AAClF,SAAK,WAAW,gBAEJ,MAAM,aAAa,kBAAkB;AAAA,IAChD,OAAOF,EAAOE,CAAK;AAAA,IACnB,kBAAkB;AAAA,IAClB,YAAY;AAAA,EAAA,CACZ,GAEU,cAAc,KARY;AAStC;AAEA,eAAeC,EAAsBD,GAA4C;AAChF,QAAME,IAAW,MAAM,aAAa,kBAAkB;AAAA,IACrD,OAAOJ,EAAOE,CAAK;AAAA,IACnB,sBAAsB;AAAA,EAAA,CACtB,GAEKG,IAAW,MAAM,aAAa,kBAAkB;AAAA,IACrD,OAAOL,EAAOE,CAAK;AAAA,IACnB,sBAAsB;AAAA,EAAA,CACtB;AAKD,SAAO;AAAA,IACN,UAHeH,KAAaM,EAAS,QAAQ,yBAAyB,oBAGlD,SAAYA,EAAS,cAAc;AAAA,IACvD,UAAUD,EAAS,cAAc;AAAA,EAAA;AAEnC;AAEA,eAAsBE,IAA6B;AAClD,SAAO;AAAA;AAAA;AAAA,IAGN,cAAc,OAAO,eAAiB,MAAeP,IAAY,YAA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