Skip to content

Commit

Permalink
Use the timestamp from the meeting ID to calculate the real start time
Browse files Browse the repository at this point in the history
With the switch to a different clock source in red5, the timestamps
in the events file are no longer real-time, but are rather in
seconds since computer boot.

The timestamp in the meeting id is still realtime, so use that as
the start time. Calculate the end time by adding the meeting length
to the start time.
  • Loading branch information
kepstin committed Aug 29, 2014
1 parent 913f4a5 commit 15fe621
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions record-and-playback/presentation/scripts/publish/presentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,21 @@ def processChatMessages
BigBlueButton::Events.get_start_and_stop_rec_events("#{$process_dir}/events.xml"))

recording_time = computeRecordingLength()

# presentation_url = "/slides/" + $meeting_id + "/presentation"
@doc = Nokogiri::XML(File.open("#{$process_dir}/events.xml"))

$meeting_start = @doc.xpath("//event")[0][:timestamp]
$meeting_end = @doc.xpath("//event").last()[:timestamp]

$version = BigBlueButton::Events.bbb_version("#{$process_dir}/events.xml")
BigBlueButton.logger.info("Creating metadata.xml")

# Get the real-time start and end timestamp
match = /.*-(\d+)$/.match($meeting_id)
real_start_time = match[1]
real_end_time = (real_start_time.to_i + ($meeting_end.to_i - $meeting_start.to_i)).to_s

# Create metadata.xml
b = Builder::XmlMarkup.new(:indent => 2)

Expand All @@ -900,8 +912,8 @@ def processChatMessages
b.state("available")
b.published(true)
# Date Format for recordings: Thu Mar 04 14:05:56 UTC 2010
b.start_time(BigBlueButton::Events.first_event_timestamp("#{$process_dir}/events.xml"))
b.end_time(BigBlueButton::Events.last_event_timestamp("#{$process_dir}/events.xml"))
b.start_time(real_start_time)
b.end_time(real_end_time)
b.playback {
b.format("presentation")
b.link("http://#{playback_host}/playback/presentation/playback.html?meetingId=#{$meeting_id}")
Expand All @@ -918,11 +930,6 @@ def processChatMessages
BigBlueButton.logger.info("Generating xml for slides and chat")

#Create slides.xml
# presentation_url = "/slides/" + $meeting_id + "/presentation"
@doc = Nokogiri::XML(File.open("#{$process_dir}/events.xml"))

$meeting_start = @doc.xpath("//event[@eventname='ParticipantJoinEvent']")[0][:timestamp]
$meeting_end = @doc.xpath("//event[@eventname='EndAndKickAllEvent']").last()[:timestamp]

# Gathering all the events from the events.xml
$slides_events = @doc.xpath("//event[@eventname='GotoSlideEvent' or @eventname='SharePresentationEvent']")
Expand All @@ -932,8 +939,8 @@ def processChatMessages
$cursor_events = @doc.xpath("//event[@eventname='CursorMoveEvent']")
$clear_page_events = @doc.xpath("//event[@eventname='ClearPageEvent']") # for clearing the svg image
$undo_events = @doc.xpath("//event[@eventname='UndoShapeEvent']") # for undoing shapes.
$join_time = @doc.xpath("//event[@eventname='ParticipantJoinEvent']")[0][:timestamp].to_f
$end_time = @doc.xpath("//event[@eventname='EndAndKickAllEvent']")[0][:timestamp].to_f
$join_time = $meeting_start.to_f
$end_time = $meeting_end.to_f

calculateRecordEventsOffset()

Expand Down

0 comments on commit 15fe621

Please sign in to comment.