Skip to content

armgit / ente

Public Imported from GitHub
0

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

now it was flickering vertically!

Manav Rathi755628771626
diff --git a/web/apps/photos/src/styles/photoswipe.css b/web/apps/photos/src/styles/photoswipe.css
index dab66b79e6..a0bc711704 100644
--- a/web/apps/photos/src/styles/photoswipe.css
+++ b/web/apps/photos/src/styles/photoswipe.css
@@ -214,30 +214,23 @@
}
/*
- To get media chrome to apply the same styling to the native video element as
- hls-video applies to the video element it embeds, we need to set the
- media-controller's display to inline. It would be nice to do this "properly",
- or at least understand why this works.
-
- Ref (not directly relevant, but a general direction):
- https://github.com/muxinc/media-elements/blob/main/packages/custom-media-element/custom-media-element.ts
+ I tried various ways to get media-controller to embed a normal video, but in
+ all methods I kept getting a flickering at the edges on Chrome. My best guess
+ is that it happens when the resolved size of the video is a fractional value.
+
+ This is the current magic incantation that seems to get them to play without
+ the video's frame jittering. Note that the streaming hls-video elements work
+ fine without any workarounds, it is only the vanilla video elements that have
+ this issue and necessiate this workaround. The downside is that clicking
+ "outside" the video works for hls-video, but not for vanilla videos.
*/
.pswp-ente media-controller.ente-vanilla-video {
- display: inline;
- /*
- On Chrome (I didn't check elsewhere), when putting a regular video element
- within a media-controller, we get a flickering at the edges. This isn't
- related to the display: inline hack above, because it can be reproduced
- without it too - At certain window sizes, when playing back the video,
- there will be flickering / shifting at the horizontal edges.
-
- This doesn't happen with the media-controller and hls-video combination. My
- best guess is that it happens if the (eventually resolved) size of the
- video happens to be a fractional value. Based on that theory, adding a 1px
- leeway to the video width resolves the flickering.
- */
+ width: 100%;
+ height: 100%;
+
video {
- width: calc(100% - 1px) !important;
+ width: calc(100% - 1px);
+ height: calc(100% - 1px);
}
}