diff --git a/web/packages/gallery/components/viewer/FileViewer.tsx b/web/packages/gallery/components/viewer/FileViewer.tsx index 0a38efb4b5..f4decd4ce5 100644 --- a/web/packages/gallery/components/viewer/FileViewer.tsx +++ b/web/packages/gallery/components/viewer/FileViewer.tsx @@ -28,7 +28,7 @@ import { useIsSmallWidth } from "ente-base/components/utils/hooks"; import { type ModalVisibilityProps } from "ente-base/components/utils/modal"; import { useBaseContext } from "ente-base/context"; import { lowercaseExtension } from "ente-base/file-name"; -import { formattedListJoin, ut } from "ente-base/i18n"; +import { formattedListJoin, pt, ut } from "ente-base/i18n"; import type { LocalUser } from "ente-base/local-user"; import log from "ente-base/log"; import { @@ -45,6 +45,7 @@ import { ImageEditorOverlay, type ImageEditorOverlayProps, } from "ente-new/photos/components/ImageEditorOverlay"; +import { settingsSnapshot } from "ente-new/photos/services/settings"; import { t } from "i18next"; import React, { useCallback, @@ -1151,8 +1152,22 @@ const Shortcuts: React.FC = ({ + { + /* TODO(HLS): */ + settingsSnapshot().isInternalUser && ( + + ) + } = ({ action={t("pan")} shortcut={formattedListJoin([ut("W A S D"), t("drag")])} /> + { + /* TODO(HLS): */ + settingsSnapshot().isInternalUser && ( + + ) + } {haveUser && ( diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts index 2cbfbf17e0..132fa84b4b 100644 --- a/web/packages/gallery/components/viewer/photoswipe.ts +++ b/web/packages/gallery/components/viewer/photoswipe.ts @@ -2,6 +2,7 @@ import { pt } from "ente-base/i18n"; import log from "ente-base/log"; import type { EnteFile } from "ente-media/file"; import { FileType } from "ente-media/file-type"; +import { settingsSnapshot } from "ente-new/photos/services/settings"; import "hls-video-element"; import { t } from "i18next"; import "media-chrome"; @@ -202,6 +203,9 @@ export class FileViewerPhotoSwipe { onDownload, onMore, }: FileViewerPhotoSwipeOptions) { + // TODO(HLS): + const showPlayerV2 = settingsSnapshot().isInternalUser; + const pswp = new PhotoSwipe({ // Opaque background. bgOpacity: 1, @@ -336,11 +340,7 @@ export class FileViewerPhotoSwipe { html: hlsVideoHTML(videoPlaylistURL, mcID), mediaControllerID: mcID, }; - } else if ( - videoURL && - // TODO(HLS): - process.env.NEXT_PUBLIC_ENTE_WIP_VIDEO_STREAMING - ) { + } else if (videoURL && showPlayerV2) { const mcID = `ente-mc-orig-${file.id}`; return { ...itemData, @@ -522,7 +522,7 @@ export class FileViewerPhotoSwipe { } // TODO(HLS): Temporary gate - if (!process.env.NEXT_PUBLIC_ENTE_WIP_VIDEO_STREAMING) return; + if (!showPlayerV2) return; const qualityMenu = container?.querySelector("#ente-quality-menu"); if (qualityMenu instanceof MediaChromeMenu) { @@ -767,7 +767,7 @@ export class FileViewerPhotoSwipe { video.muted = !video.muted; // TODO(HLS): Temporary gate - if (!process.env.NEXT_PUBLIC_ENTE_WIP_VIDEO_STREAMING) return; + if (!showPlayerV2) return; // Go via the media chrome mute button when muting, because // otherwise the local storage that the media chrome internally @@ -1111,9 +1111,7 @@ export class FileViewerPhotoSwipe { const handleSeekBackOrPreviousSlide = () => { // TODO(HLS): Behind temporary flag // const vid = videoVideoEl; - const vid = process.env.NEXT_PUBLIC_ENTE_WIP_VIDEO_STREAMING - ? videoVideoEl - : undefined; + const vid = showPlayerV2 ? videoVideoEl : undefined; if (vid) { vid.currentTime = Math.max(vid.currentTime - 5, 0); } else { @@ -1124,9 +1122,7 @@ export class FileViewerPhotoSwipe { const handleSeekForwardOrNextSlide = () => { // TODO(HLS): Behind temporary flag // const vid = videoVideoEl; - const vid = process.env.NEXT_PUBLIC_ENTE_WIP_VIDEO_STREAMING - ? videoVideoEl - : undefined; + const vid = showPlayerV2 ? videoVideoEl : undefined; if (vid) { vid.currentTime = vid.currentTime + 5; } else {