Improve video embed overlay and proxy behavior

This commit is contained in:
Zed 2026-08-12 01:36:40 +07:00
commit 5fa4eefb9d
5 changed files with 82 additions and 32 deletions

View file

@ -88,6 +88,7 @@ html:has(body > .embed-video) {
// Video-only embed
.embed-video {
position: relative;
min-height: 300px;
background-color: black;
border: 1px solid var(--border_grey);
@ -106,7 +107,7 @@ html:has(body > .embed-video) {
width: 100%;
}
.gallery-video > .attachment {
.gallery-video>.attachment {
max-height: 560px;
width: 100%;
}
@ -135,7 +136,9 @@ html:has(body > .embed-video) {
text-decoration: none;
border-radius: 9999px;
border: 1px solid transparent;
transition: background 0.15s, opacity 0.15s;
transition:
background 0.15s,
opacity 0.15s;
z-index: 10;
&:hover {
@ -143,8 +146,14 @@ html:has(body > .embed-video) {
}
}
&:has(video:playing) .video-overlay-link {
// Hide button while playing, show on hover or when paused
&.video-playing .video-overlay-link {
opacity: 0;
pointer-events: none;
}
&.video-playing:hover .video-overlay-link {
opacity: 1;
pointer-events: auto;
}
}

View file

@ -14,7 +14,7 @@ proc renderVideoEmbed*(tweet: Tweet; cfg: Config; req: Request): string =
video = tweet.getVideos()[0]
thumb = video.thumb
vidUrl = getVideoEmbed(cfg, tweet.id)
prefs = Prefs(hlsPlayback: true, mp4Playback: true)
prefs = Prefs(hlsPlayback: true, mp4Playback: true, proxyVideos: true)
tweetUrl = getLink(tweet)
let node = buildHtml(html(lang="en")):

View file

@ -50,7 +50,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
let opensearchUrl = getUrlPrefix(cfg) & "/opensearch"
buildHtml(head):
link(rel="stylesheet", type="text/css", href="/css/style.css?v=101")
link(rel="stylesheet", type="text/css", href="/css/style.css?v=106")
link(rel="stylesheet", type="text/css", href="/css/fontello.css?v=7")
if theme.len > 0: