]> cat aescling's git repositories - mastodon.git/commitdiff
Fix wrong seek bar width on media player (#15060)
authorfuyu <54523771+mfmfuyu@users.noreply.github.com>
Fri, 30 Oct 2020 12:09:20 +0000 (21:09 +0900)
committerGitHub <noreply@github.com>
Fri, 30 Oct 2020 12:09:20 +0000 (13:09 +0100)
app/javascript/mastodon/features/audio/index.js
app/javascript/mastodon/features/video/index.js

index 2992e36629be5a90d242c73c9d52f9ba9fc80088..434148e8e79819c909b1eaab80d51dedf6c0be03 100644 (file)
@@ -246,7 +246,7 @@ class Audio extends React.PureComponent {
   handleTimeUpdate = () => {
     this.setState({
       currentTime: this.audio.currentTime,
-      duration: Math.floor(this.audio.duration),
+      duration: this.audio.duration,
     });
   }
 
@@ -454,7 +454,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 642722193a728d0438e825d1efe5d247e4a1e39e..229a9214084bfe5d2cde582c0dd284be439d2cb3 100644 (file)
@@ -198,7 +198,7 @@ class Video extends React.PureComponent {
   handleTimeUpdate = () => {
     this.setState({
       currentTime: this.video.currentTime,
-      duration: Math.floor(this.video.duration),
+      duration:this.video.duration,
     });
   }
 
@@ -551,7 +551,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>
               )}