π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Forward
Manav Rathi3ec3f9f2e18e
diff --git a/web/packages/gallery/components/viewer/data-source.ts b/web/packages/gallery/components/viewer/data-source.tsindex 0c5a6c0e40..933e66d5bc 100644--- a/web/packages/gallery/components/viewer/data-source.ts+++ b/web/packages/gallery/components/viewer/data-source.ts@@ -475,7 +475,10 @@ const enqueueUpdates = async (// TODO(HLS):let hlsPlaylistData: HLSPlaylistData | undefined;if (shouldUsePlayerV2() && file.metadata.fileType == FileType.video) {- hlsPlaylistData = await hlsPlaylistDataForFile(file);+ hlsPlaylistData = await hlsPlaylistDataForFile(+ file,+ downloadManager.publicAlbumsCredentials,+ );// We have a HLS playlist, and the user didn't request the original.// Early return so that we don't initiate a fetch for the original.if (hlsPlaylistData && opts?.videoQuality != "original") {diff --git a/web/packages/gallery/services/download.ts b/web/packages/gallery/services/download.tsindex cde94103c3..f1ee18c228 100644--- a/web/packages/gallery/services/download.ts+++ b/web/packages/gallery/services/download.ts@@ -106,7 +106,7 @@ class DownloadManager {* Credentials that should be used to download files when we're in the* context of the public albums app.*/- private publicAlbumsCredentials: PublicAlbumsCredentials | undefined;+ publicAlbumsCredentials: PublicAlbumsCredentials | undefined;/*** Local cache for thumbnail blobs.*diff --git a/web/packages/gallery/services/video.ts b/web/packages/gallery/services/video.tsindex d1a8b04607..55a2f74996 100644--- a/web/packages/gallery/services/video.ts+++ b/web/packages/gallery/services/video.ts@@ -2,6 +2,7 @@ import { isDesktop } from "ente-base/app";import { decryptBlob } from "ente-base/crypto";import type { EncryptedBlob } from "ente-base/crypto/types";import { isDevBuild } from "ente-base/env";+import type { PublicAlbumsCredentials } from "ente-base/http";import log from "ente-base/log";import type { EnteFile } from "ente-media/file";import { FileType } from "ente-media/file-type";@@ -74,6 +75,10 @@ export interface HLSPlaylistData {** @param file An {@link EnteFile} of type video.*+ * @param publicAlbumsCredentials Credentials to use for fetching the HLS+ * playlist when we are running in the context of the public albums app. If+ * these are not specified, then the credentials of the logged in user are used.+ ** @returns The HLS playlist as a string (along with the dimensions of the video* it will play), or `undefined` if there is no video preview associated with* the given file.@@ -82,10 +87,15 @@ export interface HLSPlaylistData {*/export const hlsPlaylistDataForFile = async (file: EnteFile,+ publicAlbumsCredentials?: PublicAlbumsCredentials,): Promise<HLSPlaylistData | undefined> => {ensurePrecondition(file.metadata.fileType == FileType.video);- const playlistFileData = await fetchFileData("vid_preview", file.id);+ const playlistFileData = await fetchFileData(+ "vid_preview",+ file.id,+ publicAlbumsCredentials,+ );if (!playlistFileData) return undefined;const {@@ -105,7 +115,11 @@ export const hlsPlaylistDataForFile = async (// A playlist format the current client does not understand.if (type != "hls_video") return undefined;- const videoURL = await fetchFilePreviewData("vid_preview", file.id);+ const videoURL = await fetchFilePreviewData(+ "vid_preview",+ file.id,+ publicAlbumsCredentials,+ );if (!videoURL) return undefined;// [Note: HLS playlist format]