Repository navigation
fix(layout): show screenshare in recordings without layout.xml events - #366
Merged
antobinary merged 1 commit intoAug 5, 2026
Merged
Conversation
A recording whose layout.xml carries no show_screenshare event at or before a screenshare plays back with a blank content area for the whole duration of that screenshare: the screenshare layer stays display: none while the presentation renders the transparent presentation/deskshare.png placeholder. layout.xml was introduced by process_swap_events in BBB 3.0.2, so recordings processed by anything earlier — every 2.x recording, plus 3.0.0 and 3.0.1 — have no such file, and every screenshare in them is affected. From 3.0.2 on, starting a screenshare records a SetScreenshareAsContentEvent by itself: screenshareAsContent starts out false and the first share flips it to true, so no quick swap is needed. Those recordings carry an event at or before the screenshare and are unaffected. The event and the file arrived in the same commit, so 3.0.2 is an exact boundary. 3.0.27 later replaced process_swap_events with get_layout_events, which seeds a complete layout state at timestamp 0. bigbluebutton#331 replaced isShowScreenshareAsContent with getLayoutEvent and dropped its `if (isEmpty(data)) return true` fallback, so a missing event now resolves to showScreenshare: false instead of falling back to the screenshare state. validators.js: - Add getLayoutSwap, resolving showPresentation and showScreenshare from the most recent event carrying each property. When a property has no event, fall back to the behaviour these recordings were played back with: the presentation is visible and the screenshare is the content while it is being shared - Forward the property argument of getMostRecentEvent through getLayoutEvent. It has been accepted but unused since bigbluebutton#331; each layout property changes independently, and pre-3.0.27 files carry show_screenshare only, so reading both from a single most recent event would let an event that only changes the presentation reset the screenshare state - Use Object.hasOwn rather than hasProperty in that filter. A missing property is the expected case here, and hasProperty logs a warning on every miss, which would be emitted at the time update rate hooks/index.js: - Derive the initial state of useCurrentContent and useLayoutSwap from timestamp 0. This is hardening, not part of the fix above: the first render otherwise reports the presentation as the content even for a recording that starts on a screenshare, and only corrects itself on the first time update. Verified that it is not the cause of the blank layer — video.js recovers when its container is unhidden, which is why <Screenshare> is kept mounted under display: none rather than conditionally rendered Fixes bigbluebutton#363
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #363.
Problem
Recordings whose
layout.xmlhas noshow_screenshareevent play back with a blank content area for the whole duration of every screenshare — the layer staysdisplay: nonewhile the presentation renders the transparentpresentation/deskshare.pngplaceholder.That means recordings processed before BBB 3.0.2, when
process_swap_eventsstarted writinglayout.xml: all 2.x recordings, plus 3.0.0 and 3.0.1. From 3.0.2 on the file is always populated — starting a screenshare records aSetScreenshareAsContentEventby itself — so newer recordings are fine. The boundary is 3.0.2, not 3.0.27 as the issue title suggests.Cause
#331 replaced
isShowScreenshareAsContentwithgetLayoutEventand dropped its fallback:A missing event now resolves to
showScreenshare: false.Fix
New
getLayoutSwapresolvesshowPresentationandshowScreensharefrom the most recent event carrying each property, falling back when there is none: presentation visible, screenshare shown while it is being shared — the same defaultcreate_layout_edluses for old recordings.Both hooks also derive their initial state from timestamp 0. That part is hardening, not the fix.
Note
@GhaziTriki's #365 fixes the same thing with an equivalent fallback; this adds unit tests and per-property resolution. Happy to fold it in either direction.