From 3c709493c21b63c6be248c5221c1f937dde64c98 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 29 Oct 2026 08:51:31 -0700 Subject: [PATCH 1/5] chore(quest): claim quest/m1/publish-controls.md Quest-Claim: ceff89d0ca276544 From f2b22f4af046b7ca843c79040b9a49736d5badf1 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 29 Oct 2026 09:02:39 -0700 Subject: [PATCH 2/5] fix(publish): size controls from rendered preview content Co-Authored-By: GPT-6.1 Sol --- js/publish/src/ui/element.ts | 24 ++---- quest/m1/publish-controls.md | 25 ++++-- test/interop/clients/js/publish-ui.browser.ts | 83 +++++++++++++++++++ 3 files changed, 107 insertions(+), 25 deletions(-) diff --git a/js/publish/src/ui/element.ts b/js/publish/src/ui/element.ts index 14a550ef879..e4132cb424c 100644 --- a/js/publish/src/ui/element.ts +++ b/js/publish/src/ui/element.ts @@ -100,30 +100,22 @@ export default class MoqPublishUi extends HTMLElement { player.append(scrimTop, center(effect, publish), chrome, panel); DOM.render(effect, this.#root, player); - // Keep the player box from jumping when video toggles off: reserve the - // last live preview's aspect ratio (defaults to 16:9) instead of snapping. + // Capture can be live without a preview. Reserve the last rendered aspect + // ratio whenever the slotted content has no height, including hidden previews. let lastAspect = 16 / 9; - effect.run((e) => { - const capture = e.get(publish.video.in.capture); - const src = capture ? e.get(capture.in.source) : undefined; - if (src) { + const resize = new ResizeObserver(([entry]) => { + const { width, height } = entry.contentRect; + if (width > 0 && height > 0) { + lastAspect = width / height; player.classList.remove("player--empty"); player.style.aspectRatio = ""; - const video = this.querySelector("video") as HTMLVideoElement | null; - if (video) { - const measure = () => { - if (video.videoWidth > 0 && video.videoHeight > 0) - lastAspect = video.videoWidth / video.videoHeight; - }; - measure(); - e.event(video, "loadedmetadata", measure); - e.event(video, "resize", measure); - } } else { player.style.aspectRatio = String(lastAspect); player.classList.add("player--empty"); } }); + resize.observe(publish); + effect.cleanup(() => resize.disconnect()); this.#wireChrome(effect, publish, state, player); } diff --git a/quest/m1/publish-controls.md b/quest/m1/publish-controls.md index d395e66373d..b63fb10b9de 100644 --- a/quest/m1/publish-controls.md +++ b/quest/m1/publish-controls.md @@ -7,16 +7,23 @@ shows no `