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

Controls not fading correctly on mobile #2886

Closed
poolodhi opened this issue Sep 30, 2020 · 9 comments
Closed

Controls not fading correctly on mobile #2886

poolodhi opened this issue Sep 30, 2020 · 9 comments
Assignees
Labels
component: UI The issue involves the Shaka Player UI status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@poolodhi
Copy link

Have you read the Tutorials?
yes

Have you read the FAQ and checked for duplicate open issues?
yes

What version of Shaka Player are you using?
3.0.4 and 2.5.10

Please ask your question
Is there a way to fade away the controls after some time in shaka player?

Currently, if we hover on seek bar or any other controls on the bottom menu the controls does not fade away after some time.
It only hides if we move the mouse somewhere out. While in mobile view it only fades when we touch somewhere outside.

Can you suggest a way to do so?

@poolodhi poolodhi added the type: question A question from the community label Sep 30, 2020
@joeyparrish
Copy link
Member

For a mouse, the behavior should be:

  1. When the mouse enters the video element, show the controls.
  2. If the video is paused or ended, the controls stay visible.
  3. If the mouse is over any specific control, the controls stay visible.
  4. If a menu is open, and another part of the page is clicked, the menu should close.
  5. If the mouse is idle for some time, but not over a specific control, and the video is not paused or ended, the controls fade.
  6. If the mouse leaves the video element, the controls fade.

For touch screens, the behavior should be:

  1. When the video frame is tapped, show the controls.
  2. If the video is paused or ended, the controls stay visible.
  3. If a menu is open, the controls stay visible.
  4. If a menu is open, and another part of the video is tapped, the menu should close.
  5. If nothing is touched for some time, but no menus are open, and the video is not paused or ended, the controls fade.

However, there seems to be a small bug on mobile. In my manual testing, I found:

  1. If I tap the overflow menu, then tap outside the video element, the menu closes and the controls fade.
  2. If I tap the overflow menu, then tap inside the video element, the menu closes (as it should), but the controls do not fade. This is a bug.

Does this help explain how things should work?

I will label this "bug" for now and try to fix the issue I just mentioned. Would this resolve your problem?

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed type: question A question from the community labels Sep 30, 2020
@joeyparrish joeyparrish self-assigned this Sep 30, 2020
@joeyparrish joeyparrish changed the title Fade away bottom controls after some time in shaka player? Controls not fading correctly on mobile Sep 30, 2020
@joeyparrish joeyparrish added the component: UI The issue involves the Shaka Player UI label Sep 30, 2020
@shaka-bot shaka-bot added this to the v3.1 milestone Sep 30, 2020
@poolodhi
Copy link
Author

poolodhi commented Oct 1, 2020

Thanks for the explanation for all the scenarios.

But does the bug you reported will fix the case when we click on any other item in the controls like seek bar or volume or any other custom controls (other than overflow menu). As in mobile view if we click on the above-mentioned controls, then they do not fade away until clicked somewhere else.
This is a concern for me.

@joeyparrish
Copy link
Member

I can reproduce that, yes. Something odd is happening, and I don't understand it yet. For some reason, on mobile, using touch events, the controls panel winds up in a "hover" state according to the browser.

I found a fix for this in the overflow menus, but it is still happening for other controls. I didn't notice the effect on, say, mute when I initially tested it.

@joeyparrish
Copy link
Member

Found another solution that works for everything. Once I get the changed through code review, they will be published to GitHub. Thanks!

shaka-bot pushed a commit that referenced this issue Oct 1, 2020
Conflicting touch event listeners in OverflowMenu and Controls led to
a weird situation in which the controls container was seen as being
hovered after tapping to close the overflow menu.  This, in turn, led
the controls to stay open instead of hiding.

Removing the extra event listener in OverflowMenu allows the controls
to be properly hidden when the overflow menu is closed.

Issue #2886

Change-Id: I18688efbcc6c4129b7b03e9daf00964d3a8d9802
joeyparrish added a commit that referenced this issue Oct 1, 2020
Conflicting touch event listeners in OverflowMenu and Controls led to
a weird situation in which the controls container was seen as being
hovered after tapping to close the overflow menu.  This, in turn, led
the controls to stay open instead of hiding.

Removing the extra event listener in OverflowMenu allows the controls
to be properly hidden when the overflow menu is closed.

Issue #2886

Change-Id: I18688efbcc6c4129b7b03e9daf00964d3a8d9802
joeyparrish added a commit that referenced this issue Oct 1, 2020
On pointerless touch-screen devices, :hover queries on an element do
not make sense.  In spite of this, they can pass on such devices after
a touch event, and elements even get stuck in this false :hover state.

Now we check if the device supports hovering before making the :hover
query on individual elements, which fixes the hiding on controls on
mobile after a touch event.

Closes #2886

Change-Id: I5ae0b0c84c69961c33df5e50f480b53495ab2694
joeyparrish added a commit that referenced this issue Oct 5, 2020
Conflicting touch event listeners in OverflowMenu and Controls led to
a weird situation in which the controls container was seen as being
hovered after tapping to close the overflow menu.  This, in turn, led
the controls to stay open instead of hiding.

Removing the extra event listener in OverflowMenu allows the controls
to be properly hidden when the overflow menu is closed.

Issue #2886

Backported to v2.5.x

Change-Id: I18688efbcc6c4129b7b03e9daf00964d3a8d9802
joeyparrish added a commit that referenced this issue Oct 5, 2020
On pointerless touch-screen devices, :hover queries on an element do
not make sense.  In spite of this, they can pass on such devices after
a touch event, and elements even get stuck in this false :hover state.

Now we check if the device supports hovering before making the :hover
query on individual elements, which fixes the hiding on controls on
mobile after a touch event.

Closes #2886

Backported to v2.5.x

Change-Id: I5ae0b0c84c69961c33df5e50f480b53495ab2694
@poolodhi
Copy link
Author

poolodhi commented Oct 6, 2020

Thanks for the help. Can you reply once its pushed?

@joeyparrish
Copy link
Member

The fix has already been pushed to the v3.0.x branch, and we are working to push out v3.0.5 very soon.

@poolodhi
Copy link
Author

poolodhi commented Oct 8, 2020

Just a request we are using 2.5.10 majorly on our application. Is it possible to give a patch release for that version?

@joeyparrish
Copy link
Member

The fix has been cherry-picked for both v2.5.17 and v3.0.5.

@joeyparrish
Copy link
Member

Both releases are live on GitHub and NPM already. There is an issue with our deployment to Google Hosted Libraries, which has delayed the release announcement email.

@shaka-project shaka-project locked and limited conversation to collaborators Nov 30, 2020
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: UI The issue involves the Shaka Player UI status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants