Skip to content

Commit

Permalink
Fix fullscreen controls on phones.
Browse files Browse the repository at this point in the history
Closes #663

Change-Id: Ieda41c62b1202f2636ecd258f487208b55034015
  • Loading branch information
TheModMaker committed Jun 9, 2017
1 parent bc8fcae commit bf53df8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions demo/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ ShakaControls.prototype.onMouseMove_ = function(event) {
this.lastTouchEventTime_ = null;
}

// When there is a touch, we can get a 'mousemove' event after touch events.
// This should be treated as part of the touch, which has already been handled
if (this.lastTouchEventTime_ && event.type == 'mousemove')
return;

// Use the cursor specified in the CSS file.
this.videoContainer_.style.cursor = '';
// Show the controls.
Expand All @@ -275,6 +280,10 @@ ShakaControls.prototype.onMouseMove_ = function(event) {

/** @private */
ShakaControls.prototype.onMouseOut_ = function() {
// We sometimes get 'mouseout' events with touches. Since we can never leave
// the video element when touching, ignore.
if (this.lastTouchEventTime_) return;

// Expire the timer early.
if (this.mouseStillTimeoutId_) {
window.clearTimeout(this.mouseStillTimeoutId_);
Expand Down

0 comments on commit bf53df8

Please sign in to comment.