Compare commits

...

3 Commits

Author SHA1 Message Date
Bilal
015ed83ac2 fix MR comment 2020-08-05 10:27:06 +02:00
Bilal
1045a8c328 change bigmedia.ai to mesuite.ai 2020-08-04 08:16:16 +02:00
Senad Uka
8214ba9e67 Changes 2020-08-03 21:52:04 +00:00
55 changed files with 487 additions and 60 deletions

View File

@@ -16,9 +16,10 @@ REDIS_URL=
# Required for Zoom.us integration
ZOOM_API_KEY=
ZOOM_API_SECRET=
ZOOM_ACCOUNT_NUMBER=
ZOOM_PRO_USERS_LIMIT= # defaults to 3
ZOOM_USER_TYPE= # 'pro' / 'basic'
ZOOM_ENABLE_RECORDINGS=0 # 0 / 1
ZOOM_ENABLE_RECORDINGS= # true / false (default: false)
# Token for webhooks authorization
ZOOM_VERIFICATION_TOKEN=

View File

@@ -20,6 +20,7 @@ class Admin::AccountsController < Admin::ApplicationController
def show
@videos = filtered_account_videos.order(created_at: :desc, project_id: :desc).paginate(page: params[:page])
@broadcasts = account_broadcasts.order(created_at: :desc, project_id: :desc).paginate(page: params[:page])
end
def edit
@@ -70,4 +71,8 @@ class Admin::AccountsController < Admin::ApplicationController
@account.videos
end
end
def account_broadcasts
@account.broadcasts
end
end

View File

@@ -0,0 +1,24 @@
class Admin::BroadcastsController < Admin::ApplicationController
before_action :set_broadcast, only: [:edit, :update]
def edit
end
def update
if @broadcast.update(broadcast_update_params)
redirect_to [:admin, @broadcast.project.account], notice: t(".notice")
else
render :edit
end
end
private
def set_broadcast
@broadcast = authorize policy_scope(Broadcast).find(params[:id])
end
def broadcast_update_params
params.require(:broadcast).permit(:stream_url_override, :stream_key_override, :director_mode_video_embed)
end
end

View File

@@ -0,0 +1,26 @@
class BroadcastRecordingsController < ApplicationController
layout "project"
before_action :set_project
before_action :set_broadcast
before_action :set_recording
def destroy
@recording.update(hidden: true)
@recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
end
private
def set_project
@project = policy_scope(Project).find(params[:project_id])
end
def set_broadcast
@broadcast = authorize policy_scope(@project.broadcasts).find(params[:broadcast_id])
end
def set_recording
@recording = authorize policy_scope(@broadcast.broadcast_recordings).find(params[:id])
end
end

View File

@@ -27,7 +27,7 @@ class BroadcastsController < ApplicationController
def show
@conference_url = url_for [@broadcast.project, @broadcast, :zoom_meeting]
@recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page])
@recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page])
render layout: 'application'
end

View File

@@ -5,7 +5,7 @@ class Public::BroadcastsController < Public::BaseController
def show
@conference_url = broadcast_zoom_meeting_url(@broadcast.token)
@multi_view_broadcasts = multi_view_broadcasts
@recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page])
@recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page])
render 'broadcasts/show'

View File

@@ -35,7 +35,7 @@ class StreamNotificationsController < ApplicationController
duration = notification.dig(:data, :duration)
recording = @broadcast.broadcast_recordings.create!(asset_uid: asset_uid, asset_playback_uid: playback_uid, file_name: file_name, duration: duration)
recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page])
recordings = @broadcast.broadcast_recordings.visible.order_by_recent.paginate(page: params[:page])
link = helpers.link_to(recording.broadcast_name.titleize, recording.download_url, target: "_blank")
message = "Your recent live stream has been recorded and is available for download here: #{link}"

View File

@@ -6,6 +6,6 @@ module MailHelper
"1. Tell us the name of the video: \n\n" \
"2. Attach each EDL to this email. Please make sure to indicate whether the EDL is a Video Only, Graphics Only, or Audio Only EDL."
mail_to "info@bigmedia.ai", content, subject: subject, body: body
mail_to "info@mesuite.ai", content, subject: subject, body: body
end
end

