diff --git a/demo/demo.html b/demo/demo.html index a0e460e5..ca77b883 100644 --- a/demo/demo.html +++ b/demo/demo.html @@ -287,6 +287,17 @@
General Options
+
+ + + + + +
@@ -594,7 +605,8 @@
Contact
autoStart: true, autoFallback: true, mute: false, - sources: [] + sources: [], + doubleTapToSeek: false }; if (urlOption && urlOption.playerOption) { diff --git a/src/js/api/Configurator.js b/src/js/api/Configurator.js index 82d7c160..c3c0835f 100755 --- a/src/js/api/Configurator.js +++ b/src/js/api/Configurator.js @@ -35,7 +35,8 @@ const Configurator = function(options, provider){ loadingRetryCount: 0, expandFullScreenUI: true, fullscreenOption: null, - showBigPlayButton: true + showBigPlayButton: true, + doubleTapToSeek: false, }; const serialize = function (val) { if (val === undefined) { diff --git a/src/js/utils/getTouchSection.js b/src/js/utils/getTouchSection.js index 7e32d973..6e736ef7 100644 --- a/src/js/utils/getTouchSection.js +++ b/src/js/utils/getTouchSection.js @@ -4,9 +4,6 @@ * @returns {'left'|'middle'|'right'} */ export default function getTouchSection(event) { - // get the elements width - console.log(event.target); - /** * @type {DOMRect} */ diff --git a/src/js/view/view.js b/src/js/view/view.js index ed3892a1..e2f1ee93 100755 --- a/src/js/view/view.js +++ b/src/js/view/view.js @@ -8,6 +8,7 @@ import PanelManager from "view/global/PanelManager"; import ContextPanel from 'view/components/helpers/contextPanel'; import LA$ from 'utils/likeA$'; import ResizeSensor from "utils/resize-sensor"; +import getTouchSection from "utils/getTouchSection"; import { READY, DESTROY, @@ -198,26 +199,26 @@ const View = function($container){ } }, "dblclick .ovenplayer" : function(event, $current, template){ - if (api) { const touchPosition = getTouchSection(event); const currentPosition = api.getPosition(); + const tapToSeekEnabled = api.getConfig().doubleTapToSeek; // seek back 10s - if (touchPosition == 'left') { + if (tapToSeekEnabled && touchPosition == 'left') { const newPosition = Math.max(currentPosition - 10, 0); OvenPlayerConsole.log(`Seeking to ${newPosition}`); api.seek(newPosition); } // seek forward 10s - if (touchPosition === 'right') { + if (tapToSeekEnabled && touchPosition === 'right') { const newPosition = Math.min(currentPosition + 10, api.getDuration()); OvenPlayerConsole.log(`Seeking to ${newPosition}`); api.seek(newPosition); } - if (touchPosition === 'middle') { + if (touchPosition === 'middle' || !tapToSeekEnabled) { OvenPlayerConsole.log(`Toggling fullscreen`); if (api.getConfig().expandFullScreenUI && api.toggleFullScreen) {