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

Touch event to display UI controls is incorrect? #8164

Closed
MarianoFacundoArch opened this issue Feb 26, 2025 · 4 comments · Fixed by #8180
Closed

Touch event to display UI controls is incorrect? #8164

MarianoFacundoArch opened this issue Feb 26, 2025 · 4 comments · Fixed by #8180
Labels
component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Milestone

Comments

@MarianoFacundoArch
Copy link
Contributor

Hello all,
I think the touch control we are using to open the UI controls is not correct.
Currently, this is the related code:

    this.eventManager_.listen(this.controlsContainer_, 'touchstart', (e) => {
      this.onContainerTouch_(e);
    }, {passive: false});
  onContainerTouch_(event) {
    if (!this.video_.duration) {
      // Can't play yet.  Ignore.
      return;
    }

    if (this.isOpaque()) {
      this.lastTouchEventTime_ = Date.now();
      // The controls are showing.
      // Let this event continue and become a click.
    } else {
      // The controls are hidden, so show them.
      this.onMouseMove_(event);
      // Stop this event from becoming a click event.
      event.cancelable && event.preventDefault();
    }
  }

The problem with this code is that, if we are loading the player inside an iframe and we are on a phone, when we start the scrolling in the player, the scroll never happens; instead, it gets prevented and the UI controls are displayed instead. However, once the UI controls are visible, we are enabled to scroll.

Shouldn't this be changed accordingly to fix this weird behavior?

@MarianoFacundoArch MarianoFacundoArch added the type: question A question from the community label Feb 26, 2025
@avelad
Copy link
Member

avelad commented Feb 26, 2025

@theodab can you review it? Thanks!

@MarianoFacundoArch
Copy link
Contributor Author

Maybe the correct event would be on touch end instead of start?

@avelad
Copy link
Member

avelad commented Feb 26, 2025

Maybe yes, @joeyparrish do you have any opinion about it?

@avelad avelad added type: bug Something isn't working correctly component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround and removed type: question A question from the community labels Feb 27, 2025
@avelad avelad added this to the v4.14 milestone Feb 27, 2025
@avelad avelad closed this as completed in 97f2255 Feb 27, 2025
@MarianoFacundoArch
Copy link
Contributor Author

Great!
When shall this be released in a version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants