From bc2bed518a47b63b279d2e7500caea906439cc5b Mon Sep 17 00:00:00 2001 From: SuslikV Date: Tue, 25 Feb 2020 20:04:07 +0200 Subject: [PATCH 1/2] Add thumbnail to the audio only clip If image is not present in audio file the thumbnail is still needed, otherwise it will be rendered as black rectangle in the Timeline. --- src/timeline/js/controllers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/timeline/js/controllers.js b/src/timeline/js/controllers.js index d24cd368d0..f4b2eef299 100644 --- a/src/timeline/js/controllers.js +++ b/src/timeline/js/controllers.js @@ -754,6 +754,10 @@ App.controller('TimelineCtrl',function($scope) { // Format the thumbnail path: http://127.0.0.1:8081/thumbnails/FILE-ID/FRAME-NUMBER/ $scope.GetThumbPath = function(clip) { + var has_video = clip["reader"]["has_video"]; + var has_audio = clip["reader"]["has_audio"]; + if (!has_video && has_audio) + return "../images/AudioThumbnail.png" var file_fps = clip["reader"]["fps"]["num"] / clip["reader"]["fps"]["den"]; return $scope.ThumbServer + clip.file_id + "/" + ((file_fps * clip.start) + 1) + "/"; }; From 0a45fae3b30f7f4f99a68fd9c22e7ccbf13bb2ea Mon Sep 17 00:00:00 2001 From: SuslikV Date: Wed, 26 Feb 2020 09:20:12 +0200 Subject: [PATCH 2/2] Add missing semicolon --- src/timeline/js/controllers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timeline/js/controllers.js b/src/timeline/js/controllers.js index f4b2eef299..499657e949 100644 --- a/src/timeline/js/controllers.js +++ b/src/timeline/js/controllers.js @@ -757,7 +757,7 @@ App.controller('TimelineCtrl',function($scope) { var has_video = clip["reader"]["has_video"]; var has_audio = clip["reader"]["has_audio"]; if (!has_video && has_audio) - return "../images/AudioThumbnail.png" + return "../images/AudioThumbnail.png"; var file_fps = clip["reader"]["fps"]["num"] / clip["reader"]["fps"]["den"]; return $scope.ThumbServer + clip.file_id + "/" + ((file_fps * clip.start) + 1) + "/"; };