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: [PATCH] [Glitch] Fix wrong seek bar width on media player Port 8d7fbe7dd9b0a64915a96d342579ab80951be840 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/features/audio/index.js | 4 ++-- app/javascript/flavours/glitch/features/video/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 6d09ac8d2f4..412c561a04a 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -252,7 +252,7 @@ class Audio extends React.PureComponent { handleTimeUpdate = () => { this.setState({ currentTime: this.audio.currentTime, - duration: Math.floor(this.audio.duration), + duration: this.audio.duration, }); } @@ -460,7 +460,7 @@ class Audio extends React.PureComponent { {formatTime(Math.floor(currentTime))} / - {formatTime(this.state.duration || Math.floor(this.props.duration))} + {formatTime(Math.floor(this.state.duration || this.props.duration))} diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 95bee1331c1..21d327823ad 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))} )}