From 58514651c330824ff3f533334ac53d3b32771402 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 7 Sep 2023 04:24:24 +0200 Subject: [PATCH] [Glitch] Fix mute button and volume slider feeling disconnected in web UI Port f3a2e15f8e0274b5fdf28e3ce062084dc142cb2e to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/audio/index.jsx | 7 ++++--- app/javascript/flavours/glitch/features/video/index.jsx | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/javascript/flavours/glitch/features/audio/index.jsx b/app/javascript/flavours/glitch/features/audio/index.jsx index ceb9775b5..1926b0248 100644 --- a/app/javascript/flavours/glitch/features/audio/index.jsx +++ b/app/javascript/flavours/glitch/features/audio/index.jsx @@ -473,8 +473,9 @@ class Audio extends PureComponent { render () { const { src, intl, alt, lang, editable, autoPlay, sensitive, blurhash } = this.props; - const { paused, muted, volume, currentTime, duration, buffer, dragging, revealed } = this.state; + const { paused, volume, currentTime, duration, buffer, dragging, revealed } = this.state; const progress = Math.min((currentTime / duration) * 100, 100); + const muted = this.state.muted || volume === 0; let warning; @@ -564,12 +565,12 @@ class Audio extends PureComponent {
-
+
diff --git a/app/javascript/flavours/glitch/features/video/index.jsx b/app/javascript/flavours/glitch/features/video/index.jsx index f5318689f..b28ccb006 100644 --- a/app/javascript/flavours/glitch/features/video/index.jsx +++ b/app/javascript/flavours/glitch/features/video/index.jsx @@ -508,8 +508,10 @@ class Video extends PureComponent { render () { const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, lang, letterbox, fullwidth, detailed, sensitive, editable, blurhash, autoFocus } = this.props; - const { currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state; + const { currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, revealed } = this.state; const progress = Math.min((currentTime / duration) * 100, 100); + const muted = this.state.muted || volume === 0; + const playerStyle = {}; if (inline) { @@ -603,12 +605,12 @@ class Video extends PureComponent {
-
+