create live meeting when Conference button is clicked
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
class LiveMeetingsController < ApplicationController
|
class LiveMeetingsController < ApplicationController
|
||||||
def show
|
def show
|
||||||
authorize broadcast = Broadcast.find(params[:broadcast_id])
|
authorize broadcast = Broadcast.find(params[:broadcast_id])
|
||||||
|
if broadcast.project.live_meeting_url.blank?
|
||||||
|
room = Daily.create_room
|
||||||
|
room_url = room['url']
|
||||||
|
broadcast.project.update live_meeting_url: room_url
|
||||||
|
end
|
||||||
@live_meeting_url = broadcast.project.live_meeting_url
|
@live_meeting_url = broadcast.project.live_meeting_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -14,7 +14,6 @@ class Broadcast < ApplicationRecord
|
|||||||
|
|
||||||
# Should we use callbacks for this, or something else?
|
# Should we use callbacks for this, or something else?
|
||||||
after_create :create_mux_live_stream
|
after_create :create_mux_live_stream
|
||||||
after_create :create_live_meeting_if_not_created
|
|
||||||
after_destroy :destroy_mux_live_stream
|
after_destroy :destroy_mux_live_stream
|
||||||
|
|
||||||
pg_search_scope :search, {
|
pg_search_scope :search, {
|
||||||
@@ -60,14 +59,6 @@ class Broadcast < ApplicationRecord
|
|||||||
self.save!
|
self.save!
|
||||||
end
|
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
|
def destroy_mux_live_stream
|
||||||
begin
|
begin
|
||||||
stream = MuxLiveStream.new
|
stream = MuxLiveStream.new
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
<%= javascript_include_tag "https://unpkg.com/@daily-co/daily-js" %>
|
<% if @live_meeting_url.present? %>
|
||||||
|
<%= javascript_include_tag "https://unpkg.com/@daily-co/daily-js" %>
|
||||||
|
|
||||||
<%= javascript_tag nonce: true do %>
|
<%= javascript_tag nonce: true do %>
|
||||||
callFrame = window.DailyIframe.createFrame({
|
callFrame = window.DailyIframe.createFrame({
|
||||||
showLeaveButton: true,
|
showLeaveButton: true,
|
||||||
iframeStyle: {
|
iframeStyle: {
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '90%'
|
height: '90%'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
callFrame.join({ url: '<%= @live_meeting_url %>' });
|
callFrame.join({ url: '<%= @live_meeting_url %>' });
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<p><%= t '.meeting_not_ready_message' %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -1390,6 +1390,9 @@ en:
|
|||||||
heading: Photos
|
heading: Photos
|
||||||
signature:
|
signature:
|
||||||
heading: Signature
|
heading: Signature
|
||||||
|
live_meetings:
|
||||||
|
show:
|
||||||
|
meeting_not_ready_message: Live meeting is not yet ready. Please contact project manager.
|
||||||
release_template_imports:
|
release_template_imports:
|
||||||
create:
|
create:
|
||||||
error: There was a problem with importing selected templates
|
error: There was a problem with importing selected templates
|
||||||
|
|||||||
@@ -632,6 +632,9 @@ es:
|
|||||||
show:
|
show:
|
||||||
choose_project: ¿Qué proyecto de la lista de abajo asistirá?
|
choose_project: ¿Qué proyecto de la lista de abajo asistirá?
|
||||||
welcome_html: Bienvenidos a la plataforma de firma autorizaciónes de <strong>%{name}</strong>
|
welcome_html: Bienvenidos a la plataforma de firma autorizaciónes de <strong>%{name}</strong>
|
||||||
|
live_meetings:
|
||||||
|
show:
|
||||||
|
meeting_not_ready_message: Live meeting is not yet ready. Please contact project manager. (ES)
|
||||||
shared:
|
shared:
|
||||||
print: Print (ES)
|
print: Print (ES)
|
||||||
talent_releases:
|
talent_releases:
|
||||||
|
|||||||
Reference in New Issue
Block a user