Skip to content

Commit

Permalink
Merge pull request #5689 from avalonmediasystem/develop
Browse files Browse the repository at this point in the history
Avalon 7.7 RC2
  • Loading branch information
cjcolvar authored Feb 20, 2024
2 parents 8dc1501 + bec737f commit a72bc72
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/models/concerns/master_file_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def stream_details
caption_paths = []
supplemental_file_captions.each { |c| caption_paths.append(build_caption_hash(c)) }

caption_paths.append(build_caption_hash(captions)) if captions
caption_paths.append(build_caption_hash(captions)) if captions.present?

caption_paths
end
Expand Down
11 changes: 11 additions & 0 deletions app/views/media_objects/_thumbnail.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ Unless required by applicable law or agreed to in writing, software distributed
}
clearInterval(timeCheck);
});
/*
Browsers on MacOS sometimes miss the 'loadedmetadata' event resulting in a disabled add to playlist button indefinitely.
This timeout enables the add to playlist button, when this happens. It checks the button's state and enables it as needed.
*/
setTimeout(() => {
let thumbnailBtn = document.getElementById('create-thumbnail-btn');
if (thumbnailBtn && thumbnailBtn.disabled) {
thumbnailBtn.disabled = false;
}
clearInterval(timeCheck);
}, 500);
}

$('#thumbnailModal').on('show.bs.modal', function(e) {
Expand Down
13 changes: 12 additions & 1 deletion app/views/media_objects/_timeline.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,22 @@ $(document).ready(function() {
if(player && player != undefined) {
player.player.on('loadedmetadata', () => {
let timelineBtn = document.getElementById('timelineBtn');
if(timelineBtn) {
if (timelineBtn) {
timelineBtn.disabled = false;
}
clearInterval(timeCheck);
});
/*
Browsers on MacOS sometimes miss the 'loadedmetadata' event resulting in a disabled add to playlist button indefinitely.
This timeout enables the add to playlist button, when this happens. It checks the button's state and enables it as needed.
*/
setTimeout(() => {
let timelineBtn = document.getElementById('timelineBtn');
if (timelineBtn && timelineBtn.disabled) {
timelineBtn.disabled = false;
}
clearInterval(timeCheck);
}, 500);
}

$('#timelineModal').on('shown.bs.modal', function (e) {
Expand Down
27 changes: 15 additions & 12 deletions app/views/modules/player/_video_js_element.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ Unless required by applicable law or agreed to in writing, software distributed
end %>
<% @videojs_options = {
"autoplay": false,
"width": @player_width || 480,
"height": @player_height || 270,
"bigPlayButton": section_info[:is_video] ? true : false,
"poster": section_info[:is_video] ? section_info[:poster_image] : false,
"preload": "auto",
"controlBar": control_bar_options,
"userActions": {
hotkeys: true
}
}.compact.to_json %>
"autoplay": false,
"width": @player_width || 480,
"height": @player_height || 270,
"bigPlayButton": section_info[:is_video] ? true : false,
"poster": section_info[:is_video] ? section_info[:poster_image] : false,
"preload": "auto",
"controlBar": control_bar_options,
"userActions": {
hotkeys: true
}
}.compact.to_json %>

<div class='video-container' style="width:100%; height:100%;">
<video-js id="video-js-embed-<%= @master_file.id %>"
Expand All @@ -64,7 +64,10 @@ Unless required by applicable law or agreed to in writing, software distributed
<% section_info[:stream_hls].each do |hls| %>
<source src="<%= hls[:url] %>" type="application/x-mpegURL" data-quality="<%= hls[:quality] %>" label="<%= hls[:quality] %>"/>
<% end %>
<% if section_info[:caption_paths].present? %>
<%# Captions are contained in the HLS manifest and so we do not need to manually provide them to VideoJS here %>
<%# TODO: Reenable if/when we remove captions from HLS %>
<% skip_captions = true %>
<% if section_info[:caption_paths].present? && !skip_captions %>
<% section_info[:caption_paths].each do |c| %>
<track <% if c[:label] %>label="<%= c[:label] %>" <% end %> srclang="<%= c[:language] %>" kind="subtitles" type="<%= c[:mime_type] %>" src="<%= c[:path] %>"></track>
<% end %>
Expand Down

0 comments on commit a72bc72

Please sign in to comment.