Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Remove download option from video player control list of shared link as download disabled

Abhinava7c1133c41e8
diff --git a/apps/photos/src/components/PhotoFrame.tsx b/apps/photos/src/components/PhotoFrame.tsx
index 444477a4f0..0097a1eba1 100644
--- a/apps/photos/src/components/PhotoFrame.tsx
+++ b/apps/photos/src/components/PhotoFrame.tsx
@@ -212,7 +212,7 @@ const PhotoFrame = ({
throw Error(CustomError.FILE_CONVERSION_FAILED);
}
- await updateFileSrcProps(file, srcURLs);
+ await updateFileSrcProps(file, srcURLs, enableDownload);
};
const handleClose = (needUpdate) => {
diff --git a/apps/photos/src/utils/photoFrame/index.ts b/apps/photos/src/utils/photoFrame/index.ts
index e3141a7fef..57144f523d 100644
--- a/apps/photos/src/utils/photoFrame/index.ts
+++ b/apps/photos/src/utils/photoFrame/index.ts
@@ -69,7 +69,11 @@ export function updateFileMsrcProps(file: EnteFile, url: string) {
}
}
-export async function updateFileSrcProps(file: EnteFile, srcURLs: SourceURLs) {
+export async function updateFileSrcProps(
+ file: EnteFile,
+ srcURLs: SourceURLs,
+ enableDownload: boolean
+) {
const { url, isRenderable, isOriginal } = srcURLs;
file.w = window.innerWidth;
file.h = window.innerHeight;
@@ -87,7 +91,9 @@ export async function updateFileSrcProps(file: EnteFile, srcURLs: SourceURLs) {
if (file.metadata.fileType === FILE_TYPE.VIDEO) {
file.html = `
- <video controls onContextMenu="return false;">
+ <video controls ${
+ !enableDownload && 'controlsList="nodownload"'
+ } onContextMenu="return false;">
<source src="${url}" />
Your browser does not support the video tag.
</video>