Repository navigation
fix(recording): add presentation minimized events + screenshare as content fixes - #23924
Conversation
WalkthroughA new generic helper Sequence Diagram(s)sequenceDiagram
autonumber
participant Publisher as presentation.rb
participant EventsGen as events.rb:get_events
participant RecStream as /recording/event stream
participant Emitter as Event Emitter
Note over EventsGen,RecStream: Time-anchored, window-bounded extraction (generic)
Publisher->>EventsGen: request events (events, start_time, end_time, target, eventname)
RecStream->>EventsGen: iterate recording events (RecordStatusEvent, LayoutBroadcastedEvent, SetScreenshareAsContentEvent, ...)
EventsGen->>EventsGen: compute initial timestamp, normalize times, handle pause/resume offsets
EventsGen->>EventsGen: filter, dedupe (compare_keys), anchor to offset, constrain to [start,end]
EventsGen-->>Publisher: return filtered, time-normalized events
Publisher->>Publisher: merge layout + screenshare events, sort, build unified attributes
Publisher->>Emitter: emit layout_swap events with timestamp (ms→s) and show_* flags
sequenceDiagram
autonumber
participant Process as process_layout_events
participant Stream as Event Stream
participant State as Slide/Deskshare State
Note over Process,Stream: Per-event handling of screenshare/presentation state
Stream->>Process: SetScreenshareAsContentEvent (screenshareAsContent)
alt include_deskshare = false
Process->>State: disable deskshare
Process->>State: mark slide changed
else include_deskhare = true
Process->>State: enable deskshare with screenshareAsContent
Process->>State: mark slide changed
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
record-and-playback/core/lib/recordandplayback/generators/events.rb (3)
412-437: Annotate start events with source to enable correct pairing.Mark SetScreenshareAsContentEvent-derived starts as
:contentand real starts as:streamso the matcher can avoid cross-pairing.- events.xpath('/recording/event[@module="Deskshare" or (@module="bbb-webrtc-sfu" and @eventname="StartWebRTCDesktopShareEvent") or @eventname="SetScreenshareAsContentEvent"]').each do |start_event| + events.xpath('/recording/event[@module="Deskshare" or (@module="bbb-webrtc-sfu" and @eventname="StartWebRTCDesktopShareEvent") or @eventname="SetScreenshareAsContentEvent"]').each do |start_event| + source = :stream case start_event['eventname'] when 'DeskshareStartedEvent' filename = start_event.at_xpath('file').text filename = File.basename(filename) when 'StartWebRTCDesktopShareEvent' uri = start_event.at_xpath('filename').text filename = File.basename(uri) when 'SetScreenshareAsContentEvent' screenshare_as_content = start_event.at_xpath('screenshareAsContent')&.text == "true" if screenshare_as_content && !active_deskshare_video.nil? filename = active_deskshare_video + source = :content else next end else next end start_events << { start_timestamp: start_event['timestamp'].to_i, - stream: filename + stream: filename, + source: source, } active_deskshare_video = filenameAlso applies to: 421-428
444-466: Track classic Deskshare starts and tag stop events with source.Without capturing DeskshareStartedEvent here, SetScreenshareAsContentEvent with false won't emit a stop for legacy deskshare. Also tag stop events with
:source.- events.xpath('/recording/event[@module="Deskshare" or (@module="bbb-webrtc-sfu" and (@eventname="StopWebRTCDesktopShareEvent" or @eventname="StartWebRTCDesktopShareEvent")) or @eventname="SetScreenshareAsContentEvent"]').each do |event| + events.xpath('/recording/event[@module="Deskshare" or (@module="bbb-webrtc-sfu" and (@eventname="StopWebRTCDesktopShareEvent" or @eventname="StartWebRTCDesktopShareEvent")) or @eventname="SetScreenshareAsContentEvent"]').each do |event| + source = :stream case event['eventname'] + when 'DeskshareStartedEvent' + filename = event.at_xpath('file').text + filename = File.basename(filename) + active_deskshare_video = filename + next when 'DeskshareStoppedEvent' filename = event.at_xpath('file').text filename = File.basename(filename) when 'StopWebRTCDesktopShareEvent' uri = event.at_xpath('filename').text filename = File.basename(uri) # just used to get the filename to be set when ScreenshareAsContentEvent is used when 'StartWebRTCDesktopShareEvent' uri = event.at_xpath('filename').text filename = File.basename(uri) active_deskshare_video = filename next when 'SetScreenshareAsContentEvent' screenshare_as_content = event.at_xpath('screenshareAsContent')&.text == "true" if !screenshare_as_content && !active_deskshare_video.nil? filename = active_deskshare_video + source = :content else next end else next end stop_events << { - stop_timestamp: event['timestamp'].to_i, - stream: filename + stop_timestamp: event['timestamp'].to_i, + stream: filename, + source: source, }Also applies to: 471-474
524-541: Guard clause/readability nit for SetScreenshareAsContentEvent handling.Minor: use guard clauses to reduce nesting.
- when 'SetScreenshareAsContentEvent' - screenshare_as_content = event.at_xpath('screenshareAsContent')&.text == "true" - if screenshare_as_content && !active_deskshare_video.nil? + when 'SetScreenshareAsContentEvent' + screenshare_as_content = event.at_xpath('screenshareAsContent')&.text == "true" + next unless (!active_deskshare_video.nil?) # nothing to render without an active file + if screenshare_as_content video_start_timestamp = videos[active_deskshare_video][:timestamp] deskshare_edl << { :timestamp => timestamp, :areas => { :deskshare => [ { :filename => active_deskshare_video, :timestamp => timestamp - video_start_timestamp } ] } } elsif !screenshare_as_content deskshare_edl << { :timestamp => timestamp, :areas => { :deskshare => [] } } endrecord-and-playback/presentation/scripts/publish/presentation.rb (2)
960-970: Emit pan/zoom events on quick swap to keep viewBox/cursor consistent.When deskshare toggles via SetScreenshareAsContentEvent, panzooms.xml and cursor events won’t update unless panzoom_changed is true. Set it to ensure correct viewBox and cursor mapping at swap boundaries.
when 'SetScreenshareAsContentEvent' if @presentation_props['include_deskshare'] screenshareAsContent = event.at_xpath('screenshareAsContent')&.text == "true" if !screenshareAsContent deskshare = false - slide_changed = true + slide_changed = true + panzoom_changed = true else - deskshare = slide_changed = true + deskshare = true + slide_changed = true + panzoom_changed = true end end
951-959: Also mark pan/zoom changed on deskshare start/stop.Symmetry with quick swap: ensure viewBox updates when screenshare starts/stops without quick swap.
when 'DeskshareStartedEvent', 'StartWebRTCDesktopShareEvent' - deskshare = slide_changed = true if @presentation_props['include_deskshare'] + if @presentation_props['include_deskshare'] + deskshare = true + slide_changed = true + panzoom_changed = true + end when 'DeskshareStoppedEvent', 'StopWebRTCDesktopShareEvent' if @presentation_props['include_deskshare'] deskshare = false slide_changed = true + panzoom_changed = true end
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb(9 hunks)record-and-playback/presentation/scripts/publish/presentation.rb(1 hunks)
🧰 Additional context used
🪛 RuboCop (1.76.1)
record-and-playback/presentation/scripts/publish/presentation.rb
[convention] 962-962: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
record-and-playback/core/lib/recordandplayback/generators/events.rb
[convention] 413-413: Line is too long. [202/128]
(Layout/LineLength)
[convention] 422-422: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 423-423: Use a guard clause (next unless screenshare_as_content && !active_deskshare_video.nil?) instead of wrapping the code inside a conditional expression.
(Style/GuardClause)
[convention] 438-438: Space between { and | missing.
(Layout/SpaceInsideBlockBraces)
[convention] 438-438: Space missing inside }.
(Layout/SpaceInsideBlockBraces)
[convention] 442-442: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 445-445: Line is too long. [242/128]
(Layout/LineLength)
[convention] 460-460: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 461-461: Use a guard clause (next unless !screenshare_as_content && !active_deskshare_video.nil?) instead of wrapping the code inside a conditional expression.
(Style/GuardClause)
[convention] 489-489: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 490-490: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 490-490: Put a comma after the last item of a multiline hash.
(Style/TrailingCommaInHashLiteral)
[convention] 490-490: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 493-493: Line is too long. [244/128]
(Layout/LineLength)
[convention] 513-513: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 524-524: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 528-528: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 529-529: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 530-530: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 531-531: Put a comma after the last item of a multiline array.
(Style/TrailingCommaInArrayLiteral)
[convention] 531-531: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 531-531: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 532-532: Put a comma after the last item of a multiline hash.
(Style/TrailingCommaInHashLiteral)
[convention] 533-533: Put a comma after the last item of a multiline hash.
(Style/TrailingCommaInHashLiteral)
[convention] 537-537: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 538-538: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 538-538: Put a comma after the last item of a multiline hash.
(Style/TrailingCommaInHashLiteral)
[convention] 538-538: Use the new Ruby 1.9 hash syntax.
(Style/HashSyntax)
[convention] 1073-1073: Line is too long. [149/128]
(Layout/LineLength)
[convention] 1102-1102: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1104-1104: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1107-1107: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-package (bbb-playback-record)
🔇 Additional comments (1)
record-and-playback/core/lib/recordandplayback/generators/events.rb (1)
1073-1073: Confirm presentation-usage semantics for quick swap.Returning true on “screenshare unset as content” treats non-content periods as presentation usage. Verify this aligns with analytics/UI expectations and doesn’t regress recordings where no whiteboard/presentation activity occurred.
Also applies to: 1101-1108
| stop = stop_events.find do |s| | ||
| s[:stream] == start[:stream] && s[:stop_timestamp] >= start[:start_timestamp] | ||
| end | ||
| if stop | ||
| start[:stop_timestamp] = stop[:stop_timestamp] | ||
| stop_events.delete(stop) | ||
| else |
There was a problem hiding this comment.
Avoid overlapping deskshare intervals: match content-to-content first.
Current matching pairs the earliest stop ≥ start for the same stream, which can overlap intervals when SetScreenshareAsContentEvent toggles exist (e.g., Start → Content ON → Content OFF → Stop). Prefer pairing start/stop by source (content vs. stream) first, then fall back to any stop if none exists.
Apply this diff to prefer same-source matching:
- start_events.each do |start|
- stop = stop_events.find do |s|
- s[:stream] == start[:stream] && s[:stop_timestamp] >= start[:start_timestamp]
- end
+ start_events.each do |start|
+ # Prefer a stop from the same source (e.g., content-toggle to content-toggle)
+ stop = stop_events.find do |s|
+ s[:stream] == start[:stream] &&
+ s[:stop_timestamp] >= start[:start_timestamp] &&
+ s[:source] == start[:source]
+ end
+ # Fallback: any stop that is ≥ start for the same stream
+ stop ||= stop_events.find do |s|
+ s[:stream] == start[:stream] && s[:stop_timestamp] >= start[:start_timestamp]
+ end📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| stop = stop_events.find do |s| | |
| s[:stream] == start[:stream] && s[:stop_timestamp] >= start[:start_timestamp] | |
| end | |
| if stop | |
| start[:stop_timestamp] = stop[:stop_timestamp] | |
| stop_events.delete(stop) | |
| else | |
| start_events.each do |start| | |
| # Prefer a stop from the same source (e.g., content-toggle to content-toggle) | |
| stop = stop_events.find do |s| | |
| s[:stream] == start[:stream] && | |
| s[:stop_timestamp] >= start[:start_timestamp] && | |
| s[:source] == start[:source] | |
| end | |
| # Fallback: any stop that is ≥ start for the same stream | |
| stop ||= stop_events.find do |s| | |
| s[:stream] == start[:stream] && s[:stop_timestamp] >= start[:start_timestamp] | |
| end | |
| if stop | |
| start[:stop_timestamp] = stop[:stop_timestamp] | |
| stop_events.delete(stop) | |
| else |
🤖 Prompt for AI Agents
In record-and-playback/core/lib/recordandplayback/generators/events.rb around
lines 396 to 402, the current logic matches a start to the first stop with the
same stream and stop_timestamp >= start_timestamp which can create overlapping
deskshare intervals when SetScreenshareAsContentEvent toggles change the source;
update the matching to first try finding a stop with the same stream AND the
same source/type (i.e., content vs. non-content) with stop_timestamp >=
start_timestamp, and only if that fails fall back to finding any stop for the
same stream with stop_timestamp >= start_timestamp; when a stop is chosen, set
start[:stop_timestamp] = stop[:stop_timestamp] and delete the stop from
stop_events as before.
|
Thank you! |
There was a problem hiding this comment.
I think this is implemented at the wrong level in the code, and this is going to cause problems for the dynamic layout work that I'm designing for the video format right now.
The important thing is that the EDL data structures are intended to represent the times when a video is being shared vs. when it is not being shared. The placement of those areas within the video is decided separately.
Keep in mind that the "SetScreenshareAsContentEvent" is actually supposed to swap the positions of the presentation area and screenshare, and in some layouts both areas might be shown at the same time. So the deskshare video must still be added to the EDL regardless of whether the screenshare as content flag is set or not.
At this point I'm not totally sure about how to actually represent this data. I was planning to proceed with having the swap events tracked separately (i.e. in the format generated by the get_screenshare_as_content_events) and then using that in the video renderer to select between one of two different layouts.
|
FWIW, I do not believe that this magnitude of change is suitable for inclusion in 3.0. An acceptable change would be fixing the |
|
@kepstin Hmm ok I see, didn't think about this dynamic layout possibility. |
|
Yes - I'm hopeful to have something ready on the video renderer fairly soon, although I will be submitting that change only for 3.1 (it depends on some changes made in #23887 ) |
2f23acd to
2cbd9b1
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
record-and-playback/core/lib/recordandplayback/generators/events.rb (1)
1175-1182: Nil-safe chain bug:&.used only ontext, not onto_i
event.at_xpath('timestampUTC')&.text.to_iwill callto_ion nil when the node is absent, raising NoMethodError. Chain the safe nav throughto_i(or provide a fallback).Apply this diff:
screenshare_content_events << { timestamp: event['timestamp'].to_i, - timestampUTC: event.at_xpath('timestampUTC')&.text.to_i, + timestampUTC: event.at_xpath('timestampUTC')&.text&.to_i, date: event.at_xpath('date')&.text, screenshareAsContent: event.at_xpath('screenshareAsContent')&.text == "true" }
🧹 Nitpick comments (1)
record-and-playback/presentation/scripts/publish/presentation.rb (1)
960-970: Handle SetScreenshareAsContentEvent: OK, but align string style with RuboCopLogic matches existing deskshare toggles. RuboCop prefers single quotes where interpolation isn’t needed.
Apply this diff:
- if @presentation_props['include_deskshare'] - screenshareAsContent = event.at_xpath('screenshareAsContent')&.text == "true" + if @presentation_props['include_deskshare'] + screenshareAsContent = event.at_xpath('screenshareAsContent')&.text == 'true'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb(1 hunks)record-and-playback/presentation/scripts/publish/presentation.rb(2 hunks)
🧰 Additional context used
🪛 RuboCop (1.80.2)
record-and-playback/presentation/scripts/publish/presentation.rb
[convention] 962-962: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1333-1333: Avoid comma after the last parameter of a method call.
(Style/TrailingCommaInArguments)
[convention] 1343-1343: Avoid comma after the last parameter of a method call.
(Style/TrailingCommaInArguments)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-package (bbb-playback-record)
🔇 Additional comments (1)
record-and-playback/core/lib/recordandplayback/generators/events.rb (1)
1183-1183: Deterministic ordering: good additionSorting screenshare-as-content events by timestamp removes ordering nondeterminism and aligns with per-segment emission.
| @rec_events.each do |re| | ||
| # consider the last swap event before the current recording start | ||
| last_event_before_start = swap_events.select { |e| e[:timestamp].to_i < re[:start_timestamp] }.last | ||
| if last_event_before_start && last_event_before_start[:timestamp].to_i < re[:stop_timestamp] | ||
| @layout_swap_xml.event( | ||
| timestamp: (translate_timestamp(last_event_before_start[:timestamp].to_f) / 1000).round(1), | ||
| show_screenshare: last_event_before_start[:screenshareAsContent], | ||
| ) | ||
| end | ||
|
|
||
| swap_events.each do |event| | ||
| timestamp = event[:timestamp].to_i | ||
| next unless (timestamp >= re[:start_timestamp]) && (timestamp <= re[:stop_timestamp]) | ||
|
|
||
| @layout_swap_xml.event( | ||
| timestamp: (translate_timestamp(event[:timestamp].to_f) / 1000).round(1), | ||
| show_screenshare: event[:screenshareAsContent], | ||
| ) | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Avoid duplicate swap event at recording segment start and drop trailing commas
- If there’s a swap event exactly at
re[:start_timestamp]and a prior swap state, both get translated to the same output timestamp, producing duplicate entries. Emit the prior state only when it adds information (i.e., there’s no event at the exact start, or it differs from the first in‑segment state). - Remove trailing commas per RuboCop’s Style/TrailingCommaInArguments.
Apply this diff:
- @layout_swap_xml.recording('id' => 'layout_swap_events') do
- @rec_events.each do |re|
- # consider the last swap event before the current recording start
- last_event_before_start = swap_events.select { |e| e[:timestamp].to_i < re[:start_timestamp] }.last
- if last_event_before_start && last_event_before_start[:timestamp].to_i < re[:stop_timestamp]
- @layout_swap_xml.event(
- timestamp: (translate_timestamp(last_event_before_start[:timestamp].to_f) / 1000).round(1),
- show_screenshare: last_event_before_start[:screenshareAsContent],
- )
- end
-
- swap_events.each do |event|
- timestamp = event[:timestamp].to_i
- next unless (timestamp >= re[:start_timestamp]) && (timestamp <= re[:stop_timestamp])
-
- @layout_swap_xml.event(
- timestamp: (translate_timestamp(event[:timestamp].to_f) / 1000).round(1),
- show_screenshare: event[:screenshareAsContent],
- )
- end
- end
- end
+ @layout_swap_xml.recording('id' => 'layout_swap_events') do
+ @rec_events.each do |re|
+ # last swap before segment start
+ last_before = swap_events.select { |e| e[:timestamp].to_i < re[:start_timestamp] }.last
+ # first swap within segment
+ first_in_seg = swap_events.find { |e| (t = e[:timestamp].to_i) >= re[:start_timestamp] && t <= re[:stop_timestamp] }
+
+ if last_before &&
+ (first_in_seg.nil? ||
+ first_in_seg[:timestamp].to_i > re[:start_timestamp] ||
+ first_in_seg[:screenshareAsContent] != last_before[:screenshareAsContent])
+ @layout_swap_xml.event(
+ timestamp: (translate_timestamp(last_before[:timestamp].to_f) / 1000).round(1),
+ show_screenshare: last_before[:screenshareAsContent]
+ )
+ end
+
+ swap_events.each do |event|
+ timestamp = event[:timestamp].to_i
+ next unless (timestamp >= re[:start_timestamp]) && (timestamp <= re[:stop_timestamp])
+
+ @layout_swap_xml.event(
+ timestamp: (translate_timestamp(event[:timestamp].to_f) / 1000).round(1),
+ show_screenshare: event[:screenshareAsContent]
+ )
+ end
+ end
+ end📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @rec_events.each do |re| | |
| # consider the last swap event before the current recording start | |
| last_event_before_start = swap_events.select { |e| e[:timestamp].to_i < re[:start_timestamp] }.last | |
| if last_event_before_start && last_event_before_start[:timestamp].to_i < re[:stop_timestamp] | |
| @layout_swap_xml.event( | |
| timestamp: (translate_timestamp(last_event_before_start[:timestamp].to_f) / 1000).round(1), | |
| show_screenshare: last_event_before_start[:screenshareAsContent], | |
| ) | |
| end | |
| swap_events.each do |event| | |
| timestamp = event[:timestamp].to_i | |
| next unless (timestamp >= re[:start_timestamp]) && (timestamp <= re[:stop_timestamp]) | |
| @layout_swap_xml.event( | |
| timestamp: (translate_timestamp(event[:timestamp].to_f) / 1000).round(1), | |
| show_screenshare: event[:screenshareAsContent], | |
| ) | |
| end | |
| end | |
| end | |
| @layout_swap_xml.recording('id' => 'layout_swap_events') do | |
| @rec_events.each do |re| | |
| # last swap before segment start | |
| last_before = swap_events.select { |e| e[:timestamp].to_i < re[:start_timestamp] }.last | |
| # first swap within segment | |
| first_in_seg = swap_events.find { |e| (t = e[:timestamp].to_i) >= re[:start_timestamp] && t <= re[:stop_timestamp] } | |
| if last_before && | |
| (first_in_seg.nil? || | |
| first_in_seg[:timestamp].to_i > re[:start_timestamp] || | |
| first_in_seg[:screenshareAsContent] != last_before[:screenshareAsContent]) | |
| @layout_swap_xml.event( | |
| timestamp: (translate_timestamp(last_before[:timestamp].to_f) / 1000).round(1), | |
| show_screenshare: last_before[:screenshareAsContent] | |
| ) | |
| end | |
| swap_events.each do |event| | |
| timestamp = event[:timestamp].to_i | |
| next unless (timestamp >= re[:start_timestamp]) && (timestamp <= re[:stop_timestamp]) | |
| @layout_swap_xml.event( | |
| timestamp: (translate_timestamp(event[:timestamp].to_f) / 1000).round(1), | |
| show_screenshare: event[:screenshareAsContent] | |
| ) | |
| end | |
| end | |
| end |
🧰 Tools
🪛 RuboCop (1.80.2)
[convention] 1333-1333: Avoid comma after the last parameter of a method call.
(Style/TrailingCommaInArguments)
[convention] 1343-1343: Avoid comma after the last parameter of a method call.
(Style/TrailingCommaInArguments)
🤖 Prompt for AI Agents
In record-and-playback/presentation/scripts/publish/presentation.rb around lines
1327 to 1347, the code can emit a duplicate layout swap event when there is a
prior swap whose translated timestamp equals a swap event at
re[:start_timestamp], and it also contains trailing commas; change the logic so
you only emit the prior last_event_before_start when there is no in-segment swap
event at exactly re[:start_timestamp] or when that first in-segment event has a
different screenshareAsContent (i.e., compare the prior state to the first
matching swap_events entry and skip emitting the prior if they produce the same
logical state/timestamp), and remove trailing commas from the
@layout_swap_xml.event calls' argument lists to satisfy RuboCop
Style/TrailingCommaInArguments.
|
@kepstin can you review again? |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
record-and-playback/core/lib/recordandplayback/generators/events.rb (1)
1185-1215: Approve the event loop logic with optional style improvements.The event scanning and state tracking logic correctly handles:
- Time windowing with
start_time/end_timeboundaries- Offset adjustment for pause/resume cycles
- Preservation of
last_screenshare_as_contentstate across recording segmentsThe logic properly emits events only during active recording periods and maintains 0-based timestamps within the recording window.
Optional style improvements:
Per RuboCop, consider these minor style adjustments:
- last_screenshare_as_content = event.at_xpath('screenshareAsContent')&.text == "true" + last_screenshare_as_content = event.at_xpath('screenshareAsContent')&.text == 'true' - screenshareAsContent = event.at_xpath('screenshareAsContent')&.text == "true" + screenshareAsContent = event.at_xpath('screenshareAsContent')&.text == 'true' - screenshare_content_events << { - timestamp: timestamp - offset, - screenshareAsContent: last_screenshare_as_content, - } if !last_screenshare_as_content.nil? + if !last_screenshare_as_content.nil? + screenshare_content_events << { + timestamp: timestamp - offset, + screenshareAsContent: last_screenshare_as_content + } + endrecord-and-playback/presentation/scripts/publish/presentation.rb (2)
960-969: Approve the SetScreenshareAsContentEvent logic with optional simplification.The event handling correctly toggles deskshare state and marks slide changes. The guard clause using
next unlessfollows the suggested pattern.Optional simplification:
Since
slide_changedis always set totrue, the logic can be streamlined:when 'SetScreenshareAsContentEvent' next unless @presentation_props['include_deskshare'] + - screenshare_as_content = event.at_xpath('screenshareAsContent')&.text == "true" - if screenshare_as_content - deskshare = slide_changed = true - else - deskshare = false - slide_changed = true - end + screenshare_as_content = event.at_xpath('screenshareAsContent')&.text == 'true' + deskshare = screenshare_as_content + slide_changed = trueThis also addresses the RuboCop hints for empty line after guard clause and single-quoted strings.
1319-1333: Verify initial state handling for screenshare-as-content.The updated implementation correctly delegates time windowing to
get_screenshare_as_content_eventsand avoids the quadratictranslate_timestampcalls. However, please verify the following scenario:Scenario:
- Recording starts at timestamp 1000
- A
SetScreenshareAsContentEventoccurs at timestamp 500 (before recording) withscreenshareAsContent=true- No
SetScreenshareAsContentEventoccurs during the recording windowQuestion:
Should an initial state event be emitted at the recording start (timestamp 1000) to indicate that screenshare-as-content is active? Currently,get_screenshare_as_content_eventsfilters events bytimestamp >= start_time, so no event would be emitted in this scenario.If the playback needs to know the initial state, consider emitting the prior state at segment start when no in-segment event exists.
Optional: Remove trailing comma (RuboCop Style/TrailingCommaInArguments):
@layout_swap_xml.event( timestamp: (event[:timestamp].to_f / 1000.0).round(1), - show_screenshare: event[:screenshareAsContent], + show_screenshare: event[:screenshareAsContent] )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb(1 hunks)record-and-playback/presentation/scripts/publish/presentation.rb(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
record-and-playback/presentation/scripts/publish/presentation.rb (1)
record-and-playback/core/lib/recordandplayback/generators/events.rb (1)
get_screenshare_as_content_events(1170-1217)
🪛 RuboCop (1.81.1)
record-and-playback/presentation/scripts/publish/presentation.rb
[convention] 961-961: Add empty line after guard clause.
(Layout/EmptyLineAfterGuardClause)
[convention] 962-962: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
record-and-playback/core/lib/recordandplayback/generators/events.rb
[convention] 1191-1191: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1194-1194: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1206-1209: Favor a normal if-statement over a modifier clause in a multiline statement.
(Style/MultilineIfModifier)
[convention] 1206-1209: Favor unless over if for negative conditions.
(Style/NegatedIf)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-package (bbb-playback-record)
🔇 Additional comments (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb (2)
1170-1170: LGTM: Method signature updated for segment support.The addition of
start_timeandend_timeparameters aligns with the pattern used inget_chat_eventsand supports per-segment recording processing as intended.
1171-1180: LGTM: Time anchoring logic is correct.The computation of
initial_timestampand adjustment ofstart_time/end_timeto 0-based timestamps is consistent with the pattern used inget_chat_eventsand correctly handles recordings without status events.
|
I've pushed an update to this with the following changes: The recording state tracking was unnecessarily complicated in order to handle the case where a recording start (or stop) was received while the recording was already started (or stopped). None of the other recording code bothers handling this, and the conditions can be made easier to read by removing this logic. To simplify the tracking of last screenshare as content, I'm reading it directly from the Code has been added to handle the special case of the @germanocaumo I'd appreciate you taking a look through my modified code and testing it to make sure it works as expected. |
|
@kepstin sorry I'm on vacation, will only be able to test it properly when back 10th |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
record-and-playback/core/lib/recordandplayback/generators/events.rb(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on <meta> elements under the <metadata> section, not as child elements. When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo Meeting"/>). When using Nokogiri to parse events.xml in Ruby, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups like metadata.at_xpath('element-name').
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo"/>). When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
record-and-playback/core/lib/recordandplayback/generators/events.rb(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on <meta> elements under the <metadata> section, not as child elements. When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo Meeting"/>). When using Nokogiri to parse events.xml in Ruby, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups like metadata.at_xpath('element-name').
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
PR: bigbluebutton/bigbluebutton#23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo"/>). When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
🔇 Additional comments (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb (2)
1231-1244: The fallback logic for initial event emission only runs for non-critical event types.This "else" branch correctly handles emitting an initial event at
timestamp: 0whenstart_timefalls mid-segment, but only executes for events that are neitherSetScreenshareAsContentEventnorRecordStatusEvent.While most recordings contain various event types (chat, participant joins, etc.) that would trigger this branch, edge cases exist where the first event after
start_timeis aSetScreenshareAsContentEventorRecordStatusEvent, causing the initial state to be emitted at the wrong timestamp as noted in previous comments.The logic here is sound for its intended purpose. However, consider adding similar initial-event checks at the beginning of the other two event type handlers to ensure complete coverage.
1210-1229: Similar initial event timing concern applies to recording resume.When recording resumes (line 1215), the code emits an event to re-establish the current
screenshare_as_contentstate. However, if this is the first event afterstart_timeandscreenshare_as_contentwas set beforestart_time, the event timing may not correctly reflect the segment start.The duplicate check on line 1220 correctly handles the case where
screenshare_as_contentisnil(no state set yet), preventing emission of events withnilstate. However, the same initial-event-at-timestamp-0 concern from theSetScreenshareAsContentEventcase applies here.Consider applying similar logic as suggested for the
SetScreenshareAsContentEventcase:when %w[PARTICIPANT RecordStatusEvent] record = event.at_xpath('status').content == 'true' # Don't update timestamps until we're past the segment start time next unless timestamp >= start_time if record + # Emit initial event if this is the first event in the segment and state was set before segment start + if screenshare_content_events.empty? && !screenshare_as_content.nil? + screenshare_content_events << { + timestamp: 0, + screenshareAsContent: screenshare_as_content, + } + end + # Recording resumed; update offset to account for the timestamp jump offset += timestamp - last_stop_timestamp - # Don't emit an event if the previous event has the same state - next if screenshare_content_events.dig(-1, :screenshareAsContent) == screenshare_as_content - - screenshare_content_events << { - timestamp: timestamp - offset, - screenshareAsContent: screenshare_as_content, - } else # Recording paused last_stop_timestamp = timestamp endLikely an incorrect or invalid review comment.
| last_stop_timestamp = start_time | ||
| offset = start_time | ||
| # Recordings without status events are assumed to have been recorded from the beginning | ||
| record = events.at_xpath('/recording/event[@eventname="RecordStatusEvent"]').nil? | ||
|
|
||
| screenshare_content_events = [] |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Initialize screenshare_as_content before the event loop.
The variable screenshare_as_content is assigned within the SetScreenshareAsContentEvent case (line 1199) but is referenced in other branches (lines 1220, 1238) before it might be set. While Ruby's scoping allows this, explicitly initializing it to nil before the loop improves code clarity and prevents potential undefined variable errors.
Apply this diff:
# Recordings without status events are assumed to have been recorded from the beginning
record = events.at_xpath('/recording/event[@eventname="RecordStatusEvent"]').nil?
+ screenshare_as_content = nil
screenshare_content_events = []📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| last_stop_timestamp = start_time | |
| offset = start_time | |
| # Recordings without status events are assumed to have been recorded from the beginning | |
| record = events.at_xpath('/recording/event[@eventname="RecordStatusEvent"]').nil? | |
| screenshare_content_events = [] | |
| last_stop_timestamp = start_time | |
| offset = start_time | |
| # Recordings without status events are assumed to have been recorded from the beginning | |
| record = events.at_xpath('/recording/event[@eventname="RecordStatusEvent"]').nil? | |
| screenshare_as_content = nil | |
| screenshare_content_events = [] |
🤖 Prompt for AI Agents
In record-and-playback/core/lib/recordandplayback/generators/events.rb around
lines 1186 to 1191, the variable screenshare_as_content is assigned inside the
SetScreenshareAsContentEvent branch but referenced in other branches before it
may be set; explicitly initialize screenshare_as_content = nil before the
event-processing loop (e.g., alongside screenshare_content_events
initialization) so it is defined and clear to readers.
| record = events.at_xpath('/recording/event[@eventname="RecordStatusEvent"]').nil? | ||
|
|
||
| screenshare_content_events = [] | ||
| last_screenshare_as_content = nil |
There was a problem hiding this comment.
Missing screenshare_as_content initialization here?
|
@kepstin It looks good, only seems to be missing the screenshare_as_content variable initialization. |
ccba15a to
da00877
Compare
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
record-and-playback/core/lib/recordandplayback/generators/events.rb (1)
1170-1259: Well-designed generic event extraction with proper recording mark handling.The implementation correctly addresses the concerns from past reviews:
current_stateis initialized tonilbefore the loop (line 1195)- Offset calculation properly handles recording start/stop events
- Initial state emission at timestamp 0 when segment starts mid-recording
The else branch (lines 1245-1256) elegantly handles the edge case where
start_timefalls inside an active recording segment by emitting the prior state at timestamp 0 upon encountering the first event within bounds.The duplicate state comparison logic (lines 1209-1216 and 1231-1238) could be extracted into a helper:
def self.state_unchanged?(extracted_events, current_state, compare_keys) return false unless extracted_events.last last_event = extracted_events.last.reject { |k| k == :timestamp } if compare_keys last_event.slice(*compare_keys) == current_state.slice(*compare_keys) else last_event == current_state end endAlso, fix trailing whitespace on line 1207.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
record-and-playback/core/lib/recordandplayback/generators/events.rb(1 hunks)record-and-playback/presentation/scripts/publish/presentation.rb(3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
Repo: bigbluebutton/bigbluebutton PR: 23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on <meta> elements under the <metadata> section, not as child elements. When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
Repo: bigbluebutton/bigbluebutton PR: 23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo Meeting"/>). When using Nokogiri to parse events.xml in Ruby, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups like metadata.at_xpath('element-name').
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
📚 Learning: 2025-09-11T20:23:35.575Z
Learnt from: kepstin
Repo: bigbluebutton/bigbluebutton PR: 23887
File: record-and-playback/video/scripts/process/video.rb:117-123
Timestamp: 2025-09-11T20:23:35.575Z
Learning: In BigBlueButton's events.xml files, metadata is stored as attributes on the <metadata> element (e.g., <metadata bbb-recording-video-preset="720p" meetingName="Demo"/>). When using Nokogiri to parse events.xml, metadata attributes should be accessed using bracket notation like metadata['attribute-name'], not XPath element lookups.
Applied to files:
record-and-playback/core/lib/recordandplayback/generators/events.rb
🧬 Code graph analysis (1)
record-and-playback/presentation/scripts/publish/presentation.rb (2)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala (1)
event(92-92)record-and-playback/core/lib/recordandplayback/generators/events.rb (2)
get_screenshare_as_content_events(1261-1267)get_layout_broadcasted_events(1269-1280)
🪛 RuboCop (1.81.7)
record-and-playback/core/lib/recordandplayback/generators/events.rb
[convention] 1207-1207: Trailing whitespace detected.
(Layout/TrailingWhitespace)
[convention] 1212-1212: Modifier form of if makes the line too long.
(Style/IfUnlessModifier)
[convention] 1212-1212: Line is too long. [135/128]
(Layout/LineLength)
[convention] 1214-1214: Convert if nested inside else to elsif.
(Style/IfInsideElse)
[convention] 1230-1230: Add empty line after guard clause.
(Layout/EmptyLineAfterGuardClause)
[convention] 1234-1234: Modifier form of if makes the line too long.
(Style/IfUnlessModifier)
[convention] 1234-1234: Line is too long. [137/128]
(Layout/LineLength)
[convention] 1236-1236: Convert if nested inside else to elsif.
(Style/IfInsideElse)
[convention] 1262-1262: Line is too long. [129/128]
(Layout/LineLength)
[convention] 1264-1264: Put a comma after the last item of a multiline hash.
(Style/TrailingCommaInHashLiteral)
[convention] 1264-1264: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1276-1276: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1277-1277: Put a comma after the last item of a multiline hash.
(Style/TrailingCommaInHashLiteral)
[convention] 1277-1277: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
record-and-playback/presentation/scripts/publish/presentation.rb
[convention] 961-961: Add empty line after guard clause.
(Layout/EmptyLineAfterGuardClause)
[convention] 962-962: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
[convention] 1320-1320: Prefer single-quoted strings when you don't need string interpolation or special symbols.
(Style/StringLiterals)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-package (bbb-playback-record)
🔇 Additional comments (5)
record-and-playback/presentation/scripts/publish/presentation.rb (3)
960-968: LGTM! Clean implementation of SetScreenshareAsContentEvent handling.The guard clause pattern and logic correctly mirror the existing deskshare event handling. Minor RuboCop suggestions: add an empty line after the guard clause (line 961) and prefer single-quoted strings for
"true"(line 962).
1319-1342: Clean refactor using the new event extraction API.The implementation correctly merges screenshare and layout events, using the updated helpers that handle recording marks and offset calculation. The key-based attribute selection (
show_screensharevsshow_presentation) properly distinguishes event types.One minor consideration:
sort_by { |e| e[:timestamp] }is stable in Ruby 2.7+, so events with identical timestamps maintain their relative order from the concatenation. This should be fine for playback.
1509-1509: LGTM!Call site correctly updated to use the renamed method.
record-and-playback/core/lib/recordandplayback/generators/events.rb (2)
1261-1267: LGTM! Clean delegation to the generic helper.The
compare_keys: [:screenshareAsContent]correctly ensures only meaningful state changes are emitted. Minor RuboCop suggestions: prefer single-quoted strings for"true"and consider adding a trailing comma after the last hash item.
1269-1280: LGTM!The implementation correctly extracts layout event data. Using
[:presentationIsOpen]ascompare_keysmeans events are only emitted when presentation visibility changes, while still capturing the full state (focusedCamera, layout, etc.) for each emission.Note:
&.content.to_fis safe—if the element is missing,nil.to_freturns0.0in Ruby.
|
In the time since this was originally written, I ended up writing basically the same code to do these events for the video processing here: It might be possible to use this code from the presentation processing scripts rather than implement another method which does basically the same thing. I think the code would look more or less like this: layout_edl = BigBlueButton::Events.create_layout_edl(events_xml)
layout_edl = BigBlueButton::Events.edl_match_recording_marks_video(layout_edl, events_xml, start_time, stop_time)Then [
{
timestamp: 0
areas: {},
conditions: {
screenshare_as_content: true,
presentation_is_open: true,
}
},
{
timestamp: 720000,
areas: {},
conditions: {
screenshare_as_content: false,
presentation_is_open: true,
},
…
},
]which should be straightforwards to map to the desired |
…yback - Only consider swap events inside recordings. - Add slides swaps to shapes.svg when quick swap occur so playback can show the slides and thumbnails when screenshare is on for the entire recording. -- In this case, previously only the screenshare was shown.
The recording state tracking was unnecessarily complicated in order to handle the case where a recording start (or stop) was received while the recording was already started (or stopped). None of the other recording bothers handling this, and the conditions can be made easier to read by removing this logic. To simplify the tracking of last screenshare as content, I'm not reading it directly from the screenshare_content_events array instead of trying to keep a separate variable in sync. Code has been added to handle the special case of the start_time (recording segment start timestamp) happening after a recording start event and screenshare as content event have been received. In this case, it needs to emit an event corresponding to the current screenshare as content state at the 0 timestamp.
- Include the info when presentation is minimized by presenter with push layout on: <?xml version="1.0" encoding="UTF-8"?> <recording id="layout_swap_events"> <event timestamp="0.0" show_screenshare="false"/> <event timestamp="6.0" show_screenshare="true"/> <event timestamp="12.7" show_screenshare="false"/> <event timestamp="19.7" show_presentation="true"/> <event timestamp="21.6" show_presentation="false"/> <event timestamp="24.8" show_presentation="true"/> <event timestamp="29.9" show_presentation="false"/> </recording>
Refactored the layout event building to use the new create_layout_edl. Xml generated: <?xml version="1.0" encoding="UTF-8"?> <recording id="layout_swap_events"> <event timestamp="0.0" show_screenshare="false" show_presentation="true"/> <event timestamp="10.8" show_screenshare="true" show_presentation="true"/> <event timestamp="22.5" show_screenshare="false" show_presentation="true"/> <event timestamp="30.4" show_screenshare="true" show_presentation="true"/> <event timestamp="43.0" show_screenshare="true" show_presentation="false"/> <event timestamp="45.6" show_screenshare="true" show_presentation="true"/> <event timestamp="47.1" show_screenshare="true" show_presentation="false"/> <event timestamp="48.5" show_screenshare="true" show_presentation="true"/> </recording>
da00877 to
f504bd0
Compare
|
✅ Automated tests have passed! |



What does this PR do?
To be used with bigbluebutton/bbb-playback#331