add live meeting in broadcast screen
This commit is contained in:
@@ -114,7 +114,7 @@ class BroadcastsController < ApplicationController
|
||||
end
|
||||
|
||||
def conference_url_for(broadcast)
|
||||
broadcast.video_conference_url_override.presence || url_for([broadcast.project, broadcast, :zoom_meeting])
|
||||
broadcast.video_conference_url_override.presence || url_for([broadcast.project, broadcast, :live_meeting])
|
||||
end
|
||||
|
||||
def log_create_analytics
|
||||
|
||||
6
app/controllers/live_meetings_controller.rb
Normal file
6
app/controllers/live_meetings_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class LiveMeetingsController < ApplicationController
|
||||
def show
|
||||
authorize broadcast = Broadcast.find(params[:broadcast_id])
|
||||
@live_meeting_url = broadcast.project.live_meeting_url
|
||||
end
|
||||
end
|
||||
@@ -44,7 +44,7 @@ class Public::BroadcastsController < Public::BaseController
|
||||
end
|
||||
|
||||
def conference_url_for(broadcast)
|
||||
broadcast.video_conference_url_override.presence || broadcast_zoom_meeting_url(broadcast.token)
|
||||
broadcast.video_conference_url_override.presence || broadcast_live_meeting_url(broadcast.token)
|
||||
end
|
||||
|
||||
class MultiViewBroadcast
|
||||
|
||||
9
app/controllers/public/live_meetings_controller.rb
Normal file
9
app/controllers/public/live_meetings_controller.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class Public::LiveMeetingsController < Public::BaseController
|
||||
skip_after_action :verify_authorized
|
||||
|
||||
def show
|
||||
broadcast = Broadcast.find_by_token!(params[:broadcast_token])
|
||||
@live_meeting_url = broadcast.project.live_meeting_url
|
||||
render 'public/live_meetings/show'
|
||||
end
|
||||
end
|
||||
@@ -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
|
||||
|
||||
13
app/views/live_meetings/show.html.erb
Normal file
13
app/views/live_meetings/show.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= javascript_include_tag "https://unpkg.com/@daily-co/daily-js" %>
|
||||
|
||||
<%= javascript_tag nonce: true do %>
|
||||
callFrame = window.DailyIframe.createFrame({
|
||||
showLeaveButton: true,
|
||||
iframeStyle: {
|
||||
position: 'fixed',
|
||||
width: '100%',
|
||||
height: '90%'
|
||||
}
|
||||
});
|
||||
callFrame.join({ url: '<%= @live_meeting_url %>' });
|
||||
<% end %>
|
||||
13
app/views/public/live_meetings/show.html.erb
Normal file
13
app/views/public/live_meetings/show.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= javascript_include_tag "https://unpkg.com/@daily-co/daily-js" %>
|
||||
|
||||
<%= javascript_tag nonce: true do %>
|
||||
callFrame = window.DailyIframe.createFrame({
|
||||
showLeaveButton: true,
|
||||
iframeStyle: {
|
||||
position: 'fixed',
|
||||
width: '100%',
|
||||
height: '90%'
|
||||
}
|
||||
});
|
||||
callFrame.join({ url: '<%= @live_meeting_url %>' });
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user