diff --git a/app/src/component/mediaPlayer/view.js b/app/src/component/mediaPlayer/view.js index 5e13674b..25f2e481 100644 --- a/app/src/component/mediaPlayer/view.js +++ b/app/src/component/mediaPlayer/view.js @@ -41,7 +41,8 @@ class MediaPlayer extends React.PureComponent { controlsTimeout: -1, seekerOffset: 0, seekerPosition: 0, - firstPlay: true + firstPlay: true, + seekTimeout: -1 }; } @@ -176,6 +177,9 @@ class MediaPlayer extends React.PureComponent { onPanResponderGrant: (evt, gestureState) => { this.clearControlsTimeout(); + if (this.state.seekTimeout > 0) { + clearTimeout(this.state.seekTimeout); + } this.setState({ seeking: true }); }, @@ -191,7 +195,7 @@ class MediaPlayer extends React.PureComponent { this.onEnd(); } else { this.seekTo(time); - this.setState({ seeking: false }); + this.setState({ seekTimeout: setTimeout(() => { this.setState({ seeking: false }); }, 100) }); } this.hidePlayerControls(); } @@ -262,7 +266,7 @@ class MediaPlayer extends React.PureComponent { } render() { - const { backgroundPlayEnabled, fileInfo, thumbnail, style } = this.props; + const { backgroundPlayEnabled, fileInfo, thumbnail, onLayout, style } = this.props; const flexCompleted = this.getCurrentTimePercentage() * 100; const flexRemaining = (1 - this.getCurrentTimePercentage()) * 100; let styles = [this.state.fullscreenMode ? mediaPlayerStyle.fullscreenContainer : mediaPlayerStyle.container]; @@ -278,7 +282,7 @@ class MediaPlayer extends React.PureComponent { mediaPlayerStyle.fullscreenTrackingControls : mediaPlayerStyle.containedTrackingControls]; return ( - +