Skip to content

Commit

Permalink
Fix context menu display on giant play button
Browse files Browse the repository at this point in the history
By hiding and showing the container instead of the button, we make
sure contextmenu clicks go to the video element instead of the
container element.

Closes #422

Change-Id: I42faa3be38657c123932024566780948557ec324
  • Loading branch information
joeyparrish committed Jun 29, 2016
1 parent ad6a9da commit ebb06a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion demo/controls.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
#pauseButton, #unmuteButton,
#castButton, #castConnectedButton,
#rewindButton, #fastForwardButton,
#giantPlayButton, #bufferingSpinner {
#giantPlayButtonContainer, #bufferingSpinner {
display: none;
}

Expand Down
7 changes: 4 additions & 3 deletions demo/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ function ShakaControls() {
this.bufferingSpinner_ = document.getElementById('bufferingSpinner');

/** @private {Element} */
this.giantPlayButton_ = document.getElementById('giantPlayButton');
this.giantPlayButtonContainer_ =
document.getElementById('giantPlayButtonContainer');

/** @private {boolean} */
this.isSeeking_ = false;
Expand Down Expand Up @@ -253,10 +254,10 @@ ShakaControls.prototype.onPlayStateChange_ = function() {
// Video is paused during seek, so don't show the play arrow while seeking:
if (this.video_.paused && !this.isSeeking_) {
this.playPauseButton_.textContent = 'play_arrow';
this.giantPlayButton_.style.display = 'inline';
this.giantPlayButtonContainer_.style.display = 'inline';
} else {
this.playPauseButton_.textContent = 'pause';
this.giantPlayButton_.style.display = 'none';
this.giantPlayButtonContainer_.style.display = 'none';
}
};

Expand Down

0 comments on commit ebb06a4

Please sign in to comment.