Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
feat(frontend:files): disable sidebar media autoplay and simplify controls
johaven98a6346b60f4
diff --git a/frontend/src/app/applications/files/components/sidebar/files-selection.component.html b/frontend/src/app/applications/files/components/sidebar/files-selection.component.htmlindex d9dea001..1d0e8908 100644--- a/frontend/src/app/applications/files/components/sidebar/files-selection.component.html+++ b/frontend/src/app/applications/files/components/sidebar/files-selection.component.html@@ -31,7 +31,7 @@</div>}@case ('media') {- <app-files-viewer-media [currentHeight]="cardImageSize" [file]="f"></app-files-viewer-media>+ <app-files-viewer-media [currentHeight]="cardImageSize" [file]="f" [sidebarMode]="true"></app-files-viewer-media>}@default {<img [src]="f.mimeUrl" alt="" [style.height.px]="cardImageSize" (error)="f.fallBackMimeUrl()">@@ -175,4 +175,3 @@}</div>}-diff --git a/frontend/src/app/applications/files/components/viewers/files-viewer-media.component.ts b/frontend/src/app/applications/files/components/viewers/files-viewer-media.component.tsindex 65b91239..6974f8f1 100755--- a/frontend/src/app/applications/files/components/viewers/files-viewer-media.component.ts+++ b/frontend/src/app/applications/files/components/viewers/files-viewer-media.component.ts@@ -99,11 +99,11 @@ const PlyrPlayer = plyrModule.default ?? plyrModuletemplate: `<div class="files-viewer-media" [class.files-viewer-media--audio]="isAudio()" [style.height.px]="currentHeight()">@if (isAudio()) {- <audio #media class="files-viewer-media__player" preload="none" autoplay controls>+ <audio #media class="files-viewer-media__player" preload="none" [autoplay]="!sidebarMode()" controls><source [src]="file().dataUrl" /></audio>} @else {- <video #media class="files-viewer-media__player" preload="none" autoplay playsinline controls>+ <video #media class="files-viewer-media__player" preload="none" [autoplay]="!sidebarMode()" playsinline controls><source [src]="file().dataUrl" /></video>}@@ -113,6 +113,7 @@ const PlyrPlayer = plyrModule.default ?? plyrModuleexport class FilesViewerMediaComponent implements AfterViewInit, OnDestroy {file = input.required<FileModel>()currentHeight = input<number>()+ sidebarMode = input(false)protected readonly isAudio = computed(() => {const mime = this.file().mime?.trim().toLowerCase()if (!mime) return false@@ -122,15 +123,21 @@ export class FilesViewerMediaComponent implements AfterViewInit, OnDestroy {private player?: PlyrInstancengAfterViewInit() {- this.player = new PlyrPlayer(this.media().nativeElement, {- autoplay: true,+ const sidebarMode = this.sidebarMode()+ const options: PlyrOptions = {+ autoplay: !sidebarMode,blankVideo: 'assets/plyr/blank.mp4',- controls: ['play-large', 'play', 'progress', 'current-time', 'duration', 'mute', 'volume', 'settings', 'pip', 'airplay', 'fullscreen'],+ controls: sidebarMode+ ? ['play', 'progress', 'fullscreen']+ : ['play-large', 'play', 'progress', 'current-time', 'duration', 'mute', 'volume', 'settings', 'pip', 'airplay', 'fullscreen'],iconUrl: 'assets/plyr/plyr.svg',- keyboard: { focused: true, global: true },- settings: ['speed', 'loop'],- speed: { selected: 1, options: [0.5, 0.75, 1, 1.25, 1.5, 2] }- })+ keyboard: { focused: true, global: true }+ }+ if (!sidebarMode) {+ options.settings = ['speed', 'loop']+ options.speed = { selected: 1, options: [0.5, 0.75, 1, 1.25, 1.5, 2] }+ }+ this.player = new PlyrPlayer(this.media().nativeElement, options)}ngOnDestroy() {diff --git a/frontend/src/assets/mimes/video-mp2t.svg b/frontend/src/assets/mimes/video-mp2t.svgnew file mode 100644index 00000000..0fb879e7--- /dev/null+++ b/frontend/src/assets/mimes/video-mp2t.svg@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="utf-8"?>+<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">+ <defs/>+ <g fill-opacity=".078">+ <path d="m32.563 0c-4.774 0-8.594 3.266-8.594 7.313v497.38c0 4.047 3.82 7.313 8.594 7.313h446.88c4.774 0 8.594-3.266 8.594-7.313v-360.03l-144.66-144.66h-310.81"/>+ <path d="m35.625 3.5c-4.709 0-8.5 3.196-8.5 7.188v490.62c0 3.991 3.791 7.188 8.5 7.188h440.75c4.709 0 8.5-3.196 8.5-7.188v-356.28l-141.53-141.53h-307.72"/>+ <path d="m38.688 7c-4.643 0-8.375 3.158-8.375 7.094v483.82c0 3.936 3.732 7.094 8.375 7.094h434.63c4.643 0 8.375-3.158 8.375-7.094v-352.62l-138.28-138.28h-304.72"/>+ </g>+ <path d="m41.719 10.5c-4.578 0-8.25 3.119-8.25 7v477c0 3.881 3.672 7 8.25 7h428.56c4.578 0 8.25-3.119 8.25-7v-348.06l-135.97-135.94h-300.84" fill="#4700b3"/>+ <path d="m63.47 24.03v16.16h44.531v-16.16h-44.531m0 47.22v35.688h44.531v-35.688h-44.531m0 66.72v35.75h44.531v-35.75h-44.531m340.53 8.469v27.28h44.531v-27.28h-44.531m-340.53 58.28v35.75h44.531v-35.75h-44.531m340.53 0v35.75h44.531v-35.75h-44.531m-340.53 66.781v35.688h44.531v-35.688h-44.531m340.53 0v35.688h44.531v-35.688h-44.531m-340.53 66.781v35.656h44.531v-35.656h-44.531m340.53 0v35.656h44.531v-35.656h-44.531m-340.53 66.72v35.719h44.531v-35.719h-44.531m340.53 0v35.719h44.531v-35.719h-44.531m-340.53 66.75v16.219h44.531v-16.219h-44.531m340.53 0v16.219h44.531v-16.219h-44.531" fill="#fff"/>+ <path opacity=".25" d="m174.63 194.59c-22.467 0-40.563 18.06-40.563 40.531v108.41c0 7.971 9.776 17.931 16.16 32.25l136.72 125.72h183.34c4.578 0 8.25-3.119 8.25-7v-175.62l-112.44-112.44c-7.33-7.33-17.485-11.844-28.719-11.844h-162.75"/>+ <path d="m174.62 194.58h162.77c22.467 0 40.554 18.09 40.554 40.554v108.4c0 22.467-18.09 40.554-40.554 40.554h-162.77c-22.467 0-40.554-18.09-40.554-40.554v-108.4c0-22.467 18.09-40.554 40.554-40.554" fill="#fff"/>+ <path d="m220.44 235.74a11.806 11.806 0 0 0 -11.094 11.812v83.56a11.806 11.806 0 0 0 17.875 10.125l69.72-41.781a11.806 11.806 0 0 0 0 -20.25l-69.72-41.781a11.806 11.806 0 0 0 -5.5938 -1.6875 11.806 11.806 0 0 0 -1.1875 0" fill="#5c00e6"/>+ <path id="0" fill-opacity=".196" fill="#fff" d="m478.53 146.44l-135.97-135.94v128.94c0 3.881 3.672 7 8.25 7h127.72"/>+ <path d="m478.53 146.44-135.97-135.94 215.95 215.95 135.97 135.94z" fill-opacity=".196"/>+ <use width="1" height="1" xlink:href="#0"/>+ <path d="m345.03 144.56l133.5 129.38v-127.5h-127.72c-2.185 0-4.154-0.71-5.625-1.875h-0.156" fill-opacity=".196"/>+</svg>\ No newline at end of file