View File

@@ -1,5 +1,5 @@
class AdminMailer < ApplicationMailer
default to: %w(bray@bigmedia.ai lee@bigmedia.ai)
default to: %w[bray@mesuite.ai]
def new_video(video)
@video = video

View File

@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: ENV.fetch("MAILER_FROM_ADDRESS") { "support@bigmedia.ai" }
default from: ENV.fetch("MAILER_FROM_ADDRESS") { "support@mesuite.ai" }
layout "mailer"
end

View File

@@ -5,6 +5,7 @@ class Account < ApplicationRecord
has_many :users, through: :account_auths
has_many :projects, dependent: :destroy
has_many :videos, through: :projects
has_many :broadcasts, through: :projects
has_many :contract_templates, through: :projects
validates :name, presence: true

View File

@@ -40,7 +40,7 @@ class AppHost
use_ssl: false,
},
production: {
host: "bigmedia.ai",
host: "mesuite.ai",
use_ssl: true,
}
}

View File

@@ -35,7 +35,11 @@ class Broadcast < ApplicationRecord
end
def stream_server_url
ENV['MUX_BROADCAST_SERVER_URL']
stream_url_override.presence || ENV["MUX_BROADCAST_SERVER_URL"]
end
def stream_server_key
stream_key_override.presence || stream_key
end
def zoom_meeting_url

View File

@@ -5,6 +5,8 @@ class BroadcastRecording < ApplicationRecord
validates :asset_uid, uniqueness: true
scope :visible, -> { where(hidden: false) }
def download_url
"https://stream.mux.com/#{asset_playback_uid}/#{file_name}?download=#{download_file_name}"
end

View File

@@ -0,0 +1,9 @@
class BroadcastRecordingPolicy < ApplicationPolicy
def destroy?
if user.nil? || user.user.nil?
return false
end
user.manager? || user.account_manager?
end
end

View File

@@ -0,0 +1,13 @@
<tr>
<td><%= broadcast.project.name %></td>
<td><%= broadcast.name %></td>
<td class="text-right">
<div class="btn-group">
<%= button_tag "Manage", class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right">
<%= link_to "View on Mux", "#{ENV['MUX_LIVE_STREAM_DASHBOARD_URL']}/#{broadcast.stream_uid}", class: "dropdown-item", target: "_blank" %>
<%= link_to "Edit", [:edit, :admin, broadcast, locale: I18n.locale], class: "dropdown-item" %>
</div>
</div>
</td>
</tr>

View File

@@ -34,5 +34,25 @@
<%= will_paginate @videos %>
</div>
<% end %>
<hr>
<%= card_field_set_tag "Broadcasts" do %>
<div class="table-responsive-sm">
<table class="table table-striped tr-px-4 align-all-middle">
<thead class="thead-light">
<tr>
<th>Project</th>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody id="broadcasts">
<%= render partial: "admin/accounts/broadcast", collection: @broadcasts %>
</tbody>
</table>
</div>
<div id="broadcasts_pagination">
<%= will_paginate @broadcasts %>
</div>
<% end %>
</div>
</div>

View File

@@ -0,0 +1,14 @@
<%= errors_summary_for broadcast %>
<%= bootstrap_form_with model: model, local: true do |form| %>
<%= form.text_field :stream_url_override %>
<%= form.text_field :stream_key_override %>
<%= form.text_area :director_mode_video_embed %>
<div class="row align-items-center text-center mt-4">
<%= link_to t("shared.cancel"), [:admin, broadcast.project.account], class: "col-3 text-reset" %>
<div class="col-9">
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => broadcast.new_record?), data: { disable_with: t("shared.disable_with") } %>
</div>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<div class="card shadow-sm">
<%= card_header text: t(".heading"), close_action_path: [:admin, @broadcast.project.account] %>
<div class="card-body">
<%= render "form", model: [:admin, @broadcast], broadcast: @broadcast %>
</div>
</div>

View File

@@ -0,0 +1,6 @@
var dom_id = "<%= dom_id(@recording) %>"
$('[data-id="' + dom_id + '"]').remove();
<% if @recordings.empty? %>
$("#broadcast_recordings_nav").append('<p class="dropdown-item text-muted">Recordings will appear here</p>')
<% end %>
$("#broadcast_recordings").html("<%= j render(partial: 'broadcasts/broadcast_recordings', locals: { recordings: @recordings, broadcast: @broadcast }) %>");

View File

@@ -16,8 +16,8 @@
<div class="btn-group">
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right">
<%= link_to fa_icon("link fw", text: "Copy Stream URL"), ENV['MUX_BROADCAST_SERVER_URL'], class: "dropdown-item", data: { behavior: "clipboard" } %>
<%= link_to fa_icon("key fw", text: "Copy Stream Key"), broadcast.stream_key, class: "dropdown-item", data: { behavior: "clipboard" } %>
<%= link_to fa_icon("link fw", text: "Copy Stream URL"), broadcast.stream_server_url, class: "dropdown-item", data: { behavior: "clipboard" } %>
<%= link_to fa_icon("key fw", text: "Copy Stream Key"), broadcast.stream_server_key, class: "dropdown-item", data: { behavior: "clipboard" } %>
<% if policy(broadcast).show? %>
<%= link_to fa_icon("file-video-o fw", text: "View"), [broadcast.project, broadcast], class: "dropdown-item", target: '_blank' %>
<% end %>

View File

@@ -1,2 +1,3 @@
<%= link_to broadcast_recording.download_file_name, "javascript:void(0);", class: "dropdown-item", data: { behavior: "play_recording", playback_url: broadcast_recording.playback_url } %>
<%= link_to broadcast_recording.download_file_name, "javascript:void(0);", class: "dropdown-item", data: { behavior: "play_recording", playback_url: broadcast_recording.playback_url, id: dom_id(broadcast_recording) } %>

View File

@@ -2,7 +2,12 @@
<p>Click below to download the recordings of the live stream.</p>
<ul class="mt-2">
<% recordings.each do |recording| %>
<li><%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %></li>
<li>
<%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %>
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
<%= link_to "Hide", [broadcast.project, broadcast, recording], class: "btn-sm btn-primary ml-1 text-decoration-none", remote: true, method: :delete, data: { confirm: t('.confirm_hide') } %>
<% end %>
</li>
<% end %>
</ul>
<div id="recordings_pagination" class="row mt-5 justify-content-center">

View File

@@ -1,5 +1,9 @@
<% if broadcast.streamer_recording? && broadcast.active? %>
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"></div>
<% elsif broadcast.director_mode_video_embed.present? && params[:director_mode] == "true" %>
<div class="embed-responsive-item" data-video-type="stream">
<%= raw broadcast.director_mode_video_embed %>
</div>
<% else %>
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream">
<table class="w-100 h-100 bg-secondary">
@@ -12,4 +16,4 @@
</tbody>
</table>
</div>
<% end %>
<% end %>

View File

@@ -39,6 +39,15 @@
<%= link_to broadcast.name.titleize, broadcast.url, data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
<% end %>
<% end %>
<% if @broadcast.director_mode_video_embed.present? %>
<h5 class="dropdown-header">Director Mode</h5>
<% unless params[:director_mode] %>
<%= link_to "Enable Director Mode", url_for(params.permit!.merge(director_mode: true)), class: "dropdown-item" %>
<% else %>
<%= link_to "Disable Director Mode", url_for(params.permit!.except(:director_mode)), class: "dropdown-item" %>
<% end %>
<% end %>
<h5 class="dropdown-header">Previous Sessions</h5>
<div id="broadcast_recordings_nav">
<% if @recordings.any? %>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
<title>BiGMedia.ai App</title>
<title>MESuite.ai App</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
<title>BiGMedia.ai App</title>
<title>MESuite.ai App</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

View File

@@ -16,10 +16,10 @@
<% end %>
</td>
<td>
<%= location_release.name %>
<%= contact_info(name: location_release.name, address: location_release.address) %>
</td>
<td>
<%= contact_info address: location_release.address %>
<%= contact_info_for(location_release.contact_person) %>
</td>
<td>
<%= notes_preview location_release.notes.order_by_recent %>

View File

@@ -28,8 +28,8 @@
<th data-behavior="all-selectable"><%= check_box_tag "location_release_ids[]", false, false %></th>
<th><%= t '.table_headers.approved'%></th>
<th></th>
<th><%= t(".table_headers.name") %></th>
<th><%= t(".table_headers.address") %>
<th><%= t(".table_headers.location_info") %></th>
<th><%= t(".table_headers.owner_info") %>
<th><%= t(".table_headers.notes") %></th>
<th><%= t(".table_headers.tags") %></th>
<th><%= t(".table_headers.signed_at") %></th>

View File

@@ -8,6 +8,10 @@
<div class="card-body">
<%= errors_summary_for @release %>
<%= bootstrap_form_with model: @release, method: :post, url: public_send("account_project_contract_template_#{@contract_template.release_type}_release_amendments_path"), local: true do |form| %>
<%= card_field_set_tag t('.signed_contract_preview') do %>
<embed class="embeded-contract-preview" type="application/pdf" src="<%= url_for([@release, :contracts, format: "pdf"]) %>" width="80%" height="1200" />
<% end %>
<%= card_field_set_tag t(".amendment.heading") do %>
<p><%= @contract_template.amendment_clause %></p>
<% end %>

View File

@@ -10,5 +10,5 @@
</p>
<p>
If you have questions about how to use the software, please visit <%= link_to "BiGMedia.ai", "https://www.bigmedia.ai/contact" %>.
If you have questions about how to use the software, please visit <%= link_to "MESuite.ai", "https://www.mesuite.ai/contact" %>.
</p>

View File

@@ -7,4 +7,4 @@ Please click below to set your password.
<%= edit_password_reset_url(id: @user.password_reset_token, host: AppHost.new.domain_with_port) %>
<% end %>
If you have questions about how to use the software, please visit https://www.bigmedia.ai/contact.
If you have questions about how to use the software, please visit https://www.mesuite.ai/contact.

View File

@@ -111,6 +111,11 @@ en:
application:
header:
sign_out: Sign Out
broadcasts:
edit:
heading: Edit Broadcast
update:
notice: The broadcast has been updated
task_requests:
index:
empty: Task requests will appear here
@@ -218,6 +223,8 @@ en:
broadcast:
actions:
manage: Manage
broadcast_recordings:
confirm_hide: Are you sure you want to hide this recording from everyone?
create:
notice: A live stream has been created
destroy:
@@ -841,11 +848,11 @@ en:
search: Search
empty: Location Releases will appear here
table_headers:
address: Address
amendment_signed: Amendment
approved: Approved
name: Location Name
location_info: Location Info
notes: Notes
owner_info: Owner Info
signed_at: Date Signed
tags: Tags
location_release:
@@ -1138,6 +1145,7 @@ en:
copy_url: Copy sign amendment URL
signature:
heading: Signature
signed_contract_preview: Signed Contract Preview
appearance_releases:
create:
notice: Your release has been signed. Thank you!

View File

@@ -504,6 +504,7 @@ es:
copy_url: Copy sign amendment URL (ES)
signature:
heading: Signature (ES)
signed_contract_preview: Signed Contract Preview (ES)
appearance_releases:
create:
notice: La autorización está firmada. ¡Gracias!

View File

@@ -35,6 +35,7 @@ Rails.application.routes.draw do
resource :masquerade, only: :create
end
resources :task_requests, only: [:index, :edit, :update, :show]
resources :broadcasts, only: [:edit, :update]
root to: "accounts#index", as: :signed_in_root
end
@@ -100,6 +101,7 @@ Rails.application.routes.draw do
delete :destroy_file
end
resource :zoom_meeting, only: [:show]
resources :broadcast_recordings, only: :destroy
end
resources :directories, except: [:index] do
member do

View File

@@ -0,0 +1,5 @@
class AddHiddenFieldToBroadcastRecordings < ActiveRecord::Migration[6.0]
def change
add_column :broadcast_recordings, :hidden, :boolean, default: false
end
end

View File

