From f24beaebdef294939e6b6096137174c58d5b2523 Mon Sep 17 00:00:00 2001 From: Frank Rousseau Date: Wed, 20 Sep 2023 10:54:03 +0200 Subject: [PATCH 1/3] [previews] Improve frame number behavior when the tile can't be found --- src/components/previews/VideoProgress.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/previews/VideoProgress.vue b/src/components/previews/VideoProgress.vue index 942b16d024..b9b1d1f233 100644 --- a/src/components/previews/VideoProgress.vue +++ b/src/components/previews/VideoProgress.vue @@ -357,7 +357,9 @@ export default { getFrameNumberStyle(frame) { const frameHeight = 100 const height = frameHeight + 30 - const ratio = this.movieDimensions.width / this.movieDimensions.height + const ratio = this.movieDimensions.width + ? this.movieDimensions.width / this.movieDimensions.height + : 1 const frameWidth = Math.ceil(frameHeight * ratio) const width = frameWidth + 10 const left = Math.min( @@ -383,12 +385,14 @@ export default { }, previewId() { - const path = `/api/movies/tiles/preview-files/${this.previewId}.png` - const img = new Image() - this.isTileLoading = true - img.src = path - img.onload = () => { - this.isTileLoading = false + if (this.movieDimensions.width) { + const path = `/api/movies/tiles/preview-files/${this.previewId}.png` + const img = new Image() + this.isTileLoading = true + img.src = path + img.onload = () => { + this.isTileLoading = false + } } } } From 862224435abeb66a87e74a5ef53f5319b73672c9 Mon Sep 17 00:00:00 2001 From: Frank Rousseau Date: Wed, 20 Sep 2023 10:57:24 +0200 Subject: [PATCH 2/3] [previews] Show better loading indicators for videos --- .../pages/playlists/PlaylistPlayer.vue | 4 +- .../pages/playlists/RawVideoPlayer.vue | 59 +++++++++++++++++-- src/components/previews/ObjectViewer.vue | 2 +- src/components/previews/PreviewPlayer.vue | 1 + src/components/previews/VideoViewer.vue | 30 +++++++--- 5 files changed, 81 insertions(+), 15 deletions(-) diff --git a/src/components/pages/playlists/PlaylistPlayer.vue b/src/components/pages/playlists/PlaylistPlayer.vue index 5c901da1a4..369bc396a0 100644 --- a/src/components/pages/playlists/PlaylistPlayer.vue +++ b/src/components/pages/playlists/PlaylistPlayer.vue @@ -89,7 +89,7 @@ ref="raw-player-comparison" class="raw-player" :style="{ - position: isComparisonOverlay ? 'absolute' : 'static' + position: isComparisonOverlay ? 'absolute' : 'relative' }" :entities="entityListToCompare" :full-screen="fullScreen" @@ -149,7 +149,7 @@ ref="raw-player" class="raw-player" :style="{ - position: isComparisonOverlay ? 'absolute' : 'static', + position: isComparisonOverlay ? 'absolute' : 'relative', opacity: overlayOpacity }" :entities="entityList" diff --git a/src/components/pages/playlists/RawVideoPlayer.vue b/src/components/pages/playlists/RawVideoPlayer.vue index 8b4961b926..8f6a9d10c1 100644 --- a/src/components/pages/playlists/RawVideoPlayer.vue +++ b/src/components/pages/playlists/RawVideoPlayer.vue @@ -1,5 +1,8 @@