-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Prevent Focus Loss When Skip Button is Pressed #6413
base: release-10.10.z
Are you sure you want to change the base?
Conversation
Cloudflare Pages deployment
|
// Handle focus after the hide transition completes | ||
if (document.activeElement === this) { | ||
this.blur(); | ||
const pauseButton = document.querySelector('.btnPause'); | ||
if (pauseButton && focusManager.isCurrentlyFocusable(pauseButton)) { | ||
focusManager.focus(pauseButton); | ||
} | ||
} |
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 should be considered as a temporary solution. We need to move the skip button to the video OSD (maybe in 10.11).
Quality Gate passedIssues Measures |
Hey, one thing I noticed, unrelated to the PR, is that on my TV (WebOS 6; this doesn't happen on PC browsers), when the button is pressed, it briefly reappears after the seek and then hides again. |
Maybe it seeks on the keyframe that is before the end of the segment? |
if (osdBottomElement.contains(document.activeElement) | ||
|| headerElement.contains(document.activeElement)) { |
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.
Just remembered about SubtitleSync
- it was blurred by the OSD. Currently we only blur the elements that belong to the OSD. So we should make SubtitleSync
to blur itself near this:
subtitleSyncContainer.classList.add('hide'); |
We could also just revert the blurring to if (document.activeElement)
since we are hiding everything anyway. Then we probably need to fix the refocusing on the pause button when hiding the skip button.
But since, as I said, it (blur) is probably unnecessary now, we can leave it as is (for now) and remove it completely later.
For the record, this is reproducible in Firefox 72. We don't have to support such an old Firefox because it can/should be updated unlike the web engine in TV.
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.
Another thing: SubtitleSync
can't be accessed using navigation keys if the skip button is visible.
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.
Another thing:
SubtitleSync
can't be accessed using navigation keys if the skip button is visible.
Yes, this is a problem with current navigation in general: we don't have a "navmap", the focus manager moves along horizontal and vertical "lanes".
We could probably search for the nearest element within the container crossed by the lane. Obviously not for this PR.
It would also be better to take into account how the navigation will be implemented in React.
Addresses the focus-related issue when interacting with the skip button during playback.
Updates the logic to retain focus on the skip button when the OSD hides.