add room functionality

This commit is contained in:
Josh
2018-06-01 11:55:52 -04:00
parent 1bcd176285
commit 45fb18e609
9 changed files with 157 additions and 60 deletions

View File

@ -94,9 +94,37 @@ class Room < ApplicationRecord
# Fetches all recordings for a meeting.
def recordings
res = bbb.get_recordings(meetingID: bbb_id)
# Format playbacks in a more pleasant way.
res[:recordings].each do |r|
next if r.key?(:error)
r[:playbacks] = if !r[:playback] || !r[:playback][:format]
[]
elsif r[:playback][:format].is_a?(Array)
r[:playback][:format]
else
[r[:playback][:format]]
end
r.delete(:playback)
end
res[:recordings]
end
# Deletes a recording from a room.
def delete_recording(record_id)
res = bbb.delete_recordings(record_id)
if res[:returncode]
# Handle successful deletion.
else
# Handle unsuccessful deletion.
end
end
private
def bbb_endpoint