@lumencast/runtime 0.9.0 → 0.10.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/dist/.tsbuildinfo +1 -1
- package/dist/app.d.ts +6 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +3 -1
- package/dist/app.js.map +1 -1
- package/dist/{broadcast-ryjLRD5q.js → broadcast-L5wm2I6J.js} +3 -3
- package/dist/{broadcast-ryjLRD5q.js.map → broadcast-L5wm2I6J.js.map} +1 -1
- package/dist/{control-AgxbXOVS.js → control-eEUG7unp.js} +4 -4
- package/dist/{control-AgxbXOVS.js.map → control-eEUG7unp.js.map} +1 -1
- package/dist/index-Clrya_9l.js +1281 -0
- package/dist/index-Clrya_9l.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/lumencast.js +18 -13
- package/dist/mount.d.ts.map +1 -1
- package/dist/mount.js +11 -0
- package/dist/mount.js.map +1 -1
- package/dist/overlay/runtime-context.d.ts +10 -0
- package/dist/overlay/runtime-context.d.ts.map +1 -1
- package/dist/overlay/runtime-context.js.map +1 -1
- package/dist/render/bundle.d.ts +1 -1
- package/dist/render/bundle.d.ts.map +1 -1
- package/dist/render/bundle.js.map +1 -1
- package/dist/render/primitives/capture.d.ts +13 -4
- package/dist/render/primitives/capture.d.ts.map +1 -1
- package/dist/render/primitives/capture.js +54 -22
- package/dist/render/primitives/capture.js.map +1 -1
- package/dist/render/primitives/index.d.ts.map +1 -1
- package/dist/render/primitives/index.js +4 -0
- package/dist/render/primitives/index.js.map +1 -1
- package/dist/render/primitives/live-peer-video.d.ts +27 -0
- package/dist/render/primitives/live-peer-video.d.ts.map +1 -0
- package/dist/render/primitives/live-peer-video.js +64 -0
- package/dist/render/primitives/live-peer-video.js.map +1 -0
- package/dist/render/primitives/media.d.ts +37 -12
- package/dist/render/primitives/media.d.ts.map +1 -1
- package/dist/render/primitives/media.js +43 -17
- package/dist/render/primitives/media.js.map +1 -1
- package/dist/render/primitives/meet-peer.d.ts +31 -0
- package/dist/render/primitives/meet-peer.d.ts.map +1 -0
- package/dist/render/primitives/meet-peer.js +46 -0
- package/dist/render/primitives/meet-peer.js.map +1 -0
- package/dist/render/prop-allowlist.d.ts.map +1 -1
- package/dist/render/prop-allowlist.js +27 -1
- package/dist/render/prop-allowlist.js.map +1 -1
- package/dist/render/tree.js +42 -8
- package/dist/render/tree.js.map +1 -1
- package/dist/{status-pill-BxCdj-KZ.js → status-pill-elORkMrh.js} +2 -2
- package/dist/{status-pill-BxCdj-KZ.js.map → status-pill-elORkMrh.js.map} +1 -1
- package/dist/{test-CaRHj_J6.js → test-7q_KJkdX.js} +4 -4
- package/dist/{test-CaRHj_J6.js.map → test-7q_KJkdX.js.map} +1 -1
- package/dist/{tree-BLIxJbD3.js → tree-BMxx5170.js} +522 -436
- package/dist/tree-BMxx5170.js.map +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/webrtc/index.d.ts +76 -0
- package/dist/webrtc/index.d.ts.map +1 -0
- package/dist/webrtc/index.js +180 -0
- package/dist/webrtc/index.js.map +1 -0
- package/dist/webrtc/meet-viewer.d.ts +139 -0
- package/dist/webrtc/meet-viewer.d.ts.map +1 -0
- package/dist/webrtc/meet-viewer.js +379 -0
- package/dist/webrtc/meet-viewer.js.map +1 -0
- package/dist/webrtc/peer-stream-registry.d.ts +21 -0
- package/dist/webrtc/peer-stream-registry.d.ts.map +1 -0
- package/dist/webrtc/peer-stream-registry.js +77 -0
- package/dist/webrtc/peer-stream-registry.js.map +1 -0
- package/package.json +4 -4
- package/src/app.tsx +9 -0
- package/src/index.ts +35 -0
- package/src/mount.ts +11 -0
- package/src/overlay/runtime-context.tsx +10 -0
- package/src/render/bundle.ts +11 -1
- package/src/render/primitives/capture.tsx +73 -28
- package/src/render/primitives/index.ts +4 -0
- package/src/render/primitives/live-peer-video.tsx +90 -0
- package/src/render/primitives/media.tsx +66 -17
- package/src/render/primitives/meet-peer.tsx +57 -0
- package/src/render/prop-allowlist.ts +27 -1
- package/src/render/tree.tsx +44 -8
- package/src/types.ts +13 -0
- package/src/webrtc/index.ts +252 -0
- package/src/webrtc/meet-viewer.ts +497 -0
- package/src/webrtc/peer-stream-registry.ts +93 -0
- package/dist/index-DrXsLYhe.js +0 -903
- package/dist/index-DrXsLYhe.js.map +0 -1
- package/dist/tree-BLIxJbD3.js.map +0 -1
package/dist/render/bundle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Transition } from "../animate/transitions.js";
|
|
2
2
|
import type { Keyframes } from "../animate/keyframes.js";
|
|
3
|
-
export type RenderKind = "stack" | "grid" | "frame" | "text" | "image" | "shape" | "media" | "repeat" | "instance" | "x-zab.capture";
|
|
3
|
+
export type RenderKind = "stack" | "grid" | "frame" | "text" | "image" | "shape" | "media" | "repeat" | "instance" | "meet.peer" | "x-zab.capture" | "x-zab.meet-peer";
|
|
4
4
|
export interface RenderNode {
|
|
5
5
|
kind: RenderKind;
|
|
6
6
|
/** Stable identifier for keyed reconciliation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/render/bundle.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIzD,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,UAAU,GAIV,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/render/bundle.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,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wBAewB;AACxB,wBAAgB,sBAAsB,CACpC,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EAC/B,SAAS,GAAE,WAAW,CAAC,MAAM,CAAsB,GAClD,IAAI,CAaN;AAID,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAClE;gCAC4B;IAC5B,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC;AAED;;;sEAGsE;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;AAElF,MAAM,WAAW,oBAAoB;IACnC;;oCAEgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB;iDAC6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;6BAGyB;IACzB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;;;;;wEAMoE;IACpE,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACtE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAgED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa,CAE7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/render/bundle.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,oEAAoE;AACpE,0EAA0E;AAC1E,8EAA8E;AAC9E,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,8EAA8E;AAC9E,0EAA0E;AAC1E,yEAAyE;AACzE,mDAAmD;
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/render/bund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C,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB,CAAC,IAA0B;IAC5D,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -31,10 +31,19 @@ import type { PrimitiveProps } from "./index";
|
|
|
31
31
|
* capture (`media.mic` / `media.app_audio`) may omit `size` → a zero-area
|
|
32
32
|
* box that never paints. */
|
|
33
33
|
export declare function Capture({ resolved }: PrimitiveProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
export type ResolveCaptureDevice = (deviceRef: string, sourceKind: string) => {
|
|
34
|
+
/** A resolved physical device for a live capture constraint, or `null` when the
|
|
35
|
+
* host could not bind the logical `deviceRef`. */
|
|
36
|
+
export type ResolvedCaptureDevice = {
|
|
38
37
|
deviceId?: string;
|
|
38
|
+
captureSourceId?: string;
|
|
39
39
|
} | null;
|
|
40
|
+
/** Resolver injected by the consuming app (ADR 004 §A1.3). Maps the LOGICAL
|
|
41
|
+
* `deviceRef` to a physical `deviceId`/`captureSourceId` for a live
|
|
42
|
+
* `getUserMedia` constraint. The result NEVER enters the bundle or the content
|
|
43
|
+
* hash. MAY be async: physical ids (e.g. getUserMedia `deviceId`) are salted
|
|
44
|
+
* per origin/partition, so the host often must re-resolve a portable key
|
|
45
|
+
* (label) against THIS context's devices — an inherently asynchronous step
|
|
46
|
+
* (`enumerateDevices`). `acquireStream` awaits it, so the device is bound
|
|
47
|
+
* before acquisition rather than racing a late global mutation. */
|
|
48
|
+
export type ResolveCaptureDevice = (deviceRef: string, sourceKind: string) => ResolvedCaptureDevice | Promise<ResolvedCaptureDevice>;
|
|
40
49
|
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/capture.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA8B6B;AAC7B,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,cAAc,2CA8FnD;AAED
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/capture.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA8B6B;AAC7B,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,cAAc,2CA8FnD;AAED;mDACmD;AACnD,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,IAAI,CAAC;AAET;;;;;;;oEAOoE;AACpE,MAAM,MAAM,oBAAoB,GAAG,CACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,KACf,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -38,9 +38,7 @@ export function Capture({ resolved }) {
|
|
|
38
38
|
const sourceKind = typeof resolved["x-zab.sourceKind"] === "string"
|
|
39
39
|
? resolved["x-zab.sourceKind"]
|
|
40
40
|
: "";
|
|
41
|
-
const deviceRef = typeof resolved["x-zab.deviceRef"] === "string"
|
|
42
|
-
? resolved["x-zab.deviceRef"]
|
|
43
|
-
: "";
|
|
41
|
+
const deviceRef = typeof resolved["x-zab.deviceRef"] === "string" ? resolved["x-zab.deviceRef"] : "";
|
|
44
42
|
// §A1.3 — the host-provided resolver, injected at mount through the runtime
|
|
45
43
|
// context (NOT the bundle, NOT the LSDP wire). Absent when the tree renders
|
|
46
44
|
// outside a host (direct embedding, tooling, tests) → the default-device
|
|
@@ -113,45 +111,79 @@ export function Capture({ resolved }) {
|
|
|
113
111
|
* exists and is callable in the current context. Feature detection only ;
|
|
114
112
|
* CEF/Pulsar on-air and jsdom (without a mock) report non-capable. */
|
|
115
113
|
function isCaptureCapable() {
|
|
116
|
-
return (typeof navigator !== "undefined" &&
|
|
117
|
-
typeof navigator.mediaDevices?.getUserMedia === "function");
|
|
114
|
+
return (typeof navigator !== "undefined" && typeof navigator.mediaDevices?.getUserMedia === "function");
|
|
118
115
|
}
|
|
119
116
|
/** Visual kinds render a `<video>` ; audio kinds stay visually empty. */
|
|
120
117
|
function isVisualKind(sourceKind) {
|
|
121
|
-
return (sourceKind === "media.webcam" ||
|
|
122
|
-
sourceKind === "media.screen" ||
|
|
123
|
-
sourceKind === "media.window");
|
|
118
|
+
return (sourceKind === "media.webcam" || sourceKind === "media.screen" || sourceKind === "media.window");
|
|
124
119
|
}
|
|
125
120
|
/** Acquire a live stream for `sourceKind`, applying a host-resolved `deviceId`
|
|
126
121
|
* when available. Returns `null` for an unsupported/unknown kind (→
|
|
127
122
|
* PLACEHOLDER) ; throws are caught by the caller (→ PLACEHOLDER fallback). */
|
|
128
123
|
async function acquireStream(sourceKind, deviceRef, resolveCaptureDevice) {
|
|
129
124
|
const md = navigator.mediaDevices;
|
|
130
|
-
// §A1.3
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
|
|
125
|
+
// §A1.3 (amended 2026-06-27) — AWAIT the resolver: physical ids are salted
|
|
126
|
+
// per origin/partition, so the host may need an async re-resolution by a
|
|
127
|
+
// portable key (label) in THIS context. Awaiting binds the device before
|
|
128
|
+
// acquisition instead of racing a late global update (the previous sync call
|
|
129
|
+
// let the node acquire with a stale/absent id first).
|
|
130
|
+
const resolved = (await resolveCaptureDevice?.(deviceRef, sourceKind)) ?? null;
|
|
134
131
|
const deviceId = resolved?.deviceId;
|
|
132
|
+
const declaredRef = deviceRef.length > 0;
|
|
135
133
|
switch (sourceKind) {
|
|
136
134
|
case "media.webcam":
|
|
137
|
-
return md.getUserMedia({ video: deviceConstraint(deviceId) });
|
|
138
135
|
case "media.mic":
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
case "media.app_audio": {
|
|
137
|
+
// §A1.3 (amended) — NO default-device fallback for a DECLARED deviceRef
|
|
138
|
+
// that did not resolve to a real device. Acquiring the host default cam
|
|
139
|
+
// here is the silent "automatic allocation" of the WRONG camera the
|
|
140
|
+
// consuming app must never get. → PLACEHOLDER (return null). The bare
|
|
141
|
+
// default constraint stays ONLY when no deviceRef is declared at all.
|
|
142
|
+
if (declaredRef && (typeof deviceId !== "string" || deviceId.length === 0)) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
const channel = sourceKind === "media.webcam" ? "video" : "audio";
|
|
146
|
+
return md.getUserMedia({ [channel]: deviceConstraint(deviceId) });
|
|
147
|
+
}
|
|
142
148
|
case "media.screen":
|
|
143
|
-
case "media.window":
|
|
144
|
-
//
|
|
145
|
-
//
|
|
149
|
+
case "media.window": {
|
|
150
|
+
// DIRECT capture of the picked desktopCapturer surface (no system picker)
|
|
151
|
+
// via Electron's legacy `chromeMediaSource:desktop` + the resolved
|
|
152
|
+
// `captureSourceId`.
|
|
153
|
+
const captureSourceId = resolved?.captureSourceId;
|
|
154
|
+
if (typeof captureSourceId === "string" && captureSourceId.length > 0) {
|
|
155
|
+
return md.getUserMedia({
|
|
156
|
+
video: {
|
|
157
|
+
mandatory: {
|
|
158
|
+
chromeMediaSource: "desktop",
|
|
159
|
+
chromeMediaSourceId: captureSourceId,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// A declared surface ref that didn't resolve → PLACEHOLDER, never a
|
|
165
|
+
// default `getDisplayMedia` picker. The picker stays only when no ref is
|
|
166
|
+
// declared (a bare capture node on a non-Electron host).
|
|
167
|
+
if (declaredRef)
|
|
168
|
+
return null;
|
|
146
169
|
return md.getDisplayMedia({ video: true });
|
|
170
|
+
}
|
|
147
171
|
default:
|
|
148
172
|
return null;
|
|
149
173
|
}
|
|
150
174
|
}
|
|
151
|
-
/** A `getUserMedia` track constraint
|
|
152
|
-
*
|
|
175
|
+
/** A `getUserMedia` track constraint. A resolved deviceId is pinned with
|
|
176
|
+
* `exact`, NOT a bare (ideal) deviceId: an *ideal* constraint SILENTLY falls
|
|
177
|
+
* back to the host default camera when the requested device can't start (e.g.
|
|
178
|
+
* an INACTIVE virtual cam that's enumerated but produces no stream) — the
|
|
179
|
+
* "automatic allocation" of the WRONG camera. `exact` yields the requested
|
|
180
|
+
* device (its placeholder frame if idle), or an OverconstrainedError the
|
|
181
|
+
* caller catches into PLACEHOLDER — never the wrong cam. No deviceId → `true`
|
|
182
|
+
* (host default) applies ONLY when no deviceRef was declared. */
|
|
153
183
|
function deviceConstraint(deviceId) {
|
|
154
|
-
return typeof deviceId === "string" && deviceId.length > 0
|
|
184
|
+
return typeof deviceId === "string" && deviceId.length > 0
|
|
185
|
+
? { deviceId: { exact: deviceId } }
|
|
186
|
+
: true;
|
|
155
187
|
}
|
|
156
188
|
/** Stop every track of a stream (RC11 — release the camera/mic, kill the
|
|
157
189
|
* device light). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../src/render/primitives/capture.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA8B6B;AAC7B,MAAM,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAkB;IAClD,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EA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AO,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QACxD,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;QACnC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED;qBACqB;AACrB,SAAS,UAAU,CAAC,MAAmB;IACrC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,SAAS,EAAE;QAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AACvD,CAAC;AAED;6EAC6E;AAC7E,SAAS,KAAK,CAAC,CAAU,EAAE,QAAgB;IACzC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,GAAG,CAAC,IAAI,CAAC;IACjE,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACpD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAe5D,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;oEACgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,CAAC;IACvD;;;;0EAIsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACjD;;;;;uEAKmE;IACnE,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC,CAcjF,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { Text } from "./text";
|
|
|
8
8
|
import { Image } from "./image";
|
|
9
9
|
import { Shape } from "./shape";
|
|
10
10
|
import { Media } from "./media";
|
|
11
|
+
import { MeetPeer } from "./meet-peer";
|
|
11
12
|
import { Instance } from "./instance";
|
|
12
13
|
import { Capture } from "./capture";
|
|
13
14
|
export const PRIMITIVES = {
|
|
@@ -18,6 +19,9 @@ export const PRIMITIVES = {
|
|
|
18
19
|
image: Image,
|
|
19
20
|
shape: Shape,
|
|
20
21
|
media: Media,
|
|
22
|
+
// ADR 006 §3.3/§3.5 — the unified source kind : every exported source is a
|
|
23
|
+
// `meet.peer` node rendered in `<video srcObject>` from the WebRTC viewer.
|
|
24
|
+
"meet.peer": MeetPeer,
|
|
21
25
|
instance: Instance,
|
|
22
26
|
// RFC-0001 / ADR 004 — Zab vendor capture placeholder (transparent, inert).
|
|
23
27
|
"x-zab.capture": Capture,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/render/primitives/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,uEAAuE;AACvE,0DAA0D;AAK1D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS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AM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,MAAM,CAAC,MAAM,UAAU,GAA+D;IACpF,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,2EAA2E;IAC3E,2EAA2E;IAC3E,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,QAAQ;IAClB,4EAA4E;IAC5E,eAAe,EAAE,OAAO;CACzB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Shared LIVE peer-stream rendering (ADR 006 §3.3/§3.5) — the SINGLE srcObject
|
|
2
|
+
* path used by BOTH the `media` primitive's live mode (#4, keyed on `peerLabel`)
|
|
3
|
+
* AND the generic `meet.peer` source kind (the unified source abstraction).
|
|
4
|
+
* There is no special renderer per source : every live source resolves
|
|
5
|
+
* `peerLabel → MediaStream` through the host viewer and paints it the same way.
|
|
6
|
+
*
|
|
7
|
+
* Resolution : prefer the reactive channel (`subscribePeerStream`, #3) so a node
|
|
8
|
+
* mounted BEFORE its peer connects re-renders on arrival ; fall back to the
|
|
9
|
+
* one-shot `resolvePeerStream` (#4 contract) ; no host resolver → stream-less
|
|
10
|
+
* box. Reading a stream is the ONLY side effect — the scene is never mutated
|
|
11
|
+
* (RC-ReadOnly).
|
|
12
|
+
*
|
|
13
|
+
* Geometry (RC-Geo) : the `<video>` fills `100%`/`100%` of the box the Tree's
|
|
14
|
+
* UniversalWrapper sized from the node's `x/y/width/height`. The geometry lives
|
|
15
|
+
* on the wrapper, NEVER on the video, so it is structurally impossible to force
|
|
16
|
+
* a full-viewport size ; `object-fit` is the scene-authored value.
|
|
17
|
+
*
|
|
18
|
+
* Ownership : the stream is owned by the viewer (#3). This component is a pure
|
|
19
|
+
* consumer — unmounting clears its own `srcObject` and stops NO track (a mirror
|
|
20
|
+
* must never tear a peer down for the on-air composite). */
|
|
21
|
+
export declare function LivePeerVideo({ peerLabel, objectFit, muted, }: {
|
|
22
|
+
peerLabel: string;
|
|
23
|
+
objectFit: string;
|
|
24
|
+
/** Audio playout hint. Always muted for now (broadcast audio is Pulsar-side). */
|
|
25
|
+
muted?: boolean;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=live-peer-video.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-peer-video.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/live-peer-video.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;6DAmB6D;AAC7D,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,SAAS,EACT,KAAY,GACb,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,2CAyDA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useOptionalLumencastRuntime } from "../../overlay/runtime-context";
|
|
4
|
+
/** Shared LIVE peer-stream rendering (ADR 006 §3.3/§3.5) — the SINGLE srcObject
|
|
5
|
+
* path used by BOTH the `media` primitive's live mode (#4, keyed on `peerLabel`)
|
|
6
|
+
* AND the generic `meet.peer` source kind (the unified source abstraction).
|
|
7
|
+
* There is no special renderer per source : every live source resolves
|
|
8
|
+
* `peerLabel → MediaStream` through the host viewer and paints it the same way.
|
|
9
|
+
*
|
|
10
|
+
* Resolution : prefer the reactive channel (`subscribePeerStream`, #3) so a node
|
|
11
|
+
* mounted BEFORE its peer connects re-renders on arrival ; fall back to the
|
|
12
|
+
* one-shot `resolvePeerStream` (#4 contract) ; no host resolver → stream-less
|
|
13
|
+
* box. Reading a stream is the ONLY side effect — the scene is never mutated
|
|
14
|
+
* (RC-ReadOnly).
|
|
15
|
+
*
|
|
16
|
+
* Geometry (RC-Geo) : the `<video>` fills `100%`/`100%` of the box the Tree's
|
|
17
|
+
* UniversalWrapper sized from the node's `x/y/width/height`. The geometry lives
|
|
18
|
+
* on the wrapper, NEVER on the video, so it is structurally impossible to force
|
|
19
|
+
* a full-viewport size ; `object-fit` is the scene-authored value.
|
|
20
|
+
*
|
|
21
|
+
* Ownership : the stream is owned by the viewer (#3). This component is a pure
|
|
22
|
+
* consumer — unmounting clears its own `srcObject` and stops NO track (a mirror
|
|
23
|
+
* must never tear a peer down for the on-air composite). */
|
|
24
|
+
export function LivePeerVideo({ peerLabel, objectFit, muted = true, }) {
|
|
25
|
+
const runtime = useOptionalLumencastRuntime();
|
|
26
|
+
const resolvePeerStream = runtime?.resolvePeerStream;
|
|
27
|
+
const subscribePeerStream = runtime?.subscribePeerStream;
|
|
28
|
+
const videoRef = useRef(null);
|
|
29
|
+
const [stream, setStream] = useState(null);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (subscribePeerStream !== undefined) {
|
|
32
|
+
return subscribePeerStream(peerLabel, setStream);
|
|
33
|
+
}
|
|
34
|
+
if (resolvePeerStream !== undefined) {
|
|
35
|
+
setStream(resolvePeerStream(peerLabel));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setStream(null);
|
|
39
|
+
}, [peerLabel, resolvePeerStream, subscribePeerStream]);
|
|
40
|
+
// `srcObject` is not a serialisable attribute — attach imperatively. Never
|
|
41
|
+
// stop the tracks here (the viewer owns them).
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const el = videoRef.current;
|
|
44
|
+
if (el === null)
|
|
45
|
+
return;
|
|
46
|
+
el.srcObject = stream;
|
|
47
|
+
return () => {
|
|
48
|
+
if (el !== null)
|
|
49
|
+
el.srcObject = null;
|
|
50
|
+
};
|
|
51
|
+
}, [stream]);
|
|
52
|
+
if (stream === null) {
|
|
53
|
+
// Stream-less box of the wrapper geometry — transparent, inert, paints
|
|
54
|
+
// nothing. NOT an error : the peer can connect mid-show.
|
|
55
|
+
return (_jsx("div", { "aria-hidden": true, "data-lumencast-media-live": true, style: { width: "100%", height: "100%", opacity: 0, pointerEvents: "none" } }));
|
|
56
|
+
}
|
|
57
|
+
return (_jsx("video", { ref: videoRef, "data-lumencast-media-live": true, autoPlay: true, muted: muted, playsInline: true, style: {
|
|
58
|
+
width: "100%",
|
|
59
|
+
height: "100%",
|
|
60
|
+
objectFit: objectFit,
|
|
61
|
+
pointerEvents: "none",
|
|
62
|
+
} }));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=live-peer-video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-peer-video.js","sourceRoot":"","sources":["../../../src/render/primitives/live-peer-video.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;6DAmB6D;AAC7D,MAAM,UAAU,aAAa,CAAC,EAC5B,SAAS,EACT,SAAS,EACT,KAAK,GAAG,IAAI,GAMb;IACC,MAAM,OAAO,GAAG,2BAA2B,EAAE,CAAC;IAC9C,MAAM,iBAAiB,GAAG,OAAO,EAAE,iBAAiB,CAAC;IACrD,MAAM,mBAAmB,GAAG,OAAO,EAAE,mBAAmB,CAAC;IAEzD,MAAM,QAAQ,GAAG,MAAM,CAA0B,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC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|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
2
|
+
/** Resolver injected by the consuming app (ADR 006 §3.3, #4). Maps a LOGICAL
|
|
3
|
+
* `peerLabel` (the `meet.peer.peer_label` carried by the scene) to the live
|
|
4
|
+
* `MediaStream` of that peer — supplied by the WebRTC viewer (issue #3). The
|
|
5
|
+
* stream is rendered in `srcObject` ; it NEVER enters the bundle or the content
|
|
6
|
+
* hash. Returns `null` when the peer is not (yet) connected → the node stays a
|
|
7
|
+
* stream-less box, no throw, no diagnostic (a peer can join mid-show). */
|
|
8
|
+
export type ResolvePeerStream = (peerLabel: string) => MediaStream | null;
|
|
9
|
+
/** Reactive variant (ADR 006 #3) : the viewer pushes a peer's stream when it
|
|
10
|
+
* connects and `null` when it leaves. The LIVE primitive prefers this over the
|
|
11
|
+
* one-shot resolver so a node that mounted BEFORE the peer connected re-renders
|
|
12
|
+
* on arrival (a peer joins mid-show). The listener is invoked immediately with
|
|
13
|
+
* the current value, then on every change ; the return value unsubscribes.
|
|
14
|
+
* Like `resolvePeerStream`, it is injected at mount — never the bundle. */
|
|
15
|
+
export type SubscribePeerStream = (peerLabel: string, listener: (stream: MediaStream | null) => void) => () => void;
|
|
16
|
+
/** Embedded video. Two source modes, picked by the node's props :
|
|
17
|
+
*
|
|
18
|
+
* - **BUNDLE** (`src`, the original mode) : a `<video src>` of a bundled /
|
|
19
|
+
* gated URL. Audio muted by default (broadcast audio is Pulsar-side). `src`
|
|
20
|
+
* is the sole network sink and MUST pass `gateSrc` before reaching the
|
|
21
|
+
* `<video>` (Bastion, ADR 003 — an off-allowlist request is an SSRF surface
|
|
22
|
+
* in headless `zabrender`). A rejected host/scheme omits the source.
|
|
23
|
+
*
|
|
24
|
+
* - **LIVE** (`peerLabel`, ADR 006 #4) : the source is a `meet.peer`'s
|
|
25
|
+
* `peer_label`. The runtime resolves the peer's `MediaStream` through a
|
|
26
|
+
* host-provided resolver (`resolvePeerStream`, injected at mount — NOT the
|
|
27
|
+
* bundle, like `resolveCaptureDevice`) and renders it imperatively via
|
|
28
|
+
* `<video>.srcObject` in real time. No URL, no `gateSrc` (a `MediaStream`
|
|
29
|
+
* is not a network sink). An absent resolver or an unconnected peer leaves a
|
|
30
|
+
* stream-less box — no throw, no diagnostic (peers join mid-show).
|
|
31
|
+
*
|
|
32
|
+
* `peerLabel` takes precedence when present (a live node), else `src` (bundle).
|
|
33
|
+
*
|
|
34
|
+
* Geometry is read-only (ADR 006 A1.6) : the node's `x/y/width/height` are
|
|
35
|
+
* applied by the Tree's UniversalWrapper around this primitive ; the `<video>`
|
|
36
|
+
* fills that box (`100%`/`100%`) with the scene-authored `object-fit`. The
|
|
37
|
+
* primitive NEVER forces full-screen and NEVER writes any geometry back — it
|
|
38
|
+
* only reads `resolved`. */
|
|
14
39
|
export declare function Media({ resolved, nodeId }: PrimitiveProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
40
|
//# sourceMappingURL=media.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/media.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/media.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C;;;;;2EAK2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAE1E;;;;;4EAK4E;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAChC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,KAC3C,MAAM,IAAI,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;6BAsB6B;AAC7B,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,cAAc,kDA8BzD"}
|
|
@@ -1,30 +1,56 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { gateSrc, useAllowedHosts } from "../allowed-hosts";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* source.
|
|
3
|
+
import { LivePeerVideo } from "./live-peer-video";
|
|
4
|
+
/** Embedded video. Two source modes, picked by the node's props :
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
6
|
+
* - **BUNDLE** (`src`, the original mode) : a `<video src>` of a bundled /
|
|
7
|
+
* gated URL. Audio muted by default (broadcast audio is Pulsar-side). `src`
|
|
8
|
+
* is the sole network sink and MUST pass `gateSrc` before reaching the
|
|
9
|
+
* `<video>` (Bastion, ADR 003 — an off-allowlist request is an SSRF surface
|
|
10
|
+
* in headless `zabrender`). A rejected host/scheme omits the source.
|
|
11
|
+
*
|
|
12
|
+
* - **LIVE** (`peerLabel`, ADR 006 #4) : the source is a `meet.peer`'s
|
|
13
|
+
* `peer_label`. The runtime resolves the peer's `MediaStream` through a
|
|
14
|
+
* host-provided resolver (`resolvePeerStream`, injected at mount — NOT the
|
|
15
|
+
* bundle, like `resolveCaptureDevice`) and renders it imperatively via
|
|
16
|
+
* `<video>.srcObject` in real time. No URL, no `gateSrc` (a `MediaStream`
|
|
17
|
+
* is not a network sink). An absent resolver or an unconnected peer leaves a
|
|
18
|
+
* stream-less box — no throw, no diagnostic (peers join mid-show).
|
|
19
|
+
*
|
|
20
|
+
* `peerLabel` takes precedence when present (a live node), else `src` (bundle).
|
|
21
|
+
*
|
|
22
|
+
* Geometry is read-only (ADR 006 A1.6) : the node's `x/y/width/height` are
|
|
23
|
+
* applied by the Tree's UniversalWrapper around this primitive ; the `<video>`
|
|
24
|
+
* fills that box (`100%`/`100%`) with the scene-authored `object-fit`. The
|
|
25
|
+
* primitive NEVER forces full-screen and NEVER writes any geometry back — it
|
|
26
|
+
* only reads `resolved`. */
|
|
15
27
|
export function Media({ resolved, nodeId }) {
|
|
16
28
|
const allowedHosts = useAllowedHosts();
|
|
29
|
+
const fit = resolved.fit ?? "cover";
|
|
30
|
+
const peerLabel = typeof resolved.peerLabel === "string" && resolved.peerLabel.length > 0
|
|
31
|
+
? resolved.peerLabel
|
|
32
|
+
: "";
|
|
33
|
+
if (peerLabel !== "") {
|
|
34
|
+
// LIVE mode — the SAME srcObject path as the generic `meet.peer` source.
|
|
35
|
+
return _jsx(LivePeerVideo, { peerLabel: peerLabel, objectFit: fit });
|
|
36
|
+
}
|
|
37
|
+
// BUNDLE mode (unchanged) — gated `<video src>`.
|
|
17
38
|
const src = gateSrc(resolved.src, allowedHosts, "media.src", nodeId);
|
|
18
39
|
if (!src)
|
|
19
40
|
return null;
|
|
20
41
|
const loop = resolved.loop ?? true;
|
|
21
42
|
const mute = resolved.mute ?? true;
|
|
22
43
|
const autoplay = resolved.autoplay ?? true;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
44
|
+
return (_jsx("video", { src: src, autoPlay: autoplay, loop: loop, muted: mute, playsInline: true, style: fillBox(fit) }));
|
|
45
|
+
}
|
|
46
|
+
/** The bundle `<video src>` fills the box the UniversalWrapper sized from the
|
|
47
|
+
* node's `width`/`height` (RC-Geo) ; `object-fit` is the scene-authored `fit`.
|
|
48
|
+
* The geometry lives on the wrapper, never on the video. */
|
|
49
|
+
function fillBox(fit) {
|
|
50
|
+
return {
|
|
51
|
+
width: "100%",
|
|
52
|
+
height: "100%",
|
|
53
|
+
objectFit: fit,
|
|
54
|
+
};
|
|
29
55
|
}
|
|
30
56
|
//# sourceMappingURL=media.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/render/primitives/media.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/render/primitives/media.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAqBlD;;;;;;;;;;;;;;;;;;;;;;6BAsB6B;AAC7B,MAAM,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAkB;IACxD,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,GAAG,GAAI,QAAQ,CAAC,GAA0B,IAAI,OAAO,CAAC;IAC5D,MAAM,SAAS,GACb,OAAO,QAAQ,CAAC,SAAS,KAAK,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;QACrE,CAAC,CAAC,QAAQ,CAAC,SAAS;QACpB,CAAC,CAAC,EAAE,CAAC;IAET,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;QACrB,yEAAyE;QACzE,OAAO,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,GAAI,CAAC;IACjE,CAAC;IAED,iDAAiD;IACjD,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACrE,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,IAAI,GAAI,QAAQ,CAAC,IAA4B,IAAI,IAAI,CAAC;IAC5D,MAAM,IAAI,GAAI,QAAQ,CAAC,IAA4B,IAAI,IAAI,CAAC;IAC5D,MAAM,QAAQ,GAAI,QAAQ,CAAC,QAAgC,IAAI,IAAI,CAAC;IAEpE,OAAO,CACL,gBACE,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,EACX,WAAW,QACX,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,GACnB,CACH,CAAC;AACJ,CAAC;AAED;;6DAE6D;AAC7D,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO;QACL,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,GAAuC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PrimitiveProps } from "./index";
|
|
2
|
+
/** `meet.peer` — the UNIFIED source primitive (ADR 006 §3.3/§3.5). Every source
|
|
3
|
+
* that crosses the Prism export (cam, screen, game_capture, …) arrives as a
|
|
4
|
+
* single `meet.peer` LSML node ; this is the ONE renderer for all of them — not
|
|
5
|
+
* a special-case path. It generalises the `media` primitive's live mode (#4) to
|
|
6
|
+
* the source abstraction : read `peer_label`, resolve the peer's `MediaStream`
|
|
7
|
+
* through the host viewer (#3), and paint it in `<video srcObject>` constrained
|
|
8
|
+
* to the node's box.
|
|
9
|
+
*
|
|
10
|
+
* Contract (rendered verbatim, ADR §3.3 — no variation) :
|
|
11
|
+
* - `peer_label` (string) — the STREAM REFERENCE. Resolved `peer_label →
|
|
12
|
+
* MediaStream` via `subscribePeerStream`/`resolvePeerStream`. Empty / missing
|
|
13
|
+
* → a transparent inert box (the source is not addressable).
|
|
14
|
+
* - `x-zab.sourceKind` (string) — ADVISORY only. Rendering is UNIFORM whatever
|
|
15
|
+
* the kind ; at most it could hint audio-only, but Phase 0 paints every
|
|
16
|
+
* visual source identically.
|
|
17
|
+
* - `object_fit` ("cover"|"contain"|"fill") — how the video fills the box.
|
|
18
|
+
* - `muted` (bool, optional) — audio playout hint (default muted ; broadcast
|
|
19
|
+
* audio is Pulsar-side).
|
|
20
|
+
* - `position{x,y}` + `size{w,h}` — geometry via the Tree's UniversalWrapper
|
|
21
|
+
* (compiler-flattened to `x/y/width/height`). Z-ORDER = sibling order (cam
|
|
22
|
+
* over game = two ordered `meet.peer` nodes — no special z handling here).
|
|
23
|
+
* - `metadata.figma` — advisory (editor round-trip), never read for rendering.
|
|
24
|
+
*
|
|
25
|
+
* RC-Geo : the `<video>` fills `100%`/`100%` of the wrapper box at the exact
|
|
26
|
+
* authored geometry / `object_fit` — never forced full-screen (the geometry is
|
|
27
|
+
* on the wrapper, not the video). RC-ReadOnly : the primitive only READS
|
|
28
|
+
* `resolved` ; it never writes geometry or any field back to the scene. An
|
|
29
|
+
* unconnected peer → transparent inert box, no throw, no diagnostic. */
|
|
30
|
+
export declare function MeetPeer({ resolved }: PrimitiveProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=meet-peer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meet-peer.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/meet-peer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;yEA2ByE;AACzE,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,cAAc,2CAyBpD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LivePeerVideo } from "./live-peer-video";
|
|
3
|
+
/** `meet.peer` — the UNIFIED source primitive (ADR 006 §3.3/§3.5). Every source
|
|
4
|
+
* that crosses the Prism export (cam, screen, game_capture, …) arrives as a
|
|
5
|
+
* single `meet.peer` LSML node ; this is the ONE renderer for all of them — not
|
|
6
|
+
* a special-case path. It generalises the `media` primitive's live mode (#4) to
|
|
7
|
+
* the source abstraction : read `peer_label`, resolve the peer's `MediaStream`
|
|
8
|
+
* through the host viewer (#3), and paint it in `<video srcObject>` constrained
|
|
9
|
+
* to the node's box.
|
|
10
|
+
*
|
|
11
|
+
* Contract (rendered verbatim, ADR §3.3 — no variation) :
|
|
12
|
+
* - `peer_label` (string) — the STREAM REFERENCE. Resolved `peer_label →
|
|
13
|
+
* MediaStream` via `subscribePeerStream`/`resolvePeerStream`. Empty / missing
|
|
14
|
+
* → a transparent inert box (the source is not addressable).
|
|
15
|
+
* - `x-zab.sourceKind` (string) — ADVISORY only. Rendering is UNIFORM whatever
|
|
16
|
+
* the kind ; at most it could hint audio-only, but Phase 0 paints every
|
|
17
|
+
* visual source identically.
|
|
18
|
+
* - `object_fit` ("cover"|"contain"|"fill") — how the video fills the box.
|
|
19
|
+
* - `muted` (bool, optional) — audio playout hint (default muted ; broadcast
|
|
20
|
+
* audio is Pulsar-side).
|
|
21
|
+
* - `position{x,y}` + `size{w,h}` — geometry via the Tree's UniversalWrapper
|
|
22
|
+
* (compiler-flattened to `x/y/width/height`). Z-ORDER = sibling order (cam
|
|
23
|
+
* over game = two ordered `meet.peer` nodes — no special z handling here).
|
|
24
|
+
* - `metadata.figma` — advisory (editor round-trip), never read for rendering.
|
|
25
|
+
*
|
|
26
|
+
* RC-Geo : the `<video>` fills `100%`/`100%` of the wrapper box at the exact
|
|
27
|
+
* authored geometry / `object_fit` — never forced full-screen (the geometry is
|
|
28
|
+
* on the wrapper, not the video). RC-ReadOnly : the primitive only READS
|
|
29
|
+
* `resolved` ; it never writes geometry or any field back to the scene. An
|
|
30
|
+
* unconnected peer → transparent inert box, no throw, no diagnostic. */
|
|
31
|
+
export function MeetPeer({ resolved }) {
|
|
32
|
+
const peerLabel = typeof resolved.peer_label === "string" && resolved.peer_label.length > 0
|
|
33
|
+
? resolved.peer_label
|
|
34
|
+
: "";
|
|
35
|
+
// Empty / missing label → not addressable yet : a transparent inert box of the
|
|
36
|
+
// wrapper geometry, exactly like an unconnected peer (no throw, no diagnostic).
|
|
37
|
+
if (peerLabel === "") {
|
|
38
|
+
return (_jsx("div", { "aria-hidden": true, "data-lumencast-meet-peer": true, style: { width: "100%", height: "100%", opacity: 0, pointerEvents: "none" } }));
|
|
39
|
+
}
|
|
40
|
+
const objectFit = typeof resolved.object_fit === "string" && resolved.object_fit.length > 0
|
|
41
|
+
? resolved.object_fit
|
|
42
|
+
: "cover";
|
|
43
|
+
const muted = resolved.muted === undefined ? true : resolved.muted !== false;
|
|
44
|
+
return _jsx(LivePeerVideo, { peerLabel: peerLabel, objectFit: objectFit, muted: muted });
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=meet-peer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meet-peer.js","sourceRoot":"","sources":["../../../src/render/primitives/meet-peer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;yEA2ByE;AACzE,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAkB;IACnD,MAAM,SAAS,GACb,OAAO,QAAQ,CAAC,UAAU,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QACvE,CAAC,CAAC,QAAQ,CAAC,UAAU;QACrB,CAAC,CAAC,EAAE,CAAC;IAET,+EAA+E;IAC/E,gFAAgF;IAChF,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,CACL,qEAGE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,GAC3E,CACH,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GACb,OAAO,QAAQ,CAAC,UAAU,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QACvE,CAAC,CAAC,QAAQ,CAAC,UAAU;QACrB,CAAC,CAAC,OAAO,CAAC;IACd,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,KAAK,KAAK,CAAC;IAE7E,OAAO,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;AACrF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-allowlist.d.ts","sourceRoot":"","sources":["../../src/render/prop-allowlist.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAkCvD,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"prop-allowlist.d.ts","sourceRoot":"","sources":["../../src/render/prop-allowlist.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAkCvD,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAgFtF,CAAC;AAgBF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAgBrD"}
|