Skip to content

Commit

Permalink
Fix wrong seek bar width on media player (mastodon#15060)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfmfuyu authored and umonaca committed Nov 8, 2020
1 parent 41a6432 commit 8a1a507
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/javascript/mastodon/features/audio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand Down Expand Up @@ -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>

Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/features/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class Video extends React.PureComponent {
handleTimeUpdate = () => {
this.setState({
currentTime: this.video.currentTime,
duration: Math.floor(this.video.duration),
duration:this.video.duration,
});
}

Expand Down Expand Up @@ -558,7 +558,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>
)}

Expand Down

0 comments on commit 8a1a507

Please sign in to comment.