-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Video] The controls bar flickers when video's popover menu is closed #41125
Conversation
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.
@ikevin127 Observations on testing the PR version with expanded mode of video player are as below:
1) Chrome:
a) Click inside of player => Action Bar remains shown (without flicker)
b) Click outside of player => Action Bar hides
Chrome:Outside Click
fix-chrome-outside.mp4
2) Safari:
a) Click inside of player => Action Bar remains shown (without flicker)
b) Click outside of player => Action Bar remains shown. Only after mouse move, it hides.
Safari:Outside Click
fix-safari-outside.mp4
So, while the flicker issue is resolved, we still have an inconsistency issue between Chrome and Safari when clicked outside. Here, the expected behavior is for the Action bar to be hidden on clicking outside on Safari (i.e. just like Chrome does).
What do you think?
@rojiphil I think given that the flicker issue is resolved, the behaviour on Safari is strictly related to browser-specific handling of the From what I can see, on Safari, once the popover is closed, the user needs to actually move the cursor outside of the video view for the controls to dissapear which means that the Hoverable component only captures the mouse moving once the user actually moves it. I think these are just small differences between how Safari vs other browsers handle the If you think this is a PR blocker then let me know and I'll spend a few more days looking into this in hopes to align the behaviour from Safari with other browsers. |
@ikevin127 The behavior on Safari changed only after this PR. Before the fix, the action bar hid when clicked outside the player. But now it doesn't. To me, this is a regression and needs a fix. no? |
This comment was marked as outdated.
This comment was marked as outdated.
@rojiphil I looked into it and I can't find a solution. The problem is that Safari doesn't re-capture the MacOS: Safari (before / after)
As you can see on the before video on Safari, the issue on current main is that when the popover closes the video controls are hidden and only show up when the user moves the mouse over the video. With the fix, this issue is solved, but this thing will happen now with hiding the controls when cursor is outside -> which only works when user moves the mouse outside of the video in order for Safari to re-capture the Again, this is a weird Safari specific issue where cursor-related events are not fired unless the user actually moves the cursor. To conclude, it's either you're fine with moving forward with this as is, or I'm going to close this PR and the issue can continue to look for other proposals which will cover everything you're asking for, perfectly. I, for one, I'm not willing to invest anymore more time into this as my capacity is limited and additionally -> I consider the issue is fixed and the behaviour on Safari evens out if we compare before / after. Let me know what you decide! |
The worry I have here is that the PR changes have changed behavior as mentioned here and here. However, since it is only until the mouse moves again, it may also be fine. I would want @mountiny to weigh in here and arrive at a consensus. What’s your take here? |
I agree with @ikevin127 it's a really small edge case and it seems like a Safari bug. I tried using the |
I wasn't able to find any solution for this problem in my limited time capacity. @mountiny should we go with current solution or try to get different proposal that doesn't introduce any regression? |
I wouldn't call the observed behaviour a
|
@rojiphil @ikevin127 I dont think this is a problem, we can go ahead with this PR if that is the only thing noticed |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari39598-web-safari.mp439598-web-chrome.mp4Android: Native39598-android-native.mp4Android: mWeb Chrome39598-mweb-chrome.mp4iOS: Native39598-ios-native.mp4iOS: mWeb Safari39598-mweb-safari.mp4MacOS: Desktop39598-desktop.mp4 |
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.
Thanks @ikevin127. LGTM and tests well too.
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.
Thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.74-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.4.74-6 🚀
|
Details
Because within our VideoPopoverMenu component we're using a portal, when this is open it comes on top of the
BaseVideoPlayer
Hoverable surface of the video. These are the events that occur which lead to our issue:Our issue occurs between (2.) and (3.) in very quick succession which causes the flicker of the video player controls bar because of this condition here, specifically the isHovered state variable coming from the Hoverable component which wraps the video container, toggling false/true in quick succession right after the isPopoverVisible becomes false.
This PR introduces a new boolean prop to the
Hoverable
component, namedshouldFreezeCapture
which will be used within theActiveHoverable
component to prevent setting the isHovered state to false the second time (unnecessarily) when an open portal (popover / modal) is being closed, essentially freezing the capture of the hover event.Note
This behaviour and fix can observed only on large layout devices where hover event is available.
Fixed Issues
$ #39598
PROPOSAL: #39598 (comment)
Tests
Tip
More
) button to open the Popover (you should see thePlayback speed
option).Offline tests
TLDR: same as Tests.
Tip
More
) button to open the Popover (you should see thePlayback speed
option).QA Steps
TLDR: same as Tests.
Tip
More
) button to open the Popover (you should see thePlayback speed
option).PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.MP4
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov