Compare commits

..

6 Commits

Author SHA1 Message Date
Bilal
b3747f51fc rebase 2020-07-22 13:48:47 +02:00
Bilal
7089bef0d3 fix MR comments 2020-07-22 13:47:56 +02:00
Bilal
209da288dc fix MR comments 2020-07-22 13:47:56 +02:00
Bilal
1a2b6c8be3 update specs 2020-07-22 13:47:56 +02:00
Bilal
48a25e266d add spec 2020-07-22 13:43:18 +02:00
Bilal
2568383352 use full live stream url 2020-07-22 13:43:18 +02:00
5 changed files with 11252 additions and 7 deletions

View File

@@ -21,11 +21,10 @@ $(document).on "turbolinks:load", ->
refreshBroadcastVideo: (data) ->
$("#broadcast_updates").html data.status_content
stream_selected = $("#broadcast_video").data('videoType') == 'stream';
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)(
<%= "baseUrl: 'http://cdn.clappr.io/latest'," if Rails.env.test? %>
parentId: '#broadcast_video'
source: data.full_live_stream_playback_url
width: '100%',

View File

@@ -3,7 +3,7 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
return false;
}
$("#broadcast_video").data('videoType', 'recording');
$("#broadcast_video").attr('video-type', 'recording');
var playback_url = $(this).attr("data-playback-url")
$("#broadcast_video").empty();
@@ -25,4 +25,4 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
$(this).prepend('<i class="fa fa-check">&nbsp;</i>');
});
$(document).on("click", "[data-behavior=play_stream]", function() { $("#broadcast_video").data('videoType', 'stream'); });
$(document).on("click", "[data-behavior=play_stream]", function() { $("#broadcast_video").attr('video-type', 'stream'); });

View File

@@ -1,7 +1,7 @@
<% if broadcast.streamer_recording? && broadcast.active? %>
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"></div>
<div id="broadcast_video" class="embed-responsive-item"></div>
<% else %>
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream">
<div id="broadcast_video" class="embed-responsive-item">
<table class="w-100 h-100 bg-secondary">
<tbody>
<tr>

11246
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -93,7 +93,7 @@ feature 'User managing broadcasts' do
BroadcastsChannel.broadcast_stream_updates(broadcast)
expect(page).to have_content stream_begun_message
expect(page).to have_selector('div#broadcast_video', count: 2)
expect(page).to have_selector('div#broadcast_video', count: 1)
broadcast.streamer_status = :idle
broadcast.status = :idle