Skip to content

feat(layout): hide presentation according to layout.xml new events - #331

Merged
antobinary merged 3 commits into
developfrom
hide-presentation
May 5, 2026
Merged

antobinary merged 3 commits into
developfrom
hide-presentation

Conversation

@germanocaumo

Copy link
Copy Markdown
Contributor

This adds support to the new event saying when the presenter minimized the presentation (added in bigbluebutton/bigbluebutton#23924). When found it:

  • Hides presentation (and thumbnails) completely
  • Make the webcams occupy the main area
  • Expands chat/notes to full left side (like it is when single content)
Playback.mp4

This PR should be merged and tagged togeter with bigbluebutton/bigbluebutton#23924 so they are kept in sync and don't generate artificacts of screenshare as content in thumbnails.

This adds support to the new event saying when the presenter minimized the presentation. When found it:
- Hides presentation (and thumbnails) completely
- Make the webcams occupy the main area
- Expands chat/notes to full left side (like it is when single content)
…entation

Fixes some bugs mainly when seeking into/out minimized presentation.
fixes duplicated presentation/screenshare thumbnails in some cases
@antobinary
antobinary merged commit 5796b81 into develop May 5, 2026
3 checks passed
germanocaumo added a commit to germanocaumo/bbb-playback that referenced this pull request Jul 29, 2026
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
germanocaumo added a commit to germanocaumo/bbb-playback that referenced this pull request Jul 29, 2026
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
antobinary pushed a commit that referenced this pull request Aug 5, 2026
…#366)

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.

#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 #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 #363
antobinary pushed a commit that referenced this pull request Oct 20, 2026
Since #331 the content area unmounts while layout.xml minimizes the
presentation, disposing the screenshare player with it. Showing it back
mounts a new video.js player paused at 0, and no webcams event follows to
bring it in line: the screenshare stays paused on its first, black, frame
for the whole share, and a share seeked into before the screenshare has
ever mounted plays from 0 instead of from the seeked time. A tab switch
seeks it through the visibilitychange handler but never resumes it, which
on a static shared screen passes for a fix.

Keep the content area mounted and hide it with display: none, as is
already done for the screenshare itself, so the players are created once
and stay synchronized. This also avoids re-creating the whiteboard and
reloading the slides each time the presentation is shown back.
antobinary pushed a commit that referenced this pull request Oct 20, 2026
Since #331 the content area unmounts while layout.xml minimizes the
presentation, disposing the screenshare player with it. Showing it back
mounts a new video.js player paused at 0, and no webcams event follows to
bring it in line: the screenshare stays paused on its first, black, frame
for the whole share, and a share seeked into before the screenshare has
ever mounted plays from 0 instead of from the seeked time. A tab switch
seeks it through the visibilitychange handler but never resumes it, which
on a static shared screen passes for a fix.

Keep the content area mounted and hide it with display: none, as is
already done for the screenshare itself, so the players are created once
and stay synchronized. This also avoids re-creating the whiteboard and
reloading the slides each time the presentation is shown back.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants