Compare commits
5 Commits
improve-do
...
do-not-cha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe61e5bc47 | ||
|
|
d9f5e2cd10 | ||
|
|
a076edcf8b | ||
|
|
dcc1d098d2 | ||
|
|
830a5eb3e4 |
@@ -21,7 +21,8 @@ $(document).on "turbolinks:load", ->
|
||||
|
||||
refreshBroadcastVideo: (data) ->
|
||||
$("#broadcast_updates").html data.status_content
|
||||
if data.streamer_status == 'recording' && data.status == 'active'
|
||||
stream_selected = $("#broadcast_video").attr('video-type') == 'stream';
|
||||
if data.streamer_status == 'recording' && data.status == 'active' && stream_selected
|
||||
$("#broadcast_video").html data.video_content
|
||||
new (Clappr.Player)(
|
||||
parentId: '#broadcast_video'
|
||||
|
||||
@@ -3,7 +3,7 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
|
||||
return false;
|
||||
}
|
||||
|
||||
console.warn('Play prev : ', playback_url);
|
||||
$("#broadcast_video").attr('video-type', 'recording');
|
||||
|
||||
var playback_url = $(this).attr("data-playback-url")
|
||||
$("#broadcast_video").empty();
|
||||
@@ -23,4 +23,6 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
|
||||
$(this).siblings().children("i").remove();
|
||||
$(this).addClass('active');
|
||||
$(this).prepend('<i class="fa fa-check"> </i>');
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("click", "[data-behavior=play_stream]", function() { $("#broadcast_video").attr('video-type', 'stream'); });
|
||||
@@ -33,10 +33,10 @@
|
||||
<%= link_to "Switch View", "#", class: "btn btn-light border dropdown-toggle", role: "button", id: "dropdownMenuLink", data: { toggle: "dropdown" }, aria: { haspopup: "true", expanded: "false" } %>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
<h5 class="dropdown-header">Live Streams</h5>
|
||||
<%= link_to fa_icon("check", text: @broadcast.name.titleize), "#", class: "dropdown-item active" %>
|
||||
<%= link_to fa_icon("check", text: @broadcast.name.titleize), "#", data: { behavior: "play_stream"}, class: "dropdown-item active" %>
|
||||
<% @multi_view_broadcasts.each do |broadcast| %>
|
||||
<% if broadcast.id != @broadcast.id %>
|
||||
<%= link_to broadcast.name.titleize, broadcast.url, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
|
||||
<%= link_to broadcast.name.titleize, broadcast.url, data: { behavior: "play_stream"}, class: class_string("dropdown-item", "active" => @broadcast.id == broadcast.id) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<h5 class="dropdown-header">Previous Sessions</h5>
|
||||
|
||||
@@ -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: -
|
||||
--
|
||||
|
||||
@@ -78,6 +78,39 @@ feature 'User managing broadcasts' do
|
||||
expect(page).to have_content token_reset_notice
|
||||
end
|
||||
|
||||
scenario 'Player will not reload if stream is reactivated while user is watching previous recording', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
recording = create(:broadcast_recording, broadcast: broadcast)
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_content stream_idle_message
|
||||
|
||||
broadcast.streamer_status = :recording
|
||||
broadcast.status = :active
|
||||
BroadcastsChannel.broadcast_stream_updates(broadcast)
|
||||
|
||||
expect(page).to have_content stream_begun_message
|
||||
expect(page).to have_selector('div#broadcast_video', count: 1)
|
||||
|
||||
broadcast.streamer_status = :idle
|
||||
broadcast.status = :idle
|
||||
BroadcastsChannel.broadcast_stream_updates(broadcast)
|
||||
|
||||
click_on switch_view_dropdown
|
||||
click_on recording.download_file_name
|
||||
|
||||
expect(page).to have_content stream_idle_message
|
||||
expect(page).to have_selector('div#broadcast_video', count: 1)
|
||||
|
||||
broadcast.streamer_status = :recording
|
||||
broadcast.status = :active
|
||||
BroadcastsChannel.broadcast_stream_updates(broadcast)
|
||||
|
||||
expect(page).to have_content stream_begun_message
|
||||
expect(page).to have_selector('div#broadcast_video', count: 1)
|
||||
end
|
||||
|
||||
scenario 'user can go back and forth between live session and previous sessions', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
recording = create(:broadcast_recording, broadcast: broadcast)
|
||||
@@ -212,4 +245,14 @@ feature 'User managing broadcasts' do
|
||||
def token_reset_notice
|
||||
t 'broadcasts.update.reset_notice'
|
||||
end
|
||||
|
||||
def stream_begun_message
|
||||
'Live stream has begun, click play to watch it'
|
||||
end
|
||||
|
||||
def stream_idle_message
|
||||
'Live stream is waiting to begin'
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user