Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FEC-8102): toggle fullscreen on double click #215

Merged
merged 4 commits into from
Apr 9, 2018
Merged

Conversation

odedhutzler
Copy link
Contributor

@odedhutzler odedhutzler commented Apr 9, 2018

Description of the Changes

added logic to support differentiate double click from single click.

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

@odedhutzler odedhutzler self-assigned this Apr 9, 2018
OrenMe
OrenMe previously approved these changes Apr 9, 2018

if (currentTime - this._firstClickTime < PLAY_PAUSE_BUFFER_TIME ) {
this.clickTimeout && clearTimeout(this.clickTimeout);
this._secondClickTime = currentTime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all _secondClickTime uses.

let currentTime = Date.now();

if (currentTime - this._firstClickTime < PLAY_PAUSE_BUFFER_TIME ) {
this.clickTimeout && clearTimeout(this.clickTimeout);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to a function:

const cancelClickTimeout = () => {
   if (this.clickTimeout){ 
      clearTimeout(this.clickTimeout);
      this.clickTimeout = null;
   }
}

and use in both if conditions.

dan-ziv
dan-ziv previously requested changes Apr 9, 2018
if (!this.player.isFullscreen()) {
this.logger.debug("Enter fullscreen");
this.player.enterFullscreen();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line

@@ -85,7 +118,30 @@ class OverlayAction extends BaseComponent {
if (this.props.isMobile) {
return;
}
this.togglePlayPause();

let currentTime = Date.now();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const?

}

this._firstClickTime = currentTime;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty and redundant lines...

move cancelTimeout to a function
removing _secondClickTime
fixing flow
@dan-ziv dan-ziv merged commit fe33564 into master Apr 9, 2018
@dan-ziv dan-ziv deleted the FEC-8102 branch April 9, 2018 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants