diff --git a/src/components/pages/playlists/PlaylistPlayer.vue b/src/components/pages/playlists/PlaylistPlayer.vue index 9ea1e3bd69..24d94b550c 100644 --- a/src/components/pages/playlists/PlaylistPlayer.vue +++ b/src/components/pages/playlists/PlaylistPlayer.vue @@ -256,7 +256,7 @@ }" v-show="isCurrentPreviewPicture && !isLoading" > - @@ -959,10 +963,11 @@ import ColorPicker from '@/components/widgets/ColorPicker.vue' import Combobox from '@/components/widgets/Combobox.vue' import ComboboxStyled from '@/components/widgets/ComboboxStyled.vue' import DeleteModal from '@/components/modals/DeleteModal.vue' +import MultiPictureViewer from '@/components/previews/MultiPictureViewer.vue' import ObjectViewer from '@/components/previews/ObjectViewer.vue' import PencilPicker from '@/components/widgets/PencilPicker.vue' -import PictureViewer from '@/components/previews/PictureViewer.vue' import PlaylistedEntity from '@/components/pages/playlists/PlaylistedEntity.vue' +import PictureViewer from '@/components/previews/PictureViewer.vue' import RawVideoPlayer from '@/components/pages/playlists/RawVideoPlayer.vue' import PreviewRoom from '@/components/widgets/PreviewRoom.vue' import SelectTaskTypeModal from '@/components/modals/SelectTaskTypeModal.vue' @@ -988,6 +993,7 @@ export default { ObjectViewer, PencilPicker, PictureViewer, + MultiPictureViewer, PlayIcon, PlaylistedEntity, PreviewRoom, @@ -1146,6 +1152,31 @@ export default { return this.$refs['full-playlist-player'] }, + picturePreviews() { + const picturePreviews = [] + this.entityList.forEach(e => { + picturePreviews.push({ + id: e.preview_file_id, + height: e.preview_file_height, + width: e.preview_file_width, + extension: e.preview_file_extension, + revision: e.preview_file_revision, + position: 1 + }) + e.preview_file_previews.forEach((p, index) => { + picturePreviews.push({ + id: p.id, + height: p.height, + width: p.width, + extension: p.extension, + revision: p.revision, + position: index + 2 + }) + }) + }) + return picturePreviews + }, + isMovieComparison() { if (!this.currentPreviewToCompare) return false return this.currentPreviewToCompare.extension === 'mp4' diff --git a/src/components/pages/playlists/RawVideoPlayer.vue b/src/components/pages/playlists/RawVideoPlayer.vue index 12864c51b4..31ccbb8253 100644 --- a/src/components/pages/playlists/RawVideoPlayer.vue +++ b/src/components/pages/playlists/RawVideoPlayer.vue @@ -337,8 +337,16 @@ export default { ) const rate = this.$options.rate || 1 - this.currentPlayer.src = this.getMoviePath(entity) - this.nextPlayer.src = this.getMoviePath(nextEntity) + if (entity.preview_file_extension === 'mp4' && this.currentPlayer) { + this.currentPlayer.src = this.getMoviePath(entity) + } else if (this.currentPlayer) { + this.currentPlayer.src = '' + } + if (nextEntity.preview_file_extension === 'mp4' && this.nextPlayer) { + this.nextPlayer.src = this.getMoviePath(nextEntity) + } else if (this.nextPlayer) { + this.nextPlayer.src = '' + } this.currentPlayer.style.display = 'block' this.nextPlayer.style.display = 'none' this.resetHeight() diff --git a/src/components/previews/MultiPictureViewer.vue b/src/components/previews/MultiPictureViewer.vue new file mode 100644 index 0000000000..6f5eac0f96 --- /dev/null +++ b/src/components/previews/MultiPictureViewer.vue @@ -0,0 +1,219 @@ + + + + + diff --git a/src/components/previews/PictureViewer.vue b/src/components/previews/PictureViewer.vue index 724b1995a3..be837ce3d3 100644 --- a/src/components/previews/PictureViewer.vue +++ b/src/components/previews/PictureViewer.vue @@ -100,8 +100,16 @@ export default { }, mounted() { + this.container = this.$refs.container + this.picture = this.$refs.picture + this.pictureBig = this.$refs['picture-big'] + this.pictureGif = this.$refs['picture-gif'] + this.pictureWrapper = this.$refs['picture-wrapper'] + this.pictureSubWrapper = this.$refs['picture-subwrapper'] + this.container.style.height = this.defaultHeight + 'px' this.isLoading = true + this.setPictureEmptyPath() if (this.picture.complete) { this.onWindowResize() @@ -133,30 +141,6 @@ export default { computed: { // Elements - container() { - return this.$refs.container - }, - - picture() { - return this.$refs.picture - }, - - pictureBig() { - return this.$refs['picture-big'] - }, - - pictureGif() { - return this.$refs['picture-gif'] - }, - - pictureWrapper() { - return this.$refs['picture-wrapper'] - }, - - pictureSubWrapper() { - return this.$refs['picture-subwrapper'] - }, - status() { return this.preview && this.preview.status ? this.preview.status : 'ready' }, @@ -219,7 +203,8 @@ export default { const dimensions = this.getNaturalDimensions() if (dimensions.width > 0) ratio = dimensions.height / dimensions.width let width = dimensions.width - if (width > this.container.offsetWidth) { + if (width > this.container.offsetWidth && this.container.offsetWidth > 0 + ) { width = this.container.offsetWidth } let height = Math.floor(width * ratio) @@ -237,6 +222,9 @@ export default { // Configuration endLoading() { + if (!this.picture) { + this.picture = this.$refs.picture + } if ( this.fullScreen && (this.pictureBig.complete || this.pictureGif.complete) @@ -256,6 +244,7 @@ export default { if (this.pictureSubWrapper) { this.pictureWrapper.style['max-height'] = heightValue this.pictureSubWrapper.style['max-height'] = heightValue + this.pictureSubWrapper.style['height'] = heightValue } let { width, height } = this.getDimensions() this.picture.style.width = width + 'px' @@ -486,6 +475,8 @@ export default { .picture-subwrapper { position: relative; + display: flex; + align-items: center; } .picture-player {