@moq/publish 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/README.md +100 -0
- package/audio/capture-worklet.d.ts +2 -0
- package/audio/capture-worklet.d.ts.map +1 -0
- package/audio/capture.d.ts +6 -0
- package/audio/capture.d.ts.map +1 -0
- package/audio/encoder.d.ts +31 -0
- package/audio/encoder.d.ts.map +1 -0
- package/audio/index.d.ts +3 -0
- package/audio/index.d.ts.map +1 -0
- package/audio/types.d.ts +18 -0
- package/audio/types.d.ts.map +1 -0
- package/broadcast.d.ts +36 -0
- package/broadcast.d.ts.map +1 -0
- package/chat/index.d.ts +19 -0
- package/chat/index.d.ts.map +1 -0
- package/chat/message.d.ts +19 -0
- package/chat/message.d.ts.map +1 -0
- package/chat/typing.d.ts +19 -0
- package/chat/typing.d.ts.map +1 -0
- package/element.d.ts +32 -0
- package/element.d.ts.map +1 -0
- package/element.js +141 -0
- package/element.js.map +1 -0
- package/index.d.ts +9 -0
- package/index.d.ts.map +1 -0
- package/index.js +24 -0
- package/index.js.map +1 -0
- package/libav-opus-af-BlMWboA7.js +368 -0
- package/libav-opus-af-BlMWboA7.js.map +1 -0
- package/location/index.d.ts +33 -0
- package/location/index.d.ts.map +1 -0
- package/location/peers.d.ts +26 -0
- package/location/peers.d.ts.map +1 -0
- package/location/window.d.ts +35 -0
- package/location/window.d.ts.map +1 -0
- package/main-DGBFe0O7.js +2301 -0
- package/main-DGBFe0O7.js.map +1 -0
- package/package.json +41 -0
- package/preview.d.ts +21 -0
- package/preview.d.ts.map +1 -0
- package/screen-BCioRZHS.js +6579 -0
- package/screen-BCioRZHS.js.map +1 -0
- package/source/camera.d.ts +19 -0
- package/source/camera.d.ts.map +1 -0
- package/source/device.d.ts +19 -0
- package/source/device.d.ts.map +1 -0
- package/source/file.d.ts +20 -0
- package/source/file.d.ts.map +1 -0
- package/source/index.d.ts +6 -0
- package/source/index.d.ts.map +1 -0
- package/source/microphone.d.ts +19 -0
- package/source/microphone.d.ts.map +1 -0
- package/source/screen.d.ts +22 -0
- package/source/screen.d.ts.map +1 -0
- package/support/element.d.ts +22 -0
- package/support/element.d.ts.map +1 -0
- package/support/element.js +184 -0
- package/support/element.js.map +1 -0
- package/support/index.d.ts +29 -0
- package/support/index.d.ts.map +1 -0
- package/support/index.js +63 -0
- package/support/index.js.map +1 -0
- package/ui/components/CameraSourceButton.d.ts +2 -0
- package/ui/components/CameraSourceButton.d.ts.map +1 -0
- package/ui/components/FileSourceButton.d.ts +2 -0
- package/ui/components/FileSourceButton.d.ts.map +1 -0
- package/ui/components/MediaSourceSelector.d.ts +8 -0
- package/ui/components/MediaSourceSelector.d.ts.map +1 -0
- package/ui/components/MicrophoneSourceButton.d.ts +2 -0
- package/ui/components/MicrophoneSourceButton.d.ts.map +1 -0
- package/ui/components/NothingSourceButton.d.ts +2 -0
- package/ui/components/NothingSourceButton.d.ts.map +1 -0
- package/ui/components/PublishControls.d.ts +2 -0
- package/ui/components/PublishControls.d.ts.map +1 -0
- package/ui/components/PublishStatusIndicator.d.ts +2 -0
- package/ui/components/PublishStatusIndicator.d.ts.map +1 -0
- package/ui/components/ScreenSourceButton.d.ts +2 -0
- package/ui/components/ScreenSourceButton.d.ts.map +1 -0
- package/ui/context.d.ts +25 -0
- package/ui/context.d.ts.map +1 -0
- package/ui/element.d.ts +5 -0
- package/ui/element.d.ts.map +1 -0
- package/ui/hooks/use-publish-ui.d.ts +15 -0
- package/ui/hooks/use-publish-ui.d.ts.map +1 -0
- package/ui/index.d.ts +7 -0
- package/ui/index.d.ts.map +1 -0
- package/ui/index.js +974 -0
- package/ui/index.js.map +1 -0
- package/user.d.ts +25 -0
- package/user.d.ts.map +1 -0
- package/video/encoder.d.ts +31 -0
- package/video/encoder.d.ts.map +1 -0
- package/video/index.d.ts +85 -0
- package/video/index.d.ts.map +1 -0
- package/video/polyfill.d.ts +3 -0
- package/video/polyfill.d.ts.map +1 -0
- package/video/types.d.ts +20 -0
- package/video/types.d.ts.map +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Effect, Signal } from "@moq/signals";
|
|
2
|
+
import type * as Video from "../video";
|
|
3
|
+
import { Device, type DeviceProps } from "./device";
|
|
4
|
+
export interface CameraProps {
|
|
5
|
+
enabled?: boolean | Signal<boolean>;
|
|
6
|
+
device?: DeviceProps;
|
|
7
|
+
constraints?: Video.Constraints | Signal<Video.Constraints | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare class Camera {
|
|
10
|
+
#private;
|
|
11
|
+
enabled: Signal<boolean>;
|
|
12
|
+
device: Device<"video">;
|
|
13
|
+
constraints: Signal<Video.Constraints | undefined>;
|
|
14
|
+
source: Signal<Video.StreamTrack | undefined>;
|
|
15
|
+
signals: Effect;
|
|
16
|
+
constructor(props?: CameraProps);
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../src/source/camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,WAAW;IAC3B,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;CACxE;AAED,qBAAa,MAAM;;IAClB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAExB,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAEnD,MAAM,wCAAmD;IACzD,OAAO,SAAgB;gBAEX,KAAK,CAAC,EAAE,WAAW;IAgD/B,KAAK;CAIL"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Effect, type Getter, Signal } from "@moq/signals";
|
|
2
|
+
export interface DeviceProps {
|
|
3
|
+
preferred?: string | Signal<string | undefined>;
|
|
4
|
+
}
|
|
5
|
+
export declare class Device<Kind extends "audio" | "video"> {
|
|
6
|
+
#private;
|
|
7
|
+
kind: Kind;
|
|
8
|
+
readonly available: Getter<MediaDeviceInfo[] | undefined>;
|
|
9
|
+
readonly default: Getter<string | undefined>;
|
|
10
|
+
preferred: Signal<string | undefined>;
|
|
11
|
+
active: Signal<string | undefined>;
|
|
12
|
+
permission: Signal<boolean>;
|
|
13
|
+
requested: Getter<string | undefined>;
|
|
14
|
+
signals: Effect;
|
|
15
|
+
constructor(kind: Kind, props?: DeviceProps);
|
|
16
|
+
requestPermission(): void;
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=device.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/source/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,WAAW,WAAW;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAChD;AAED,qBAAa,MAAM,CAAC,IAAI,SAAS,OAAO,GAAG,OAAO;;IACjD,IAAI,EAAE,IAAI,CAAC;IAIX,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,eAAe,EAAE,GAAG,SAAS,CAAC,CAAiB;IAI1E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,CAAiB;IAG7D,SAAS,EAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAGtC,MAAM,6BAA6C;IAGnD,UAAU,kBAA8B;IAIxC,SAAS,EAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,CAAmB;IAExD,OAAO,SAAgB;gBAEX,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,WAAW;IA4F3C,iBAAiB;IAqBjB,KAAK;CAGL"}
|
package/source/file.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Effect, Signal } from "@moq/signals";
|
|
2
|
+
import type { StreamTrack as AudioStreamTrack } from "../audio/types";
|
|
3
|
+
import type { StreamTrack as VideoStreamTrack } from "../video/types";
|
|
4
|
+
export interface FileSourceConfig {
|
|
5
|
+
enabled?: boolean | Signal<boolean>;
|
|
6
|
+
file?: globalThis.File | Signal<globalThis.File | undefined>;
|
|
7
|
+
}
|
|
8
|
+
export declare class File {
|
|
9
|
+
#private;
|
|
10
|
+
file: Signal<globalThis.File | undefined>;
|
|
11
|
+
signals: Effect;
|
|
12
|
+
source: Signal<{
|
|
13
|
+
video?: VideoStreamTrack;
|
|
14
|
+
audio?: AudioStreamTrack;
|
|
15
|
+
}>;
|
|
16
|
+
enabled: Signal<boolean>;
|
|
17
|
+
constructor(config: FileSourceConfig);
|
|
18
|
+
close(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/source/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;CAC7D;AAED,qBAAa,IAAI;;IAChB,IAAI,sCAAsD;IAC1D,OAAO,SAAgB;IAEvB,MAAM;gBAAwB,gBAAgB;gBAAU,gBAAgB;OAAQ;IAChF,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;gBAEb,MAAM,EAAE,gBAAgB;IAmGpC,KAAK;CAGL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/source/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Effect, Signal } from "@moq/signals";
|
|
2
|
+
import type * as Audio from "../audio";
|
|
3
|
+
import { Device, type DeviceProps } from "./device";
|
|
4
|
+
export interface MicrophoneProps {
|
|
5
|
+
enabled?: boolean | Signal<boolean>;
|
|
6
|
+
device?: DeviceProps;
|
|
7
|
+
constraints?: Audio.Constraints | Signal<Audio.Constraints | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare class Microphone {
|
|
10
|
+
#private;
|
|
11
|
+
enabled: Signal<boolean>;
|
|
12
|
+
device: Device<"audio">;
|
|
13
|
+
constraints: Signal<Audio.Constraints | undefined>;
|
|
14
|
+
source: Signal<Audio.StreamTrack | undefined>;
|
|
15
|
+
signals: Effect;
|
|
16
|
+
constructor(props?: MicrophoneProps);
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=microphone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microphone.d.ts","sourceRoot":"","sources":["../../src/source/microphone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;CACxE;AAED,qBAAa,UAAU;;IACtB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAEzB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAExB,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAEnD,MAAM,wCAAmD;IAEzD,OAAO,SAAgB;gBAEX,KAAK,CAAC,EAAE,eAAe;IAsDnC,KAAK;CAIL"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Effect, Signal } from "@moq/signals";
|
|
2
|
+
import type * as Audio from "../audio";
|
|
3
|
+
import type * as Video from "../video";
|
|
4
|
+
export interface ScreenProps {
|
|
5
|
+
enabled?: boolean | Signal<boolean>;
|
|
6
|
+
video?: Video.Constraints | boolean | Signal<Video.Constraints | boolean | undefined>;
|
|
7
|
+
audio?: Audio.Constraints | boolean | Signal<Audio.Constraints | boolean | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare class Screen {
|
|
10
|
+
#private;
|
|
11
|
+
enabled: Signal<boolean>;
|
|
12
|
+
video: Signal<Video.Constraints | boolean | undefined>;
|
|
13
|
+
audio: Signal<Audio.Constraints | boolean | undefined>;
|
|
14
|
+
source: Signal<{
|
|
15
|
+
audio?: Audio.Source;
|
|
16
|
+
video?: Video.Source;
|
|
17
|
+
} | undefined>;
|
|
18
|
+
signals: Effect;
|
|
19
|
+
constructor(props?: ScreenProps);
|
|
20
|
+
close(): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/source/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,WAAW;IAC3B,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IACtF,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CACtF;AAED,qBAAa,MAAM;;IAClB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAEzB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAEvD,MAAM;gBAAwB,KAAK,CAAC,MAAM;gBAAU,KAAK,CAAC,MAAM;mBAA2B;IAE3F,OAAO,SAAgB;gBAEX,KAAK,CAAC,EAAE,WAAW;IAsD/B,KAAK;CAGL"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const OBSERVED: readonly ["show", "details"];
|
|
2
|
+
type Observed = (typeof OBSERVED)[number];
|
|
3
|
+
export type Show = "always" | "warning" | "error" | "never";
|
|
4
|
+
export default class MoqPublishSupport extends HTMLElement {
|
|
5
|
+
#private;
|
|
6
|
+
static observedAttributes: readonly ["show", "details"];
|
|
7
|
+
constructor();
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
attributeChangedCallback(name: Observed, _oldValue: string | null, newValue: string | null): void;
|
|
11
|
+
get show(): Show;
|
|
12
|
+
set show(show: Show);
|
|
13
|
+
get details(): boolean;
|
|
14
|
+
set details(details: boolean);
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"moq-publish-support": MoqPublishSupport;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/support/element.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,QAAQ,8BAA+B,CAAC;AAC9C,KAAK,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAO1C,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;;IAQzD,MAAM,CAAC,kBAAkB,+BAAY;;IAUrC,iBAAiB;IAKjB,oBAAoB;IAKpB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAgB1F,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,EAElB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,EAE3B;CAiND;AAID,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,qBAAqB,EAAE,iBAAiB,CAAC;KACzC;CACD"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Signal as u, Effect as b } from "@moq/signals";
|
|
2
|
+
import { isSupported as m } from "./index.js";
|
|
3
|
+
function l(h, e, ...t) {
|
|
4
|
+
const n = document.createElement(h);
|
|
5
|
+
if (!e) return n;
|
|
6
|
+
const { style: i, classList: a, dataset: r, attributes: d, ...s } = e;
|
|
7
|
+
return i && Object.assign(n.style, i), a && n.classList.add(...a), r && Object.entries(r).forEach(([o, c]) => {
|
|
8
|
+
n.dataset[o] = c;
|
|
9
|
+
}), d && Object.entries(d).forEach(([o, c]) => {
|
|
10
|
+
n.setAttribute(o, c);
|
|
11
|
+
}), t && t.forEach((o) => {
|
|
12
|
+
typeof o == "string" ? n.appendChild(document.createTextNode(o)) : n.appendChild(o);
|
|
13
|
+
}), Object.assign(n, s), n;
|
|
14
|
+
}
|
|
15
|
+
const p = navigator.userAgent.toLowerCase().includes("firefox"), C = ["show", "details"];
|
|
16
|
+
class y extends HTMLElement {
|
|
17
|
+
#i = new u("warning");
|
|
18
|
+
#e = new u(!1);
|
|
19
|
+
#n = new u(void 0);
|
|
20
|
+
#o = new u(!1);
|
|
21
|
+
#t;
|
|
22
|
+
static observedAttributes = C;
|
|
23
|
+
constructor() {
|
|
24
|
+
super(), m().then((e) => this.#n.set(e)).catch((e) => console.error("Failed to detect publish support:", e));
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
this.#t = new b(), this.#t.effect(this.#s.bind(this));
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
this.#t?.close(), this.#t = void 0;
|
|
31
|
+
}
|
|
32
|
+
attributeChangedCallback(e, t, n) {
|
|
33
|
+
if (e === "show") {
|
|
34
|
+
const i = n ?? "warning";
|
|
35
|
+
if (i === "always" || i === "warning" || i === "error" || i === "never")
|
|
36
|
+
this.show = i;
|
|
37
|
+
else
|
|
38
|
+
throw new Error(`Invalid show: ${i}`);
|
|
39
|
+
} else if (e === "details")
|
|
40
|
+
this.details = n !== null;
|
|
41
|
+
else {
|
|
42
|
+
const i = e;
|
|
43
|
+
throw new Error(`Invalid attribute: ${i}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
get show() {
|
|
47
|
+
return this.#i.peek();
|
|
48
|
+
}
|
|
49
|
+
set show(e) {
|
|
50
|
+
this.#i.set(e);
|
|
51
|
+
}
|
|
52
|
+
get details() {
|
|
53
|
+
return this.#e.peek();
|
|
54
|
+
}
|
|
55
|
+
set details(e) {
|
|
56
|
+
this.#e.set(e);
|
|
57
|
+
}
|
|
58
|
+
#r(e) {
|
|
59
|
+
return e.webtransport === "none" || !e.audio.encoding || !e.video.encoding || !e.audio.capture || !Object.values(e.audio.encoding).some((t) => t === !0 || t === "full" || t === "partial") || !Object.values(e.video.encoding).some((t) => t.software || t.hardware) ? "none" : e.video.capture === "partial" || !Object.values(e.video.encoding).some((t) => t.hardware) ? "partial" : "full";
|
|
60
|
+
}
|
|
61
|
+
#s(e) {
|
|
62
|
+
const t = e.get(this.#n);
|
|
63
|
+
if (!t || e.get(this.#o)) return;
|
|
64
|
+
const i = e.get(this.#i);
|
|
65
|
+
if (i === "never") return;
|
|
66
|
+
const a = this.#r(t);
|
|
67
|
+
if (i === "warning" && a === "full" || i === "error" && a !== "none") return;
|
|
68
|
+
const r = l("div", {
|
|
69
|
+
style: {
|
|
70
|
+
margin: "0 auto",
|
|
71
|
+
maxWidth: "28rem",
|
|
72
|
+
padding: "1rem"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
this.appendChild(r), e.cleanup(() => this.removeChild(r)), this.#a(r, a, e), e.get(this.#e) && this.#l(r, t, e);
|
|
76
|
+
}
|
|
77
|
+
#a(e, t, n) {
|
|
78
|
+
const i = l("div", {
|
|
79
|
+
style: {
|
|
80
|
+
display: "flex",
|
|
81
|
+
flexDirection: "row",
|
|
82
|
+
gap: "1rem",
|
|
83
|
+
flexWrap: "wrap",
|
|
84
|
+
justifyContent: "space-between",
|
|
85
|
+
alignItems: "center"
|
|
86
|
+
}
|
|
87
|
+
}), a = l("div", {
|
|
88
|
+
style: { fontWeight: "bold" }
|
|
89
|
+
});
|
|
90
|
+
t === "full" ? a.textContent = "🟢 Full Browser Support" : t === "partial" ? a.textContent = "🟡 Partial Browser Support" : t === "none" && (a.textContent = "🔴 No Browser Support");
|
|
91
|
+
const r = l("button", {
|
|
92
|
+
type: "button",
|
|
93
|
+
style: { fontSize: "14px" }
|
|
94
|
+
});
|
|
95
|
+
n.event(r, "click", () => {
|
|
96
|
+
this.#e.update((s) => !s);
|
|
97
|
+
}), n.effect((s) => {
|
|
98
|
+
r.textContent = s.get(this.#e) ? "Details ➖" : "Details ➕";
|
|
99
|
+
});
|
|
100
|
+
const d = l(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
type: "button",
|
|
104
|
+
style: { fontSize: "14px" }
|
|
105
|
+
},
|
|
106
|
+
"Close ❌"
|
|
107
|
+
);
|
|
108
|
+
n.event(d, "click", () => {
|
|
109
|
+
this.#o.set(!0);
|
|
110
|
+
}), i.appendChild(a), i.appendChild(r), i.appendChild(d), e.appendChild(i), n.cleanup(() => e.removeChild(i));
|
|
111
|
+
}
|
|
112
|
+
#l(e, t, n) {
|
|
113
|
+
const i = l("div", {
|
|
114
|
+
style: {
|
|
115
|
+
display: "grid",
|
|
116
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
117
|
+
columnGap: "0.5rem",
|
|
118
|
+
rowGap: "0.2rem",
|
|
119
|
+
backgroundColor: "rgba(0, 0, 0, 0.6)",
|
|
120
|
+
borderRadius: "0.5rem",
|
|
121
|
+
padding: "1rem",
|
|
122
|
+
fontSize: "0.875rem"
|
|
123
|
+
}
|
|
124
|
+
}), a = (o) => o ? "🟢 Yes" : "🔴 No", r = (o) => o?.hardware ? "🟢 Hardware" : o?.software ? `🟡 Software${p ? "*" : ""}` : "🔴 No", d = (o) => o === "full" ? "🟢 Full" : o === "partial" ? "🟡 Polyfill" : "🔴 None", s = (o, c, f) => {
|
|
125
|
+
const g = l(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
style: {
|
|
129
|
+
gridColumnStart: "1",
|
|
130
|
+
fontWeight: "bold",
|
|
131
|
+
textAlign: "right"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
o
|
|
135
|
+
), w = l(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
style: {
|
|
139
|
+
gridColumnStart: "2",
|
|
140
|
+
textAlign: "center"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
c
|
|
144
|
+
), v = l(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
style: { gridColumnStart: "3" }
|
|
148
|
+
},
|
|
149
|
+
f
|
|
150
|
+
);
|
|
151
|
+
i.appendChild(g), i.appendChild(w), i.appendChild(v);
|
|
152
|
+
};
|
|
153
|
+
if (s("WebTransport", "", d(t.webtransport)), s("Capture", "Audio", a(t.audio.capture)), s("", "Video", d(t.video.capture)), s("Encoding", "Opus", d(t.audio.encoding.opus)), s("", "AAC", a(t.audio.encoding.aac)), s("", "AV1", r(t.video.encoding?.av1)), s("", "H.265", r(t.video.encoding?.h265)), s("", "H.264", r(t.video.encoding?.h264)), s("", "VP9", r(t.video.encoding?.vp9)), s("", "VP8", r(t.video.encoding?.vp8)), p) {
|
|
154
|
+
const o = l(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
style: {
|
|
158
|
+
gridColumnStart: "1",
|
|
159
|
+
gridColumnEnd: "4",
|
|
160
|
+
textAlign: "center",
|
|
161
|
+
fontSize: "0.875rem",
|
|
162
|
+
fontStyle: "italic"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"Hardware acceleration is ",
|
|
166
|
+
l(
|
|
167
|
+
"a",
|
|
168
|
+
{
|
|
169
|
+
href: "https://github.com/w3c/webcodecs/issues/896"
|
|
170
|
+
},
|
|
171
|
+
"undetectable"
|
|
172
|
+
),
|
|
173
|
+
" on Firefox."
|
|
174
|
+
);
|
|
175
|
+
i.appendChild(o);
|
|
176
|
+
}
|
|
177
|
+
e.appendChild(i), n.cleanup(() => e.removeChild(i));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
customElements.define("moq-publish-support", y);
|
|
181
|
+
export {
|
|
182
|
+
y as default
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.js","sources":["../../../signals/src/dom.ts","../../src/support/element.ts"],"sourcesContent":["import type { Effect } from \".\";\n\nexport type CreateOptions<T extends HTMLElement> = {\n\tstyle?: Partial<CSSStyleDeclaration>;\n\tclassName?: string;\n\tclassList?: string[];\n\tid?: string;\n\tdataset?: Record<string, string>;\n\tattributes?: Record<string, string>;\n} & Partial<Omit<T, \"style\" | \"dataset\">>;\n\nexport function create<K extends keyof HTMLElementTagNameMap>(\n\ttagName: K,\n\toptions?: CreateOptions<HTMLElementTagNameMap[K] & HTMLElement>,\n\t...children: (HTMLElement | string)[]\n): HTMLElementTagNameMap[K] {\n\tconst element = document.createElement(tagName);\n\n\tif (!options) return element;\n\n\tconst { style, classList, dataset, attributes, ...props } = options;\n\n\t// Apply styles\n\tif (style) {\n\t\tObject.assign(element.style, style);\n\t}\n\n\t// Apply class list\n\tif (classList) {\n\t\telement.classList.add(...classList);\n\t}\n\n\t// Apply dataset\n\tif (dataset) {\n\t\tObject.entries(dataset).forEach(([key, value]) => {\n\t\t\telement.dataset[key] = value;\n\t\t});\n\t}\n\n\t// Apply attributes\n\tif (attributes) {\n\t\tObject.entries(attributes).forEach(([key, value]) => {\n\t\t\telement.setAttribute(key, value);\n\t\t});\n\t}\n\n\t// Append children\n\tif (children) {\n\t\tchildren.forEach((child) => {\n\t\t\tif (typeof child === \"string\") {\n\t\t\t\telement.appendChild(document.createTextNode(child));\n\t\t\t} else {\n\t\t\t\telement.appendChild(child);\n\t\t\t}\n\t\t});\n\t}\n\n\t// Apply other properties\n\tObject.assign(element, props);\n\n\treturn element;\n}\n\n// Matches solid.js's JSX.Element type.\nexport type Element = Node | ArrayElement | (string & {}) | number | boolean | null | undefined;\ninterface ArrayElement extends Array<Element> {}\n\nexport function render(effect: Effect, parent: Node, element: Element | ((effect: Effect) => Element)) {\n\tconst e = typeof element === \"function\" ? element(effect) : element;\n\tif (e === undefined || e === null) return;\n\n\tlet node: Node;\n\tif (e instanceof Node) {\n\t\tnode = e;\n\t} else if (Array.isArray(e)) {\n\t\tnode = document.createDocumentFragment();\n\t\tfor (const child of e) {\n\t\t\trender(effect, node, child);\n\t\t}\n\t} else if (typeof e === \"number\" || typeof e === \"boolean\" || typeof e === \"string\") {\n\t\tnode = document.createTextNode(e.toString());\n\t} else {\n\t\tconst exhaustive: never = e;\n\t\tthrow new Error(`Invalid element type: ${exhaustive}`);\n\t}\n\n\tparent.appendChild(node);\n\teffect.cleanup(() => parent.removeChild(node));\n}\n\nexport function setClass(effect: Effect, element: HTMLElement, ...classNames: string[]) {\n\tfor (const className of classNames) {\n\t\telement.classList.add(className);\n\t}\n\n\teffect.cleanup(() => {\n\t\tfor (const className of classNames) {\n\t\t\telement.classList.remove(className);\n\t\t}\n\t});\n}\n","import { Effect, Signal } from \"@moq/signals\";\nimport * as DOM from \"@moq/signals/dom\";\nimport { type Codec, type Full, isSupported, type Partial } from \"./\";\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=1967793\nconst isFirefox = navigator.userAgent.toLowerCase().includes(\"firefox\");\n\nconst OBSERVED = [\"show\", \"details\"] as const;\ntype Observed = (typeof OBSERVED)[number];\n\n// Whether to display the support banner.\n// - \"always\": Always display the banner.\n// - \"warning\": Display the banner if a required feature needs a polyfill/fallback.\n// - \"error\": Display the banner if a required feature is unsupported.\n// - \"never\": Never display the banner.\nexport type Show = \"always\" | \"warning\" | \"error\" | \"never\";\n\nexport default class MoqPublishSupport extends HTMLElement {\n\t#show = new Signal<Show>(\"warning\");\n\t#details = new Signal<boolean>(false);\n\t#support = new Signal<Full | undefined>(undefined);\n\t#close = new Signal<boolean>(false);\n\n\t#signals?: Effect;\n\n\tstatic observedAttributes = OBSERVED;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tisSupported()\n\t\t\t.then((s) => this.#support.set(s))\n\t\t\t.catch((err) => console.error(\"Failed to detect publish support:\", err));\n\t}\n\n\tconnectedCallback() {\n\t\tthis.#signals = new Effect();\n\t\tthis.#signals.effect(this.#render.bind(this));\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.#signals?.close();\n\t\tthis.#signals = undefined;\n\t}\n\n\tattributeChangedCallback(name: Observed, _oldValue: string | null, newValue: string | null) {\n\t\tif (name === \"show\") {\n\t\t\tconst show = newValue ?? \"warning\";\n\t\t\tif (show === \"always\" || show === \"warning\" || show === \"error\" || show === \"never\") {\n\t\t\t\tthis.show = show;\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Invalid show: ${show}`);\n\t\t\t}\n\t\t} else if (name === \"details\") {\n\t\t\tthis.details = newValue !== null;\n\t\t} else {\n\t\t\tconst exhaustive: never = name;\n\t\t\tthrow new Error(`Invalid attribute: ${exhaustive}`);\n\t\t}\n\t}\n\n\tget show(): Show {\n\t\treturn this.#show.peek();\n\t}\n\n\tset show(show: Show) {\n\t\tthis.#show.set(show);\n\t}\n\n\tget details(): boolean {\n\t\treturn this.#details.peek();\n\t}\n\n\tset details(details: boolean) {\n\t\tthis.#details.set(details);\n\t}\n\n\t#getSummary(support: Full): Partial {\n\t\tif (support.webtransport === \"none\") return \"none\";\n\n\t\tif (!support.audio.encoding || !support.video.encoding) return \"none\";\n\t\tif (!support.audio.capture) return \"none\";\n\n\t\tif (!Object.values(support.audio.encoding).some((v) => v === true || v === \"full\" || v === \"partial\"))\n\t\t\treturn \"none\";\n\t\tif (!Object.values(support.video.encoding).some((v) => v.software || v.hardware)) return \"none\";\n\n\t\tif (support.video.capture === \"partial\") return \"partial\";\n\n\t\tif (!Object.values(support.video.encoding).some((v) => v.hardware)) return \"partial\";\n\n\t\treturn \"full\";\n\t}\n\n\t#render(effect: Effect) {\n\t\tconst support = effect.get(this.#support);\n\t\tif (!support) return;\n\n\t\tconst close = effect.get(this.#close);\n\t\tif (close) return;\n\n\t\tconst show = effect.get(this.#show);\n\t\tif (show === \"never\") return;\n\n\t\tconst summary = this.#getSummary(support);\n\n\t\t// Don't render the banner if we have full support and they only asked for warnings.\n\t\tif (show === \"warning\" && summary === \"full\") return;\n\n\t\t// Don't render the banner if we have at least partial support and they only asked for errors.\n\t\tif (show === \"error\" && summary !== \"none\") return;\n\n\t\tconst container = DOM.create(\"div\", {\n\t\t\tstyle: {\n\t\t\t\tmargin: \"0 auto\",\n\t\t\t\tmaxWidth: \"28rem\",\n\t\t\t\tpadding: \"1rem\",\n\t\t\t},\n\t\t});\n\n\t\tthis.appendChild(container);\n\t\teffect.cleanup(() => this.removeChild(container));\n\n\t\tthis.#renderHeader(container, summary, effect);\n\n\t\tif (effect.get(this.#details)) {\n\t\t\tthis.#renderDetails(container, support, effect);\n\t\t}\n\t}\n\n\t#renderHeader(parent: HTMLDivElement, summary: Partial, effect: Effect) {\n\t\tconst headerDiv = DOM.create(\"div\", {\n\t\t\tstyle: {\n\t\t\t\tdisplay: \"flex\",\n\t\t\t\tflexDirection: \"row\",\n\t\t\t\tgap: \"1rem\",\n\t\t\t\tflexWrap: \"wrap\",\n\t\t\t\tjustifyContent: \"space-between\",\n\t\t\t\talignItems: \"center\",\n\t\t\t},\n\t\t});\n\n\t\tconst statusDiv = DOM.create(\"div\", {\n\t\t\tstyle: { fontWeight: \"bold\" },\n\t\t});\n\n\t\tif (summary === \"full\") {\n\t\t\tstatusDiv.textContent = \"🟢 Full Browser Support\";\n\t\t} else if (summary === \"partial\") {\n\t\t\tstatusDiv.textContent = \"🟡 Partial Browser Support\";\n\t\t} else if (summary === \"none\") {\n\t\t\tstatusDiv.textContent = \"🔴 No Browser Support\";\n\t\t}\n\n\t\tconst detailsButton = DOM.create(\"button\", {\n\t\t\ttype: \"button\",\n\t\t\tstyle: { fontSize: \"14px\" },\n\t\t});\n\n\t\teffect.event(detailsButton, \"click\", () => {\n\t\t\tthis.#details.update((prev) => !prev);\n\t\t});\n\n\t\teffect.effect((effect) => {\n\t\t\tdetailsButton.textContent = effect.get(this.#details) ? \"Details ➖\" : \"Details ➕\";\n\t\t});\n\n\t\tconst closeButton = DOM.create(\n\t\t\t\"button\",\n\t\t\t{\n\t\t\t\ttype: \"button\",\n\t\t\t\tstyle: { fontSize: \"14px\" },\n\t\t\t},\n\t\t\t\"Close ❌\",\n\t\t);\n\n\t\teffect.event(closeButton, \"click\", () => {\n\t\t\tthis.#close.set(true);\n\t\t});\n\n\t\theaderDiv.appendChild(statusDiv);\n\t\theaderDiv.appendChild(detailsButton);\n\t\theaderDiv.appendChild(closeButton);\n\n\t\tparent.appendChild(headerDiv);\n\t\teffect.cleanup(() => parent.removeChild(headerDiv));\n\t}\n\n\t#renderDetails(parent: HTMLDivElement, support: Full, effect: Effect) {\n\t\tconst container = DOM.create(\"div\", {\n\t\t\tstyle: {\n\t\t\t\tdisplay: \"grid\",\n\t\t\t\tgridTemplateColumns: \"1fr 1fr 1fr\",\n\t\t\t\tcolumnGap: \"0.5rem\",\n\t\t\t\trowGap: \"0.2rem\",\n\t\t\t\tbackgroundColor: \"rgba(0, 0, 0, 0.6)\",\n\t\t\t\tborderRadius: \"0.5rem\",\n\t\t\t\tpadding: \"1rem\",\n\t\t\t\tfontSize: \"0.875rem\",\n\t\t\t},\n\t\t});\n\n\t\tconst binary = (value: boolean | undefined) => (value ? \"🟢 Yes\" : \"🔴 No\");\n\t\tconst hardware = (codec: Codec | undefined) =>\n\t\t\tcodec?.hardware ? \"🟢 Hardware\" : codec?.software ? `🟡 Software${isFirefox ? \"*\" : \"\"}` : \"🔴 No\";\n\t\tconst partial = (value: Partial | undefined) =>\n\t\t\tvalue === \"full\" ? \"🟢 Full\" : value === \"partial\" ? \"🟡 Polyfill\" : \"🔴 None\";\n\n\t\tconst addRow = (label: string, col2: string, col3: string) => {\n\t\t\tconst labelDiv = DOM.create(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tgridColumnStart: \"1\",\n\t\t\t\t\t\tfontWeight: \"bold\",\n\t\t\t\t\t\ttextAlign: \"right\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlabel,\n\t\t\t);\n\n\t\t\tconst col2Div = DOM.create(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tgridColumnStart: \"2\",\n\t\t\t\t\t\ttextAlign: \"center\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tcol2,\n\t\t\t);\n\n\t\t\tconst col3Div = DOM.create(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tstyle: { gridColumnStart: \"3\" },\n\t\t\t\t},\n\t\t\t\tcol3,\n\t\t\t);\n\n\t\t\tcontainer.appendChild(labelDiv);\n\t\t\tcontainer.appendChild(col2Div);\n\t\t\tcontainer.appendChild(col3Div);\n\t\t};\n\n\t\taddRow(\"WebTransport\", \"\", partial(support.webtransport));\n\t\taddRow(\"Capture\", \"Audio\", binary(support.audio.capture));\n\t\taddRow(\"\", \"Video\", partial(support.video.capture));\n\t\taddRow(\"Encoding\", \"Opus\", partial(support.audio.encoding.opus));\n\t\taddRow(\"\", \"AAC\", binary(support.audio.encoding.aac));\n\t\taddRow(\"\", \"AV1\", hardware(support.video.encoding?.av1));\n\t\taddRow(\"\", \"H.265\", hardware(support.video.encoding?.h265));\n\t\taddRow(\"\", \"H.264\", hardware(support.video.encoding?.h264));\n\t\taddRow(\"\", \"VP9\", hardware(support.video.encoding?.vp9));\n\t\taddRow(\"\", \"VP8\", hardware(support.video.encoding?.vp8));\n\n\t\tif (isFirefox) {\n\t\t\tconst noteDiv = DOM.create(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tgridColumnStart: \"1\",\n\t\t\t\t\t\tgridColumnEnd: \"4\",\n\t\t\t\t\t\ttextAlign: \"center\",\n\t\t\t\t\t\tfontSize: \"0.875rem\",\n\t\t\t\t\t\tfontStyle: \"italic\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"Hardware acceleration is \",\n\t\t\t\tDOM.create(\n\t\t\t\t\t\"a\",\n\t\t\t\t\t{\n\t\t\t\t\t\thref: \"https://github.com/w3c/webcodecs/issues/896\",\n\t\t\t\t\t},\n\t\t\t\t\t\"undetectable\",\n\t\t\t\t),\n\t\t\t\t\" on Firefox.\",\n\t\t\t);\n\t\t\tcontainer.appendChild(noteDiv);\n\t\t}\n\n\t\tparent.appendChild(container);\n\t\teffect.cleanup(() => parent.removeChild(container));\n\t}\n}\n\ncustomElements.define(\"moq-publish-support\", MoqPublishSupport);\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"moq-publish-support\": MoqPublishSupport;\n\t}\n}\n"],"names":["create","tagName","options","children","element","style","classList","dataset","attributes","props","key","value","child","isFirefox","OBSERVED","MoqPublishSupport","#show","Signal","#details","#support","#close","#signals","isSupported","s","err","Effect","#render","name","_oldValue","newValue","show","exhaustive","details","#getSummary","support","v","effect","summary","container","DOM.create","#renderHeader","#renderDetails","parent","headerDiv","statusDiv","detailsButton","prev","closeButton","binary","hardware","codec","partial","addRow","label","col2","col3","labelDiv","col2Div","col3Div","noteDiv"],"mappings":";;AAWO,SAASA,EACfC,GACAC,MACGC,GACwB;AAC3B,QAAMC,IAAU,SAAS,cAAcH,CAAO;AAE9C,MAAI,CAACC,EAAS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AA,YACX,UAAU;AAAA,YACV,WAAW;AAAA,UAAA;AAAA,QACZ;AAAA,QAED;AAAA,QACAA;AAAAA,UACC;AAAA,UACA;AAAA,YACC,MAAM;AAAA,UAAA;AAAA,UAEP;AAAA,QAAA;AAAA,QAED;AAAA,MAAA;AAED,MAAAD,EAAU,YAAYqB,CAAO;AAAA,IAC9B;AAEA,IAAAjB,EAAO,YAAYJ,CAAS,GAC5BF,EAAO,QAAQ,MAAMM,EAAO,YAAYJ,CAAS,CAAC;AAAA,EACnD;AACD;AAEA,eAAe,OAAO,uBAAuBvB,CAAiB;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type Partial = "full" | "partial" | "none";
|
|
2
|
+
export type Codec = {
|
|
3
|
+
hardware?: boolean;
|
|
4
|
+
software: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type Audio = {
|
|
7
|
+
aac: boolean;
|
|
8
|
+
opus: Partial;
|
|
9
|
+
};
|
|
10
|
+
export type Video = {
|
|
11
|
+
h264: Codec;
|
|
12
|
+
h265: Codec;
|
|
13
|
+
vp8: Codec;
|
|
14
|
+
vp9: Codec;
|
|
15
|
+
av1: Codec;
|
|
16
|
+
};
|
|
17
|
+
export type Full = {
|
|
18
|
+
webtransport: Partial;
|
|
19
|
+
audio: {
|
|
20
|
+
capture: boolean;
|
|
21
|
+
encoding: Audio;
|
|
22
|
+
};
|
|
23
|
+
video: {
|
|
24
|
+
capture: Partial;
|
|
25
|
+
encoding: Video | undefined;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function isSupported(): Promise<Full>;
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;IACZ,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,KAAK,CAAC;IACX,GAAG,EAAE,KAAK,CAAC;IACX,GAAG,EAAE,KAAK,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE;QACN,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,KAAK,CAAC;KAChB,CAAC;IACF,KAAK,EAAE;QACN,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;KAC5B,CAAC;CACF,CAAC;AAkDF,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CA+BjD"}
|
package/support/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const i = navigator.userAgent.toLowerCase().includes("firefox"), r = {
|
|
2
|
+
aac: "mp4a.40.2",
|
|
3
|
+
opus: "opus",
|
|
4
|
+
av1: "av01.0.08M.08",
|
|
5
|
+
h264: "avc1.640028",
|
|
6
|
+
h265: "hev1.1.6.L93.B0",
|
|
7
|
+
vp9: "vp09.00.10.08",
|
|
8
|
+
vp8: "vp8"
|
|
9
|
+
};
|
|
10
|
+
async function t(a) {
|
|
11
|
+
return globalThis.AudioEncoder ? (await AudioEncoder.isConfigSupported({
|
|
12
|
+
codec: r[a],
|
|
13
|
+
numberOfChannels: 2,
|
|
14
|
+
sampleRate: 48e3
|
|
15
|
+
})).supported === !0 : !1;
|
|
16
|
+
}
|
|
17
|
+
async function e(a) {
|
|
18
|
+
const o = await VideoEncoder.isConfigSupported({
|
|
19
|
+
codec: r[a],
|
|
20
|
+
width: 1280,
|
|
21
|
+
height: 720,
|
|
22
|
+
hardwareAcceleration: "prefer-software"
|
|
23
|
+
}), n = await VideoEncoder.isConfigSupported({
|
|
24
|
+
codec: r[a],
|
|
25
|
+
width: 1280,
|
|
26
|
+
height: 720,
|
|
27
|
+
hardwareAcceleration: "prefer-hardware"
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
hardware: i || n.config?.hardwareAcceleration !== "prefer-hardware" ? void 0 : n.supported === !0,
|
|
31
|
+
software: o.supported === !0
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
async function p() {
|
|
35
|
+
return {
|
|
36
|
+
webtransport: typeof WebTransport < "u" ? "full" : "partial",
|
|
37
|
+
audio: {
|
|
38
|
+
capture: typeof AudioWorkletNode < "u",
|
|
39
|
+
encoding: {
|
|
40
|
+
aac: await t("aac"),
|
|
41
|
+
opus: await t("opus") ? "full" : "partial"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
video: {
|
|
45
|
+
capture: (
|
|
46
|
+
// We have a fallback for MediaStreamTrackProcessor, but it's pretty gross so no full points.
|
|
47
|
+
// @ts-expect-error No typescript types yet.
|
|
48
|
+
typeof MediaStreamTrackProcessor < "u" ? "full" : typeof OffscreenCanvas < "u" ? "partial" : "none"
|
|
49
|
+
),
|
|
50
|
+
encoding: typeof VideoEncoder < "u" ? {
|
|
51
|
+
h264: await e("h264"),
|
|
52
|
+
h265: await e("h265"),
|
|
53
|
+
vp8: await e("vp8"),
|
|
54
|
+
vp9: await e("vp9"),
|
|
55
|
+
av1: await e("av1")
|
|
56
|
+
} : void 0
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
p as isSupported
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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\tcapture: boolean;\n\t\tencoding: Audio;\n\t};\n\tvideo: {\n\t\tcapture: Partial;\n\t\tencoding: Video | undefined;\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 audioEncoderSupported(codec: keyof typeof CODECS): Promise<boolean> {\n\tif (!globalThis.AudioEncoder) return false;\n\n\tconst res = await AudioEncoder.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 videoEncoderSupported(codec: keyof typeof CODECS): Promise<Codec> {\n\tconst software = await VideoEncoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\twidth: 1280,\n\t\theight: 720,\n\t\thardwareAcceleration: \"prefer-software\",\n\t});\n\n\t// We can't reliably detect hardware encoding on Firefox: https://github.com/w3c/webcodecs/issues/896\n\tconst hardware = await VideoEncoder.isConfigSupported({\n\t\tcodec: CODECS[codec],\n\t\twidth: 1280,\n\t\theight: 720,\n\t\thardwareAcceleration: \"prefer-hardware\",\n\t});\n\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\tcapture: typeof AudioWorkletNode !== \"undefined\",\n\t\t\tencoding: {\n\t\t\t\taac: await audioEncoderSupported(\"aac\"),\n\t\t\t\topus: (await audioEncoderSupported(\"opus\")) ? \"full\" : \"partial\",\n\t\t\t},\n\t\t},\n\t\tvideo: {\n\t\t\tcapture:\n\t\t\t\t// We have a fallback for MediaStreamTrackProcessor, but it's pretty gross so no full points.\n\t\t\t\t// @ts-expect-error No typescript types yet.\n\t\t\t\ttypeof MediaStreamTrackProcessor !== \"undefined\"\n\t\t\t\t\t? \"full\"\n\t\t\t\t\t: typeof OffscreenCanvas !== \"undefined\"\n\t\t\t\t\t\t? \"partial\"\n\t\t\t\t\t\t: \"none\",\n\t\t\tencoding:\n\t\t\t\ttypeof VideoEncoder !== \"undefined\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\th264: await videoEncoderSupported(\"h264\"),\n\t\t\t\t\t\t\th265: await videoEncoderSupported(\"h265\"),\n\t\t\t\t\t\t\tvp8: await videoEncoderSupported(\"vp8\"),\n\t\t\t\t\t\t\tvp9: await videoEncoderSupported(\"vp9\"),\n\t\t\t\t\t\t\tav1: await videoEncoderSupported(\"av1\"),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t},\n\t};\n}\n"],"names":["isFirefox","CODECS","audioEncoderSupported","codec","videoEncoderSupported","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;AA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,EAAsB,KAAK;AAAA,MAAA,IAEtC;AAAA,IAAA;AAAA,EACL;AAEF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CameraSourceButton.d.ts","sourceRoot":"","sources":["../../../src/ui/components/CameraSourceButton.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,kBAAkB,mCAqCzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSourceButton.d.ts","sourceRoot":"","sources":["../../../src/ui/components/FileSourceButton.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,gBAAgB,mCAgCvC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type MediaSourceSelectorProps = {
|
|
2
|
+
sources?: MediaDeviceInfo[];
|
|
3
|
+
selectedSource?: MediaDeviceInfo["deviceId"];
|
|
4
|
+
onSelected?: (sourceId: MediaDeviceInfo["deviceId"]) => void;
|
|
5
|
+
};
|
|
6
|
+
export default function MediaSourceSelector(props: MediaSourceSelectorProps): import("solid-js").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=MediaSourceSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaSourceSelector.d.ts","sourceRoot":"","sources":["../../../src/ui/components/MediaSourceSelector.tsx"],"names":[],"mappings":"AAGA,KAAK,wBAAwB,GAAG;IAC/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IAC7C,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7D,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,kCAgC1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MicrophoneSourceButton.d.ts","sourceRoot":"","sources":["../../../src/ui/components/MicrophoneSourceButton.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,sBAAsB,mCAqC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NothingSourceButton.d.ts","sourceRoot":"","sources":["../../../src/ui/components/NothingSourceButton.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,mBAAmB,mCAiB1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublishControls.d.ts","sourceRoot":"","sources":["../../../src/ui/components/PublishControls.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,eAAe,mCActC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublishStatusIndicator.d.ts","sourceRoot":"","sources":["../../../src/ui/components/PublishStatusIndicator.tsx"],"names":[],"mappings":"AAiBA,MAAM,CAAC,OAAO,UAAU,sBAAsB,mCAoB7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenSourceButton.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ScreenSourceButton.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,kBAAkB,mCAiBzC"}
|
package/ui/context.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type MoqPublish from "../element";
|
|
3
|
+
export type PublishStatus = "no-url" | "disconnected" | "connecting" | "live" | "audio-only" | "video-only" | "select-source";
|
|
4
|
+
type PublishUIContextValue = {
|
|
5
|
+
moqPublish: MoqPublish;
|
|
6
|
+
cameraDevices: () => MediaDeviceInfo[];
|
|
7
|
+
microphoneDevices: () => MediaDeviceInfo[];
|
|
8
|
+
publishStatus: () => PublishStatus;
|
|
9
|
+
microphoneActive: () => boolean;
|
|
10
|
+
cameraActive: () => boolean;
|
|
11
|
+
screenActive: () => boolean;
|
|
12
|
+
fileActive: () => boolean;
|
|
13
|
+
nothingActive: () => boolean;
|
|
14
|
+
selectedCameraSource?: () => MediaDeviceInfo["deviceId"] | undefined;
|
|
15
|
+
selectedMicrophoneSource?: () => MediaDeviceInfo["deviceId"] | undefined;
|
|
16
|
+
setFile: (file: File) => void;
|
|
17
|
+
};
|
|
18
|
+
type PublishUIContextProviderProps = {
|
|
19
|
+
moqPublish: MoqPublish;
|
|
20
|
+
children: JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export declare const PublishUIContext: import("solid-js").Context<PublishUIContextValue | undefined>;
|
|
23
|
+
export default function PublishUIContextProvider(props: PublishUIContextProviderProps): JSX.Element;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/ui/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,aAAa,GACtB,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,eAAe,CAAC;AAEnB,KAAK,qBAAqB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,MAAM,eAAe,EAAE,CAAC;IACvC,iBAAiB,EAAE,MAAM,eAAe,EAAE,CAAC;IAC3C,aAAa,EAAE,MAAM,aAAa,CAAC;IACnC,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,YAAY,EAAE,MAAM,OAAO,CAAC;IAC5B,YAAY,EAAE,MAAM,OAAO,CAAC;IAC5B,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IACr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