-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Control text fullscreen fix on ESC #3485
Conversation
@@ -1092,6 +1092,8 @@ class Player extends Component { | |||
this.addClass('vjs-fullscreen'); | |||
} else { | |||
this.removeClass('vjs-fullscreen'); | |||
// Making sure the Control text reverts back after pressing ESC | |||
this.controlBar.fullscreenToggle.controlText('Fullscreen'); |
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.
the fullscreen toggle handles the control text changes. We should make that component handle this use case correctly as well.
Currently the control's text updates even when an attempt to switch to fullscreen is unsuccessful, such as when in an iframe without |
@@ -28,6 +28,7 @@ class ClickableComponent extends Component { | |||
this.on('click', this.handleClick); | |||
this.on('focus', this.handleFocus); | |||
this.on('blur', this.handleBlur); | |||
player.on('fullscreenchange', this.handleFullscreenChange); |
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.
why not do this only in fullscreen-toggle
? Generic clickable-components don't need to know about it.
There are test failures. |
} | ||
else { | ||
this.removeClass('vjs-fullscreen'); | ||
this.controlBar.fullscreenToggle.controlText('Fullscreen'); |
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.
we should make sure the context for this method is the fullscreen toggle itself, otherwise it can be super confusing.
Also, would be nice to get a test for this, I think it'll just go into the |
* @method handleFullscreenChange | ||
*/ | ||
handleFullscreenChange() { | ||
let fst = this.player().controlBar.fullscreenToggle; |
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.
This seems unreliable - making the change that @gkatsev suggests would mean that fst
would be entirely replaced in this method by this
, which would make FullscreenToggle much more robust and extensible.
I think this needs to be brought up to date with |
@misteroneill How do the above changes look ? |
I think something went wrong in the rebase. You have extra commits in this branch now. |
# The first commit's message is: Squashing commits and rebasing Making changes to take into consideration fullscreen change on component Making proposed changes Removing test commented code Making the necessary changes and adding a test # The 2nd commit message will be skipped: # Adding the correct style to the test # The 3rd commit message will be skipped: # Removing duplicate instance of same test
Making changes to take into consideration fullscreen change on component Making proposed changes Removing test commented code Making the necessary changes and adding a test
809ad2d
to
7afa4a0
Compare
LGTM |
constructor(player, options) { | ||
super(player, options); | ||
this.on(player, 'fullscreenchange', this.handleFullscreenChange); | ||
} |
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.
new line after this and before the next comment.
One super small comment |
@gkatsev done |
My LGTM still applies 😄 |
LGTM |
This bug has returned. It is exactly as described in the original Description. I see it happening with version 7.6.6 in Chrome and Firefox. Here is a jsfiddle where it can be reproduced: https://jsfiddle.net/fzkLhs7e/1/. Should I open a new issue for this? |
Generally, best to open new issues for this as commenting on old things will likely get lost. Almost lost this but remembered seeing a comment about it as I'm currently refactoring our fullscreen support. |
I believe it will be fixed as part of #6422. |
Description
This PR is to make sure the correct control text is displayed on the Fullscreen button after pressing the ESC key while in Fullscreen mode.
Current Status:
(Steps to reproduce)
Fullscreen
. It reads asNon-Fullscreen
which is not correct.After this fix:
Follow Step 1 and Step 2 as above. Press the ESC key and the control text should now revert back to the correct text as
Fullscreen
Before this fix (current scenario)
After this fix
Specific Changes proposed
The changes made in this fix makes sure that we have the correct control text when you exit fullscreen mode.
Requirements Checklist