Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move

Manav Rathie536e34808f9
diff --git a/web/apps/photos/src/styles/photoswipe.css b/web/apps/photos/src/styles/photoswipe.css
index 04fcb4adbe..9049b3140c 100644
--- a/web/apps/photos/src/styles/photoswipe.css
+++ b/web/apps/photos/src/styles/photoswipe.css
@@ -209,20 +209,24 @@
--media-font-family: "Inter Variable", sans-serif;
}
-.pswp-ente .pswp__media-controls media-control-bar {
- /*
- The control-bar sizes to fit the media controller (which itself fills up
- the full width), but since we're showing the control bar outside of the
- media controller, we need to ask it to fill the available width ourselves.
- */
- width: 100%;
+/*
+ Stack controls rows vertically.
+ */
+.pswp-ente .pswp__media-controls > div {
+ display: flex;
+ flex-direction: column;
}
/* Hide the controls if they're not associated to a media-controller. */
-.pswp-ente .pswp__media-controls media-control-bar:not([mediacontroller]) {
+media-control-bar:not([mediacontroller]) {
display: none;
}
+media-loading-indicator {
+ /* Similar to the top bar loading indicator */
+ --media-icon-color: rgba(255 255 255 / 0.6);
+}
+
/*
Hide specific controls when the user's browser doesn't support the feature
they trigger.
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index d57cf638db..7bce84acd8 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -1,4 +1,3 @@
-import { assertionFailed } from "@/base/assert";
import type { EnteFile } from "@/media/file";
import { FileType } from "@/media/file-type";
import "hls-video-element";
@@ -452,19 +451,16 @@ export class FileViewerPhotoSwipe {
* controller. Otherwise hide the media controls.
*/
const updateMediaControls = (mediaControllerID: string | undefined) => {
- const controlBar =
- mediaControlsContainerElement?.querySelector(
+ const controlBars =
+ mediaControlsContainerElement?.querySelectorAll(
"media-control-bar",
- );
- if (!controlBar) {
- assertionFailed();
- return;
- }
-
- if (mediaControllerID) {
- controlBar.setAttribute("mediacontroller", mediaControllerID);
- } else {
- controlBar.removeAttribute("mediacontroller");
+ ) ?? [];
+ for (const bar of controlBars) {
+ if (mediaControllerID) {
+ bar.setAttribute("mediacontroller", mediaControllerID);
+ } else {
+ bar.removeAttribute("mediacontroller");
+ }
}
};
@@ -1156,7 +1152,6 @@ const videoHTML = (url: string, disableDownload: boolean) => `
const hlsVideoHTML = (url: string, mediaControllerID: string) => `
<media-controller id="${mediaControllerID}">
<hls-video playsinline slot="media" src="${url}"></hls-video>
- <media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>
</media-controller>
`;
@@ -1174,15 +1169,20 @@ const hlsVideoHTML = (url: string, mediaControllerID: string) => `
* indicator (browser specific) in the in-page video element.
*/
const hlsVideoControlsHTML = () => `
-<media-control-bar>
- <media-play-button></media-play-button>
- <media-mute-button></media-mute-button>
- <media-time-range></media-time-range>
- <media-time-display showduration notoggle></media-time-display>
- <media-pip-button></media-pip-button>
- <media-airplay-button></media-airplay-button>
- <media-fullscreen-button></media-fullscreen-button>
-</media-control-bar>
+<div>
+ <media-control-bar>
+ <media-loading-indicator noautohide></media-loading-indicator>
+ </media-control-bar>
+ <media-control-bar>
+ <media-play-button></media-play-button>
+ <media-mute-button></media-mute-button>
+ <media-time-range></media-time-range>
+ <media-time-display showduration notoggle></media-time-display>
+ <media-pip-button></media-pip-button>
+ <media-airplay-button></media-airplay-button>
+ <media-fullscreen-button></media-fullscreen-button>
+ </media-control-bar>
+</div>
`;
// playsinline will play the video inline on mobile browsers (where the default