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

Don't toggle play/pause when cliking the player screen #675

Closed
wants to merge 1 commit into from
Closed

Don't toggle play/pause when cliking the player screen #675

wants to merge 1 commit into from

Conversation

gsamokovarov
Copy link
Contributor

At least on OSX, its pretty common for players to allow you to drag the window and it gets pretty annoying to pause the playback while doing so. The click also gets in the way of the double click for quick fullscreen.

The solution is kinda hacky, as it monkey patches videojs.

At least on OSX, its pretty common for players to allow you to drag the
window and it gets pretty annoying to pause the playback while doing so.
The click also gets in the way of the double click for quick fullscreen.

The solution is kinda hacky, as it monkey patches videojs.
@gsamokovarov
Copy link
Contributor Author

Thats still a monkey patch. I don't override the onClick handler with a noop, because it will just waste CPU cycles. That way, at least, we don't respond to the mousedown event at all.

Its hacky either way.

EDIT:

This is a response to a comment that got deleted. It was:

@gsamokovarov : you don't need to monkeypatch videojs if you want to disable the onclick play/pasue, you can just override the onclick itself:
vjs.MediaTechController.prototype.onClick = function() {};

Let it stay here for history's sake.

@maracaipe
Copy link

Don't like it, i play/pause the video by clicking the player, but the current mode is bad. I made a pull request (#389) to change from onMouseDown to onMouseUp.

@gsamokovarov
Copy link
Contributor Author

That's even worse. First it changes upstream (vendored) code, second those objects doesn't event respond to onMouseUp methods. (E.g. nobody bind events to such methods anywhere in those classes).

I guess the patch was made directly from the GitHub interface (because of the patch-1 name) and it haven't been actually run. I ran it and it blows up the app with:

Uncaught TypeError: Cannot read property 'guid' of undefined

Since the methods videojs wants to call are no longer defined.

@PerfectSlayer
Copy link

👎 I like the capability to pause video on clicking it (like youtube).

Moreover, I saw an other issue with click / doubleclick event.

@isra17
Copy link

isra17 commented Mar 14, 2014

I think a fix could be to distinguish click from drag. A quick click should toggle the video and a drag should move the window without pausing the video. This should be doable by adding a small timeout after a mousedown event to see if there was a mouseup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants