Skip to content

Commit

Permalink
Merge pull request #5723 from avalonmediasystem/audio_thumbnail
Browse files Browse the repository at this point in the history
Disable create thumbnail button for audio items
  • Loading branch information
masaball authored Mar 13, 2024
2 parents 0c9cb61 + 97674d3 commit e62ce52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/views/media_objects/_thumbnail.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Unless required by applicable law or agreed to in writing, software distributed
if (player && player.player != undefined) {
player.player.on('loadedmetadata', () => {
let thumbnailBtn = document.getElementById('create-thumbnail-btn');
if (thumbnailBtn) {
// Leave 'Create Thumbnail' button disabled when item is audio
if (thumbnailBtn && !player.player.isAudio()) {
thumbnailBtn.disabled = false;
}
});
Expand All @@ -67,7 +68,8 @@ Unless required by applicable law or agreed to in writing, software distributed
*/
setTimeout(() => {
let thumbnailBtn = document.getElementById('create-thumbnail-btn');
if (thumbnailBtn && thumbnailBtn.disabled && player.player?.readyState() === 4) {
// Leave 'Create Thumbnail' button disabled when item is audio
if (thumbnailBtn && thumbnailBtn.disabled && player.player?.readyState() === 4 && !player.player.isAudio()) {
thumbnailBtn.disabled = false;
}
}, 100);
Expand Down

0 comments on commit e62ce52

Please sign in to comment.