@@ -0,0 +1,7 @@
class AddStreamAndKeyOverrideToBroadcasts < ActiveRecord::Migration[6.0]
def change
add_column :broadcasts, :stream_url_override, :string
add_column :broadcasts, :stream_key_override, :string
add_column :broadcasts, :youtube_uid, :string
end
end

View File

@@ -0,0 +1,5 @@
class RemoveYoutubeUidFromBroadcasts < ActiveRecord::Migration[6.0]
def change
remove_column :broadcasts, :youtube_uid, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddDirectorModeVideoEmbedToBroadcasts < ActiveRecord::Migration[6.0]
def change
add_column :broadcasts, :director_mode_video_embed, :text
end
end

View File

@@ -9,20 +9,6 @@ SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
--
@@ -536,7 +522,8 @@ CREATE TABLE public.broadcast_recordings (
file_name character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
duration double precision
duration double precision,
hidden boolean DEFAULT false
);
@@ -576,7 +563,10 @@ CREATE TABLE public.broadcasts (
token character varying,
streamer_status integer DEFAULT 0,
shoot_location_time_zone character varying DEFAULT 'UTC'::character varying,
full_live_stream_playback_uid character varying
full_live_stream_playback_uid character varying,
stream_url_override character varying,
stream_key_override character varying,
director_mode_video_embed text
);
@@ -1475,6 +1465,7 @@ CREATE TABLE public.settings (
--
CREATE SEQUENCE public.settings_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -1510,6 +1501,7 @@ CREATE TABLE public.taggings (
--
CREATE SEQUENCE public.taggings_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -1540,6 +1532,7 @@ CREATE TABLE public.tags (
--
CREATE SEQUENCE public.tags_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -3998,7 +3991,11 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200720051634'),
('20200720131309'),
('20200721140821'),
('20200724084722'),
('20200725231419'),
('20200727143209');
('20200727143209'),
('20200730050903'),
('20200803145912'),
('20200803150138');

View File

@@ -35,7 +35,7 @@ RSpec.describe BroadcastsChannel, type: :channel do
describe '#stream_recording_ready' do
it 'broadcasts to the channel with the right data' do
create_list(:broadcast_recording, 1, broadcast: broadcast)
recordings = broadcast.broadcast_recordings.paginate(page: 1)
recordings = broadcast.broadcast_recordings.visible.paginate(page: 1)
flash_message = OpenStruct.new(notice: 'Hello world', alert: nil)
flash_content = ApplicationController.render partial: 'application/flash', locals: { flash: flash_message }
recordings_content = ApplicationController.render partial: 'broadcasts/broadcast_recordings', locals: { recordings: recordings, broadcast: broadcast }

View File

@@ -116,6 +116,16 @@ RSpec.describe Admin::AccountsController, type: :controller do
expect(response.body).to have_link("2", href: admin_account_path(current_user.primary_account, page: 2))
end
it "paginates the broadcast list" do
allow(MuxLiveStream).to receive(:new).and_return(double(id: "id", key: "key", playback_id: "playback_id"))
project = create(:project, account: current_user.primary_account)
create_list(:broadcast, 20, project: project )
get :show, params: { id: current_user.primary_account }
expect(response.body).to have_link("2", href: admin_account_path(current_user.primary_account, page: 2))
end
it "filters the videos by a query param" do
project = create(:project, account: current_user.primary_account)
create(:video, project: project, name: "First video")

View File

@@ -0,0 +1,77 @@
require "rails_helper"
RSpec.describe Admin::BroadcastsController, type: :controller do
render_views
let!(:current_user) { create(:user, :admin) }
before do
sign_in(current_user)
allow(MuxLiveStream).to receive(:new).and_return(double(id: "id", key: "key", playback_id: "playback_id"))
end
describe "#edit" do
let(:broadcast) { create(:broadcast) }
it "returns a successful response" do
get :edit, params: { id: broadcast }
expect(response).to be_successful
end
it "assigns broadcast" do
get :edit, params: { id: broadcast }
expect(assigns(:broadcast)).to eq broadcast
end
end
describe "#update" do
let(:broadcast) { create(:broadcast) }
it "redirects to broadcasts page" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(response).to be_redirect
expect(response).to redirect_to [:admin, broadcast.project.account]
end
it "sets a flash notice" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(flash.notice).to eq "The broadcast has been updated"
end
it "updates the broadcast record" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(assigns(:broadcast)).to have_attributes(
stream_url_override: "https://example.com/streams/abcd",
stream_key_override: "abcdef",
)
end
context "when record cannot be saved" do
before do
allow_any_instance_of(Broadcast).to receive(:update).and_return(false)
end
it "re-displays the form" do
patch :update, params: { id: broadcast, broadcast: broadcast_update_params }
expect(response).to be_successful
expect(flash.notice).to be_nil
end
end
end
private
def broadcast_update_params
{
stream_url_override: "https://example.com/streams/abcd",
stream_key_override: "abcdef",
director_mode_video_embed: "<iframe>Video player</iframe>",
}
end
end

View File

@@ -0,0 +1,30 @@
require 'rails_helper'
RSpec.describe BroadcastRecordingsController, type: :controller do
render_views
let(:user) { create(:user) }
let(:account) { user.primary_account }
let(:project) { create(:project, account: user.primary_account) }
before do
sign_in user
end
describe "#destroy" do
let(:broadcast) { create(:broadcast, project: project, name: "New Broadcast") }
let(:recording) { create(:broadcast_recording, broadcast: broadcast) }
before do
allow(MuxLiveStream).to receive(:new).and_return(double(id: "id", key: "key", playback_id: "playback_id"))
end
it "hides the broadcast recording" do
expect(recording.hidden).to be false
post :destroy, params: { project_id: project, broadcast_id: broadcast, id: recording }, xhr: true
expect(recording.reload.hidden).to be true
end
end
end

View File

@@ -184,6 +184,35 @@ RSpec.describe BroadcastsController, type: :controller do
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: recording.download_file_name)
end
end
context "when virtual director video embed is available" do
let(:broadcast) { create(:broadcast, project: project, name: "Another Broadcast",
director_mode_video_embed: "<iframe>video player</iframe>") }
it "renders the view dropdown with a director mode enable option" do
get :show, params: { project_id: project, id: broadcast }
expect(response.body).to have_content "Switch View"
expect(response.body).to have_selector(".dropdown-menu h5.dropdown-header", text: "Director Mode")
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: "Enable Director Mode")
end
context "when director mode is enabled" do
it "shows the video embed" do
get :show, params: { project_id: project, id: broadcast, director_mode: true }
expect(response.body).to have_selector("iframe", text: "video player")
end
it "renders the view dropdown with a director mode disable option" do
get :show, params: { project_id: project, id: broadcast, director_mode: true }
expect(response.body).to have_content "Switch View"
expect(response.body).to have_selector(".dropdown-menu h5.dropdown-header", text: "Director Mode")
expect(response.body).to have_selector(".dropdown-menu a.dropdown-item", text: "Disable Director Mode")
end
end
end
end
describe "#update" do

View File

@@ -3,6 +3,7 @@ FactoryBot.define do
association :broadcast
file_name "high.mp4"
asset_uid "asset_uid"
asset_playback_uid "asset_playback_uid"
asset_playback_uid "asset_playback_uid"
hidden { false }
end
end

View File

@@ -16,6 +16,17 @@ FactoryBot.define do
streamer_status "idle"
end
trait :with_overriden_stream do
stream_uid "mux_stream"
stream_key "mux_key"
stream_playback_uid "mux_playback_id"
full_live_stream_playback_uid "full_live_stream_playback_uid"
status "created"
streamer_status "idle"
stream_url_override "overriden_stream_url"
stream_key_override "overriden_stream_key"
end
trait :with_files do
files do
[

View File

@@ -3,6 +3,7 @@
require 'rails_helper'
feature 'User managing broadcasts' do
let(:current_user) { create(:user, :manager) }
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
@@ -50,7 +51,7 @@ feature 'User managing broadcasts' do
scenario 'visit show page of broadcast', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_1")
visit project_broadcast_path(project, broadcast)
@@ -204,6 +205,24 @@ feature 'User managing broadcasts' do
end
end
scenario 'project manager can hide broadcast recordings', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
visit project_broadcast_path(project, broadcast)
click_on 'Previous Sessions'
expect(page).to have_content(recording.download_file_name)
expect(page).to have_content('Hide')
accept_alert do
click_link "Hide"
end
expect(page).not_to have_content(recording.download_file_name)
expect(page).to have_content("Recording of the live stream will appear here")
end
context 'When the user is associate' do
let(:current_user) { create(:user, :associate) }
@@ -221,6 +240,17 @@ feature 'User managing broadcasts' do
expect(page).to have_content delete_file_button, count: 0
end
scenario 'associate does not see hide button in front of recording' do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
visit project_broadcast_path(project, broadcast)
click_on 'Previous Sessions'
expect(page).to have_content(recording.download_file_name)
expect(page).not_to have_content('Hide')
end
end
context 'When the user is account manager' do
@@ -247,6 +277,24 @@ feature 'User managing broadcasts' do
expect(page).to have_content delete_file_button, count: 2
expect(Broadcast.find(broadcast.id).files.count).to eq 2
end
scenario 'account manager can hide broadcast recordings', js: true do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
visit project_broadcast_path(project, broadcast)
click_on 'Previous Sessions'
expect(page).to have_content(recording.download_file_name)
expect(page).to have_content('Hide')
accept_alert do
click_link "Hide"
end
expect(page).not_to have_content(recording.download_file_name)
expect(page).to have_content("Recording of the live stream will appear here")
end
end
end

View File

@@ -251,6 +251,9 @@ feature "User managing location releases" do
new_window = window_opened_by { click_link sign_amendment_link }
within_window new_window do
expect(page).to have_content amendments_heading
expect(page).to have_content signed_contract_preview.upcase
expect(page).to have_selector 'embed'
fill_in amendment_signer_name_field, with: 'Big Signer'
draw_signature file_fixture("signature.png"), amendment_signature_field
@@ -690,6 +693,10 @@ feature "User managing location releases" do
t 'public.amendments.new.amendment.heading'
end
def signed_contract_preview
t 'public.amendments.new.signed_contract_preview'
end
def amendment_signer_name_field
'location_release[amendment_signer_name]'
end
@@ -741,8 +748,8 @@ feature "User managing location releases" do
def table_headers
[
t('location_releases.index.table_headers.approved'),
t('location_releases.index.table_headers.name'),
t('location_releases.index.table_headers.address'),
t('location_releases.index.table_headers.location_info'),
t('location_releases.index.table_headers.owner_info'),
t('location_releases.index.table_headers.notes'),
t('location_releases.index.table_headers.tags'),
t('location_releases.index.table_headers.signed_at'),

View File

@@ -40,7 +40,7 @@ feature "User managing videos" do
expect(page).to have_selector "#video_edl_file", visible: :all
expect(page).to have_selector "#video_graphics_only_edl_file", visible: :all
expect(page).to have_selector "#video_audio_only_edl_file", visible: :all
expect(page).to have_link "click here", href: /mailto:info@bigmedia\.ai/
expect(page).to have_link "click here", href: /mailto:info@mesuite\.ai/
fill_in_video_fields name: "New name", number: "99"

View File

@@ -8,7 +8,7 @@ RSpec.describe MailHelper, type: :helper do
link = CGI.unescape helper.mail_to_for_multiple_edls("test content", project)
expect(link).to match "test content"
expect(link).to match "info@bigmedia.ai"
expect(link).to match "info@mesuite.ai"
expect(link).to match /Multiple Adobe Premiere EDLs needed for Test Account's Test Project project/
expect(link).to match "INSTRUCTIONS"
end

View File

@@ -8,8 +8,8 @@ RSpec.describe AdminMailer do
it "renders the headers" do
expect(mail.subject).to eq("[New Video] Test Account has uploaded a new video")
expect(mail.to).to eq(["bray@bigmedia.ai", "lee@bigmedia.ai"])
expect(mail.from).to eq(["support@bigmedia.ai"])
expect(mail.to).to eq(["bray@mesuite.ai"])
expect(mail.from).to eq(["support@mesuite.ai"])
end
it "renders the body" do
@@ -24,8 +24,8 @@ RSpec.describe AdminMailer do
it "renders the headers" do
expect(mail.subject).to eq("[Updated Video EDL File] Test Account has updated the EDL file for video_file.mp4")
expect(mail.to).to eq(["bray@bigmedia.ai", "lee@bigmedia.ai"])
expect(mail.from).to eq(["support@bigmedia.ai"])
expect(mail.to).to eq(["bray@mesuite.ai"])
expect(mail.from).to eq(["support@mesuite.ai"])
end
it "renders the body" do
@@ -41,8 +41,8 @@ RSpec.describe AdminMailer do
it "renders the headers" do
expect(mail.subject).to eq("[Updated Video Graphics Only EDL File] Test Account has updated the Graphics Only EDL file for video_file.mp4")
expect(mail.to).to eq(["bray@bigmedia.ai", "lee@bigmedia.ai"])
expect(mail.from).to eq(["support@bigmedia.ai"])
expect(mail.to).to eq(["bray@mesuite.ai"])
expect(mail.from).to eq(["support@mesuite.ai"])
end
it "renders the body" do
@@ -58,8 +58,8 @@ RSpec.describe AdminMailer do
it "renders the headers" do
expect(mail.subject).to eq("[Updated Video Audio Only EDL File] Test Account has updated the Audio Only EDL file for video_file.mp4")
expect(mail.to).to eq(["bray@bigmedia.ai", "lee@bigmedia.ai"])
expect(mail.from).to eq(["support@bigmedia.ai"])
expect(mail.to).to eq(["bray@mesuite.ai"])
expect(mail.from).to eq(["support@mesuite.ai"])
end
it "renders the body" do

View File

@@ -8,7 +8,7 @@ describe UserMailer do
it "renders the headers" do
expect(mail.subject).to eq("Password reset")
expect(mail.to).to eq([user.email])
expect(mail.from).to eq(["support@bigmedia.ai"])
expect(mail.from).to eq(["support@mesuite.ai"])
end
it "renders the body" do
@@ -24,7 +24,7 @@ describe UserMailer do
it "renders the headers" do
expect(mail.subject).to eq("You've been added to a project in the ME Suite")
expect(mail.to).to eq([user.email])
expect(mail.from).to eq(["support@bigmedia.ai"])
expect(mail.from).to eq(["support@mesuite.ai"])
end
it "renders the body" do
@@ -50,7 +50,7 @@ describe UserMailer do
it "renders the headers" do
expect(mail.subject).to eq("Welcome to BiG")
expect(mail.to).to eq([user.email])
expect(mail.from).to eq(["support@bigmedia.ai"])
expect(mail.from).to eq(["support@mesuite.ai"])
end
it "renders the body" do

View File

@@ -32,7 +32,7 @@ describe AppHost do
app_domain = AppHost.new(env, "production")
expect(app_domain.domain).to eq("bigmedia.ai")
expect(app_domain.domain).to eq("mesuite.ai")
end
end
end

View File

@@ -49,6 +49,36 @@ RSpec.describe Broadcast, type: :model do
expect(broadcast).to have_received(:destroy_mux_live_stream)
end
end
context "#stream_server_url" do
it "returns mux stream url when overriden stream url is absent" do
ENV["MUX_BROADCAST_SERVER_URL"] = "mux_stream"
broadcast = create(:broadcast, :with_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_url).to eq("mux_stream")
end
it "returns overriden stream url when it is present" do
ENV["MUX_BROADCAST_SERVER_URL"] = "mux_stream"
broadcast = create(:broadcast, :with_overriden_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_url).to eq("overriden_stream_url")
end
end
context "#stream_server_key" do
it "returns mux stream key when overriden stream key is absent" do
broadcast = create(:broadcast, :with_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_key).to eq("mux_key")
end
it "returns overriden stream key when it is present" do
broadcast = create(:broadcast, :with_overriden_stream, skip_create_callback: true, name: "My Broadcast")
expect(broadcast.stream_server_key).to eq("overriden_stream_key")
end
end
end
describe "#zoom_meeting_url" do