From bfa2251d6dcffc943162b9b23e106e2f67b47302 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 8 Apr 2025 08:43:26 +0530 Subject: [PATCH 01/13] Use mc --- .../gallery/components/viewer/photoswipe.ts | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts index 2a42caa492..bd67893146 100644 --- a/web/packages/gallery/components/viewer/photoswipe.ts +++ b/web/packages/gallery/components/viewer/photoswipe.ts @@ -327,7 +327,7 @@ export class FileViewerPhotoSwipe { ); if (itemData.fileType === FileType.video) { - const { videoURL, videoPlaylistURL } = itemData; + const { videoPlaylistURL, videoURL } = itemData; if (videoPlaylistURL) { const mcID = `ente-mc-${file.id}`; return { @@ -335,10 +335,24 @@ export class FileViewerPhotoSwipe { html: hlsVideoHTML(videoPlaylistURL, mcID), mediaControllerID: mcID, }; + } else if ( + videoURL && + // TODO(HLS): + process.env.NEXT_PUBLIC_ENTE_WIP_VIDEO_STREAMING + ) { + const mcID = `ente-mc-${file.id}`; + return { + ...itemData, + html: videoHTML(videoURL, mcID), + mediaControllerID: mcID, + }; } else if (videoURL) { return { ...itemData, - html: videoHTML(videoURL, !!disableDownload), + html: videoHTMLBrowserControls( + videoURL, + !!disableDownload, + ), }; } } @@ -1341,7 +1355,7 @@ export class FileViewerPhotoSwipe { refreshCurrentSlideFavoriteButtonIfNeeded: () => void; } -const videoHTML = (url: string, disableDownload: boolean) => ` +const videoHTMLBrowserControls = (url: string, disableDownload: boolean) => `