mirror of
https://github.com/ente-io/ente.git
synced 2025-08-13 17:57:31 +00:00
vid 1
This commit is contained in:
@@ -435,6 +435,7 @@ const FileViewer: React.FC<FileViewerProps> = ({
|
|||||||
|
|
||||||
// Not memoized since it uses the frequently changing `activeAnnotatedFile`.
|
// Not memoized since it uses the frequently changing `activeAnnotatedFile`.
|
||||||
const handleCopyImage = () => {
|
const handleCopyImage = () => {
|
||||||
|
handleMoreMenuClose();
|
||||||
// Safari does not copy if we do not call `navigator.clipboard.write`
|
// Safari does not copy if we do not call `navigator.clipboard.write`
|
||||||
// synchronously within the click event handler, but it does supports
|
// synchronously within the click event handler, but it does supports
|
||||||
// passing a promise in lieu of the blob.
|
// passing a promise in lieu of the blob.
|
||||||
|
@@ -432,9 +432,32 @@ export class FileViewerPhotoSwipe {
|
|||||||
updateFileInfoExifIfNeeded(e.content.data),
|
updateFileInfoExifIfNeeded(e.content.data),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let el;
|
||||||
|
let listener;
|
||||||
pswp.on("change", (e) => {
|
pswp.on("change", (e) => {
|
||||||
const itemData = this.pswp.currSlide.content.data;
|
const itemData = this.pswp.currSlide.content.data;
|
||||||
updateFileInfoExifIfNeeded(itemData);
|
updateFileInfoExifIfNeeded(itemData);
|
||||||
|
|
||||||
|
if (el && listener) {
|
||||||
|
el.removeEventListener("pause", listener);
|
||||||
|
el.removeEventListener("play", listener);
|
||||||
|
el.removeEventListener("ended", listener);
|
||||||
|
el = undefined;
|
||||||
|
listener = undefined;
|
||||||
|
}
|
||||||
|
if (itemData.fileType == FileType.video) {
|
||||||
|
setTimeout(() => {
|
||||||
|
listener = (e) => {
|
||||||
|
console.log(e);
|
||||||
|
};
|
||||||
|
// TODO:
|
||||||
|
el = document.getElementsByTagName("video")[0];
|
||||||
|
console.log(el);
|
||||||
|
el.addEventListener("pause", listener);
|
||||||
|
el.addEventListener("play", listener);
|
||||||
|
el.addEventListener("ended", listener);
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
pswp.on("contentDestroy", (e) => forgetExifForItemData(e.content.data));
|
pswp.on("contentDestroy", (e) => forgetExifForItemData(e.content.data));
|
||||||
|
Reference in New Issue
Block a user