diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index 98b76249..11e4ce87 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -76,6 +76,8 @@ export default Vue.extend({ maxFramerate: 0, activeSourceList: [], mouseTimeout: null, + touchTimeout: null, + lastTouchTime: null, dataSetup: { fluid: true, nativeTextTracks: false, @@ -719,6 +721,25 @@ export default Vue.extend({ } }, + handleTouchStart: function (event) { + const v = this + this.touchPauseTimeout = setTimeout(() => { + v.togglePlayPause() + }, 1000) + + const touchTime = new Date() + + if (this.lastTouchTime !== null && (touchTime.getTime() - this.lastTouchTime.getTime()) < 250) { + this.toggleFullscreen() + } + + this.lastTouchTime = touchTime + }, + + handleTouchEnd: function (event) { + clearTimeout(this.touchPauseTimeout) + }, + keyboardShortcutHandler: function (event) { const activeInputs = $('.ft-input') diff --git a/src/renderer/components/ft-video-player/ft-video-player.vue b/src/renderer/components/ft-video-player/ft-video-player.vue index 0827a643..80965573 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.vue +++ b/src/renderer/components/ft-video-player/ft-video-player.vue @@ -6,6 +6,8 @@ :poster="thumbnail" controls preload="auto" + @touchstart="handleTouchStart" + @touchend="handleTouchEnd" :data-setup="JSON.stringify(dataSetup)" >