From 37dfb9dddcc816744d1ab269dd879451addb1be4 Mon Sep 17 00:00:00 2001 From: fuyu <54523771+mfmfuyu@users.noreply.github.com> Date: Fri, 30 Oct 2020 21:09:20 +0900 Subject: [Glitch] Fix wrong seek bar width on media player Port 8d7fbe7dd9b0a64915a96d342579ab80951be840 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/features/video/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/features/video/index.js') diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 95bee1331..21d327823 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -211,7 +211,7 @@ class Video extends React.PureComponent { handleTimeUpdate = () => { this.setState({ currentTime: this.video.currentTime, - duration: Math.floor(this.video.duration), + duration:this.video.duration, }); } @@ -568,7 +568,7 @@ class Video extends React.PureComponent { {formatTime(Math.floor(currentTime))} / - {formatTime(duration)} + {formatTime(Math.floor(duration))} )} -- cgit From 578e757d090b349fa996df6d3be7607b9216c563 Mon Sep 17 00:00:00 2001 From: Mélanie Chauvel Date: Tue, 27 Oct 2020 02:58:47 +0100 Subject: [Glitch] Make click area of video/audio player buttons bigger in WebUI Port a5afbb62d25306dc9d28fa8d0e85edf02c63d2a3 to glitch-soc Signed-off-by: Thibaut Girka --- .../flavours/glitch/features/audio/index.js | 10 +++++--- .../flavours/glitch/features/video/index.js | 12 ++++----- .../flavours/glitch/styles/components/media.scss | 30 ++++++++-------------- 3 files changed, 23 insertions(+), 29 deletions(-) (limited to 'app/javascript/flavours/glitch/features/video/index.js') diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 412c561a0..c050a63a9 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -444,14 +444,14 @@ class Audio extends React.PureComponent {
- - + +
@@ -465,7 +465,9 @@ class Audio extends React.PureComponent {
- + + +
diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 21d327823..d22bc1d56 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -551,8 +551,8 @@ class Video extends React.PureComponent {
- - + +
@@ -576,10 +576,10 @@ class Video extends React.PureComponent {
- {(!onCloseVideo && !editable && !fullscreen && !this.props.alwaysVisible) && } - {(!fullscreen && onOpenVideo) && } - {onCloseVideo && } - + {(!onCloseVideo && !editable && !fullscreen && !this.props.alwaysVisible) && } + {(!fullscreen && onOpenVideo) && } + {onCloseVideo && } +
diff --git a/app/javascript/flavours/glitch/styles/components/media.scss b/app/javascript/flavours/glitch/styles/components/media.scss index 58bdb642f..f504fa91e 100644 --- a/app/javascript/flavours/glitch/styles/components/media.scss +++ b/app/javascript/flavours/glitch/styles/components/media.scss @@ -385,7 +385,6 @@ } .video-player__controls { - padding: 0 15px; padding-top: 10px; background: transparent; } @@ -512,7 +511,8 @@ &__buttons-bar { display: flex; justify-content: space-between; - padding-bottom: 10px; + padding-bottom: 8px; + margin: 0 -5px; .video-player__download__icon { color: inherit; @@ -536,22 +536,13 @@ overflow: hidden; text-overflow: ellipsis; - &.left { - button { - padding-left: 0; - } - } - - &.right { - button { - padding-right: 0; - } - } + .player-button { + display: inline-block; + outline: 0; - button { flex: 0 0 auto; background: transparent; - padding: 2px 10px; + padding: 5px; font-size: 16px; border: 0; color: rgba($white, 0.75); @@ -569,6 +560,7 @@ flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; + margin: 0 5px; } &__time-sep, @@ -688,7 +680,7 @@ display: block; position: absolute; height: 4px; - top: 10px; + top: 14px; } &__progress, @@ -697,7 +689,7 @@ position: absolute; height: 4px; border-radius: 4px; - top: 10px; + top: 14px; background: lighten($ui-highlight-color, 8%); } @@ -712,7 +704,7 @@ border-radius: 50%; width: 12px; height: 12px; - top: 6px; + top: 10px; margin-left: -6px; background: lighten($ui-highlight-color, 8%); box-shadow: 1px 2px 6px rgba($base-shadow-color, 0.2); @@ -736,7 +728,7 @@ &.detailed, &.fullscreen { .video-player__buttons { - button { + .player-button { padding-top: 10px; padding-bottom: 10px; } -- cgit From a48dbc78f829874190ba062635881a7444d1e5f9 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 4 Nov 2020 15:12:06 +0100 Subject: Fix hiding video breaking playback Also make the video player code closer to upstream --- .../flavours/glitch/features/video/index.js | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'app/javascript/flavours/glitch/features/video/index.js') diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index d22bc1d56..870812856 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -281,9 +281,9 @@ class Video extends React.PureComponent { togglePlay = () => { if (this.state.paused) { - this.video.play(); + this.setState({ paused: false }, () => this.video.play()); } else { - this.video.pause(); + this.setState({ paused: true }, () => this.video.pause()); } } @@ -381,13 +381,16 @@ class Video extends React.PureComponent { } toggleMute = () => { - this.video.muted = !this.video.muted; - this.setState({ muted: this.video.muted }); + const muted = !this.video.muted; + + this.setState({ muted }, () => { + this.video.muted = muted; + }); } toggleReveal = () => { if (this.state.revealed) { - this.video.pause(); + this.setState({ paused: true }); } if (this.props.onToggleVisibility) { @@ -475,13 +478,6 @@ class Video extends React.PureComponent { return (
); } - let warning; - if (sensitive) { - warning = ; - } else { - warning = ; - } - let preload; if (this.props.currentTime || fullscreen || dragging) { @@ -492,6 +488,14 @@ class Video extends React.PureComponent { preload = 'none'; } + let warning; + + if (sensitive) { + warning = ; + } else { + warning = ; + } + return (