Skip to content

Commit

Permalink
Fixed an issue where the user was unable to scroll/zoom page if touch…
Browse files Browse the repository at this point in the history
…ing the video

closes #1373, closes#895

fixes #895

Moved event.preventDefault() to 'touchend' listener

missing semicolon
  • Loading branch information
jackunion authored and heff committed Aug 4, 2014
1 parent d64205d commit a0d8db9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CHANGELOG
* Added support for multiple time ranges in the load progress bar ([view](https://github.com/videojs/video.js/pull/1253))
* Added vjs-waiting and vjs-seeking css classnames and updated the spinner to use them ([view](https://github.com/videojs/video.js/pull/1351))
* Now restoring the original video tag attributes on a tech change to support webkit-playsinline ([view](https://github.com/videojs/video.js/pull/1369))
* Fixed an issue where the user was unable to scroll/zoom page if touching the video ([view](https://github.com/videojs/video.js/pull/1373))

--------------------

Expand Down
7 changes: 5 additions & 2 deletions src/js/media/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ vjs.MediaTechController.prototype.addControlsListeners = function(){
// so we'll check if the controls were already showing before reporting user
// activity
this.on('touchstart', function(event) {
// Stop the mouse events from also happening
event.preventDefault();
userWasActive = this.player_.userActive();
});

Expand All @@ -98,6 +96,11 @@ vjs.MediaTechController.prototype.addControlsListeners = function(){
}
});

this.on('touchend', function(event) {
// Stop the mouse events from also happening
event.preventDefault();
});

// Turn on component tap events
this.emitTapEvents();

Expand Down

0 comments on commit a0d8db9

Please sign in to comment.