Files
old-holivud2/app/assets/javascripts/stream_player.js.erb

30 lines
923 B
Plaintext
Raw Normal View History

2020-06-30 05:07:43 +02:00
$(document).on("click", "[data-behavior=play_recording]", function() {
2020-09-09 18:40:38 +03:00
clearPlayingHighlight();
$(this).parent().parent().addClass('playing-highlight');
2020-07-27 10:17:56 +00:00
$("#broadcast_video").data('videoType', 'recording');
2020-06-30 05:07:43 +02:00
var playback_url = $(this).attr("data-playback-url")
$("#broadcast_video").empty();
new Clappr.Player({
<%= "baseUrl: 'http://cdn.clappr.io/latest'," if Rails.env.test? %>
parentId: '#broadcast_video',
source: playback_url,
width: '100%',
height: '100%',
autoPlay: true
});
2020-07-20 13:28:40 +00:00
});
2020-09-09 18:40:38 +03:00
$(document).on("click", "[data-behavior=play_stream]", function() {
// clearPlayingHighlight();
$("#broadcast_video").data('videoType', 'stream');
});
function clearPlayingHighlight() {
// $(".playing-highlight").each(e => {
// $(e).removeClass('playing-highlight');
// });
$(".playing-highlight").removeClass("playing-highlight");
}