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

How to remove the click event, but remain the fullscreen event #7123

Closed
DevsimX opened this issue Mar 6, 2021 · 3 comments
Closed

How to remove the click event, but remain the fullscreen event #7123

DevsimX opened this issue Mar 6, 2021 · 3 comments

Comments

@DevsimX
Copy link

DevsimX commented Mar 6, 2021

Description

  • i use the the controls, but when i click the video, it will pause, i want to remove this event, what should i do?
    if i cancel the pointer-event in css, the all controls will be removed. but i want to use the fullscreen button.
    which means i only need to use the fullscreen button, how can i do it? help
@welcome
Copy link

welcome bot commented Mar 6, 2021

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@gkatsev
Copy link
Member

gkatsev commented Mar 23, 2021

Unfortunately, we don't have an option for that right now. Though, I think we've gotten a few requests for this, so, maybe an option for this makes sense. We have userActions.doubleClick, so, maybe a userActions.click makes sense.
If you're interested in making a PR, that would be great. Would require updating handleTechClick_ here

video.js/src/js/player.js

Lines 1921 to 1925 in 0cc8684

if (this.paused()) {
silencePromise(this.play());
} else {
this.pause();
}
with that option similarly to how it's used in handleTechDoubleClick_ right now here

video.js/src/js/player.js

Lines 1950 to 1977 in 0cc8684

/*
* options.userActions.doubleClick
*
* If `undefined` or `true`, double-click toggles fullscreen if controls are present
* Set to `false` to disable double-click handling
* Set to a function to substitute an external double-click handler
*/
if (
this.options_ === undefined ||
this.options_.userActions === undefined ||
this.options_.userActions.doubleClick === undefined ||
this.options_.userActions.doubleClick !== false
) {
if (
this.options_ !== undefined &&
this.options_.userActions !== undefined &&
typeof this.options_.userActions.doubleClick === 'function'
) {
this.options_.userActions.doubleClick.call(this, event);
} else if (this.isFullscreen()) {
this.exitFullscreen();
} else {
this.requestFullscreen();
}
}

@Youmyin
Copy link

Youmyin commented Aug 7, 2021

Following

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2022
edirub pushed a commit to edirub/video.js that referenced this issue Jun 8, 2023
…ed (videojs#7495)

Pass `false` as `userAction.click` to disable the default click-to-play behavior. Alternatively, pass in a function, to enable custom behavior.

Fixes videojs#7123.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants