From 91f86969d14cd59e5bf1f1c1b871b41580de473a Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Fri, 14 Mar 2014 17:06:23 +0200 Subject: [PATCH] Don't play/pause toggle on player screen click At least on OSX, its pretty common for players to allow you to drag the window and it gets pretty annoying to pause the playback while doing so. The click also gets in the way of the double click for quick fullscreen. The solution is kinda hacky, as it monkey patches videojs. --- js/vendor/videojsplugins.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/vendor/videojsplugins.js b/js/vendor/videojsplugins.js index a1c6cb3a..0dc7d87c 100644 --- a/js/vendor/videojsplugins.js +++ b/js/vendor/videojsplugins.js @@ -248,3 +248,17 @@ vjs.TextTrack.prototype.load = function(){ } }; + +function(vjs) { + var superAddControlsListeners = vjs.MediaTechController.prototype.addControlsListeners; + + vjs.MediaTechController.prototype.addControlsListeners = function() { + superAddControlsListeners.call(this); + // Don't toggle play/pause with a click on the movie player. Often you want + // to drag the screen and the play/pause stuff is pretty annoying. + // + // Disabling the event is speedier than just overriding the onClick method + // with a noop. + this.off('mousedown'); + } +}(videojs);