From d1c4e5bbe67999756ee8b3dbd686d5ada0e73c5f Mon Sep 17 00:00:00 2001 From: shermerL Date: Thu, 5 Nov 2026 19:36:06 +0000 Subject: [PATCH 01/36] fix(publish): wait for video dimensions before showing previews (#7926) --- js/publish/src/element.ts | 11 +- quest/m2/README.md | 2 - quest/m2/publish-empty-previews.md | 30 --- quest/m2/publish-video-loading.md | 55 ----- test/interop/clients/js/publish-ui.browser.ts | 200 ++++++++++++++++++ 5 files changed, 210 insertions(+), 88 deletions(-) delete mode 100644 quest/m2/publish-empty-previews.md delete mode 100644 quest/m2/publish-video-loading.md diff --git a/js/publish/src/element.ts b/js/publish/src/element.ts index 98f97576abd..b45048cf90f 100644 --- a/js/publish/src/element.ts +++ b/js/publish/src/element.ts @@ -392,8 +392,17 @@ export default class MoqPublish extends HTMLElement { return; } + // Keep the pre-metadata placeholder out of the UI's retained aspect ratio. + let ready = false; + const resize = () => { + if (ready || preview.videoWidth === 0) return; + // Later media resizes must preserve the page's display choice. + ready = true; + preview.style.display = "block"; + }; + effect.event(preview, "loadedmetadata", resize); + effect.event(preview, "resize", resize); preview.srcObject = new MediaStream([Video.normalizeSource(source).track]); - preview.style.display = "block"; effect.cleanup(() => { preview.srcObject = null; diff --git a/quest/m2/README.md b/quest/m2/README.md index 84e83de8cb9..cbfbba7a9ec 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -278,8 +278,6 @@ lite-07; bitrate enforcement is not part of this release. - [Open-GOP MPEG-2 export trims leading B-pictures in zero-stuffed CBR streams](/quest/m2/pes-hold-open-gop.md) - A TS export starting or resuming inside an open GOP of MPEG-2 video drops the orphaned leading B-pictures even when their PES ends on zero stuffing, as CBR encoders emit, without ever trimming part of a reference picture whose start code straddles two PES packets - [A multi-program TS import survives a source switch](/quest/m2/ts-multi-program-restart.md) - `--program all` restarts each affected program on an unannounced source switch, as a single-program import does after moq-dev/moq#7780, instead of ending the whole import - [The lite publisher tells transport faults from cancels](/quest/m2/publish-cancel-classify.md) - `rs/moq-net`'s lite publisher no longer counts every `Error::Transport` as a clean cancel -- [moq-publish hides previews that show nothing](/quest/m2/publish-empty-previews.md) - `` hides a preview that renders nothing -- [A loading video preview takes no space](/quest/m2/publish-video-loading.md) - a `