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

This commit is contained in:
Abhinav 2024-01-29 15:15:15 +05:30
parent 809c3e24fb
commit a7c1133c41
2 changed files with 9 additions and 3 deletions

View file

@ -212,7 +212,7 @@ const PhotoFrame = ({
throw Error(CustomError.FILE_CONVERSION_FAILED);
}
await updateFileSrcProps(file, srcURLs);
await updateFileSrcProps(file, srcURLs, enableDownload);
};
const handleClose = (needUpdate) => {

View file

@ -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>