-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
|
||
if (currentTime - this._firstClickTime < PLAY_PAUSE_BUFFER_TIME ) { | ||
this.clickTimeout && clearTimeout(this.clickTimeout); | ||
this._secondClickTime = currentTime; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
if (!this.player.isFullscreen()) { | ||
this.logger.debug("Enter fullscreen"); | ||
this.player.enterFullscreen(); | ||
|
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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; | ||
|
There was a problem hiding this comment.
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
Description of the Changes
added logic to support differentiate double click from single click.
CheckLists