From 1aa03edf6e08ac2241f8d2c9ae9660e1de1331c8 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 5 Jul 2018 17:45:55 +0100 Subject: [PATCH 1/2] added a delay to seeking state reset --- app/src/component/mediaPlayer/view.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/component/mediaPlayer/view.js b/app/src/component/mediaPlayer/view.js index 5e13674..63b5d94 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(); } From b8e52e21172ca9b6d742bc16066b7e7524fd2548 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 17 Jul 2018 17:59:58 +0100 Subject: [PATCH 2/2] tweaks to media display in landscape mode (#197) * tweaks to media display in landscape mode --- app/src/component/mediaPlayer/view.js | 4 +- app/src/page/file/view.js | 58 ++++++++++++++++--- app/src/styles/filePage.js | 14 ++++- .../reactmodules/ScreenOrientationModule.java | 8 +++ 4 files changed, 72 insertions(+), 12 deletions(-) diff --git a/app/src/component/mediaPlayer/view.js b/app/src/component/mediaPlayer/view.js index 63b5d94..25f2e48 100644 --- a/app/src/component/mediaPlayer/view.js +++ b/app/src/component/mediaPlayer/view.js @@ -266,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]; @@ -282,7 +282,7 @@ class MediaPlayer extends React.PureComponent { mediaPlayerStyle.fullscreenTrackingControls : mediaPlayerStyle.containedTrackingControls]; return ( - +