]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix wrong seek bar width on media player
authorfuyu <54523771+mfmfuyu@users.noreply.github.com>
Fri, 30 Oct 2020 12:09:20 +0000 (21:09 +0900)
committerThibaut Girka <thib@sitedethib.com>
Tue, 3 Nov 2020 16:37:53 +0000 (17:37 +0100)
Port 8d7fbe7dd9b0a64915a96d342579ab80951be840 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/features/audio/index.js
app/javascript/flavours/glitch/features/video/index.js

index 6d09ac8d2f4b26e686f2f6e2d6e11ad52563ea4b..412c561a04a95a767c63bc3633313c5197fd5016 100644 (file)
@@ -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 {
               <span className='video-player__time'>
                 <span className='video-player__time-current'>{formatTime(Math.floor(currentTime))}</span>
                 <span className='video-player__time-sep'>/</span>
-                <span className='video-player__time-total'>{formatTime(this.state.duration || Math.floor(this.props.duration))}</span>
+                <span className='video-player__time-total'>{formatTime(Math.floor(this.state.duration || this.props.duration))}</span>
               </span>
             </div>
 
index 95bee1331c1396ba394edb9cb1364657efff8b44..21d327823adee5e409caa1c3961a99136ce7b623 100644 (file)
@@ -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 {
                 <span className='video-player__time'>
                   <span className='video-player__time-current'>{formatTime(Math.floor(currentTime))}</span>
                   <span className='video-player__time-sep'>/</span>
-                  <span className='video-player__time-total'>{formatTime(duration)}</span>
+                  <span className='video-player__time-total'>{formatTime(Math.floor(duration))}</span>
                 </span>
               )}