add live meeting in broadcast screen

This commit is contained in:
Bilal
2020-09-14 15:57:38 +03:00
parent 28e0eb36b7
commit de0b12a0e4
12 changed files with 89 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ class Broadcast < ApplicationRecord
# Should we use callbacks for this, or something else?
after_create :create_mux_live_stream
after_create :create_live_meeting_if_not_created
after_destroy :destroy_mux_live_stream
pg_search_scope :search, {
@@ -59,6 +60,14 @@ class Broadcast < ApplicationRecord
self.save!
end
def create_live_meeting_if_not_created
if project.live_meeting_url.blank?
room = Daily.create_room
room_url = room['url']
project.update live_meeting_url: room_url
end
end
def destroy_mux_live_stream
begin
stream = MuxLiveStream.new