add dailyco feature flag

This commit is contained in:
Bilal
2020-09-15 10:33:23 +03:00
parent afd51a51f0
commit 1aa4af074b
3 changed files with 12 additions and 2 deletions

View File

@@ -34,4 +34,7 @@ MILLICAST_API_SECRET=
MILLICAST_ACCOUNT_ID=
# Daily.co live chat API token
DAILYCO_API_KEY=
DAILYCO_API_KEY=
# Feature flag to switch between Zoom and Daily.co live meeting
DAILYCO_ENABLED= 1 (on) / 0 (off); When Off, Zoom meeting will be used if no override url is present

View File

@@ -114,7 +114,12 @@ class BroadcastsController < ApplicationController
end
def conference_url_for(broadcast)
broadcast.video_conference_url_override.presence || url_for([broadcast.project, broadcast, :live_meeting])
if broadcast.video_conference_url_override.present?
broadcast.video_conference_url_override
else
conference_type = ENV['DAILYCO_ENABLED'] == '1' ? :live_meeting : :zoom_meeting
url_for([broadcast.project, broadcast, conference_type])
end
end
def log_create_analytics

View File

@@ -105,6 +105,7 @@ Rails.application.routes.draw do
delete :destroy_file
end
resource :live_meeting, only: [:show]
resource :zoom_meeting, only: [:show]
resources :broadcast_recordings, only: [:destroy]
end
resources :directories, except: [:index] do
@@ -150,6 +151,7 @@ Rails.application.routes.draw do
end
resources :broadcasts, param: :token, only: [:show, :update] do
resource :live_meeting, only: [:show]
resource :zoom_meeting, only: [:show]
resources :broadcast_recordings, only: [:edit, :update] do
resources :broadcast_recording_starrings, only: :create
end