46

Is it possible to play/pause a movie just by clicking on the window?

I really miss this feature from Media Player Classic, but from what I could find, it's not possible in VLC.

Alexander Abakumov
  • 488
  • 2
  • 8
  • 19
alex
  • 17,684
  • 7
  • 54
  • 77

9 Answers9

25

UPDATE on some links posted under this question.

Nurupo's vlc-pause-click-plugin plugin — already mentioned, now fully implements the desired feature (unlike the addon also mentioned here and comming with a requirement of manually enabling it each time, which made it an improbable solution).

The vlc-pause-click-plugin is cross-platform and works with 2.1, 2.2, 3.0 and even nightly 4.x builds.

Installation depends on the platform.

Some settings are needed after installation under Advanced Preferences

enter image description here

enter image description here

enter image description here

Here, for "Pause click" filter, multiple mouse button choices are available: left, right, middle click, and other options

enter image description here

enter image description here

Right mouse click is maybe the best option (while disabling context menu on right click) in case left-click interferes with DVD menus as some people claimed.

As for the difficulty of installing the plugin and accessing the advanced options (like mentioned under this question), that is probably either caused by not following the installation instructions or by not using the latest versions. (I have enabled this feature without any problems with VLC 3.0.8, 64-bit on Windows, Linux and Mac; on Mac I have also tested versions 2.1 and 2.2, and only the last one didn't work.)

cipricus
  • 965
  • 1
  • 10
  • 29
  • In my case, it was necessary to restart the program for the changes to take effect! – Akito Sep 08 '22 at 22:30
  • 1
    @FahriGüreşçi - the option is added by the Nurupo's plugin. You have to install that first. – cipricus Nov 06 '22 at 20:54
  • This is the correct answer. – ETL Dec 11 '22 at 02:32
  • Didn't work on VLC 3.0.18 and Ubuntu 22.04. After installation & restart no extra menu items appeared. – Apogentus Feb 02 '23 at 15:27
  • @Apogentus - you should complain under urupo's github linked in question, not here. – cipricus Feb 03 '23 at 13:38
  • @Apogentus - I wonder why you have 3.0.18 in 22.04 when I have 3.0.17.4 Vetinari in 22.10. Is VLC installed from snaps maybe? I see on snapstore that they propose 3.0.18. Snap VLC is not supported by this plugin, as you can see [here](https://github.com/nurupo/vlc-pause-click-plugin#snap), but ftatpak and apt installation should be fine. – cipricus Feb 03 '23 at 14:14
  • 1
    @cipricus I have removed snap installation of VLC through Ubuntu Software and reinstalled it with 'sudo apt install vlc'. The plugin now works like charm. It even didn't hurt full screen/window preview on doubleclick. Very convenient! – Apogentus Feb 03 '23 at 16:59
7

This extension of VLC does pause/play with a single click on the screen. It works with versions 2.1, 2.2 and 3.0.

galath
  • 269
  • 2
  • 4
  • 1
    The feature has to be manually enabled each time you start the player though –  Oct 08 '17 at 12:52
  • 1
    The package does not look not maintained, unfortunately. It used to work without needed manually enabling it. Now it won't work, I haven't checked why. I'll update my comment if I solve it. – galath Oct 11 '17 at 09:09
  • 1
    Tested with VLC 3.0.6 32bit running on Win7 64bit (no idea why I didn't install 64-bit VLC way-back-when, but too lazy to change it). Works like a charm and doesn't need re-enabling. (the opposite in fact, you need to restart the player once after setting up for the changes to take effect) – Tobl May 31 '19 at 10:24
  • 1
    https://github.com/nurupo/vlc-pause-click-plugin was updated 10 days ago. – Ryan Aug 12 '19 at 17:31
  • I guess the initial link was updated so that it sends not to the *addon* that needed enabling each time, but to the *plugin* ( nurupo / vlc-pause-click-plugin) that I detail in my answer. – cipricus Apr 03 '20 at 07:22
4

If you right click on the VLC window a menu list comes up with play, pause and more yepon it. I use this all the time.

Zooks64
  • 2,012
  • 14
  • 14
  • 6
    It's ok, but not what I want. I want to left click and pause. – alex Aug 05 '10 at 20:56
  • 1
    just a related tip: drag with right mouse button in the direction of "play/pause" option instead. it's a bit faster and barely worse than single click play/pause – a13ph May 20 '14 at 22:16
  • 1
    That is insane that clicking in the center of the video is doing nothing. How on earth developers never came with idea to use this to pause/play. If you wan't to have this "exotic" feature then you have to install porly maintained third party plugins What's wrong with people. Am I insane to say that it's the most intuitive way of pausing playing video? I remember waiting for it also few years to finally be implemented in Classic Media Player on Windows. That's ridiculous. – stopsopa Sep 13 '22 at 15:14
3

Note: As of 2021 October, the link below gets redirected to track.vcdc.com. Use caution.

There is a tool called Nifty Windows, it allows you to associate an action with a press of the mouse. These actions can be key combinations, or execution of a program.

Hope this helps.

bryan
  • 8,400
  • 4
  • 28
  • 41
3

I've created lua extension for doing exactly what you want to do. Please check project at github or videolan addons page

3demax
  • 57
  • 1
  • 3
  • 2
    Aaand... from the project page: "You need to tick it every time you open VLC. This is a limitation of VLC lua api." Why in the hell this has to be so hard ?! – Halil Özgür Oct 20 '13 at 23:57
  • @HalilÖzgür: as you noticed, "This is a limitation of VLC lua api." +1, but indeed, the need to tick it every time you open VLC is a big downside –  Dec 07 '13 at 16:17
  • 3
    Why on earth it's so hard to bind primary click to play/pause in such a popular player? This shouldn't even need an extension. And then, the requirement of the extension is ridiculous, regardless of the origin. For this reason I'm using SMPlayer. – Halil Özgür Dec 07 '13 at 21:46
  • 1
    Even worse, this extension doesn't work with newer versions of vlc. The `vlc.var.add_callback` method has been removed from the lua API. I am unaware of another way to bind functions in a lua extension to a key. – con-f-use Jan 02 '16 at 14:53
  • 3
    It's true, seems like there is no way to do this with lua anymore. Instead, take a look at [nurupo's pause-click-plugin](https://github.com/nurupo/vlc-pause-click-plugin) Worked for me some time ago. – 3demax Jan 09 '16 at 19:27
2

I am using X-mouse button control and it does exactly what you are asking.

Only be sure to use "simulated keys" {SPACE} and untick "block original mouse input" to allow double clicking.

jack bauer
  • 21
  • 1
2

A funny alternative to left-click would be mouse gestures, as indicated here:

- enable mouse gestures in VLC
- select left mouse button
- left-click & a quick left-right (or right-left) movement to play/pause.

The result is real... but you have to avoid other two very similar gestures:

 Move left: Navigate 10 seconds backward 
 Move right: Navigate 10 seconds forward

DETAILS:

Go to Tools > Preferences [CTRL + P].

Click on All under show settings to go to Advanced settings.

Navigate to Interface > Control interfaces.

Check the option that says Mouse gestures control interface.

enter image description here

Navigate further down to Interface > Control interfaces > Gestures.

enter image description here

To toggle play or pause: click the mouse button you selected and move left and then right: (Also works if you move right and then left)

But the mouse gestures are not customizable (and you cannot chose to disable some of those you don't need). Therefore, avoid other moves like up and down to avoid making other gestures and trigger other actions like down and then left which quits the player


For reference, the list of all gestures:

Move left: Navigate 10 seconds backward
Move right: Navigate 10 seconds forward
Move up: Increase volume
Move down: Decrease volume
Move left and then right: Toggle play or pause (Also works if you move right and then left)
Move up and then down: Mute volume (Also works if you move down and then up)
Move left and then up: Slow down playing speed
Move right and then up: Increase playing speed
Move left and then down: Play previous track of playlist
Move right and then down: Play next track in playlist
Move up and then right: Switch the audio track
Move down and then right: Switch the subtitle track
Move up and then left: Enables full screen
Move down and then left: Exit VLC media player
2

Apparently the question is still valid.

My workaround - simple and working - is the one using xdotool and xinput.

You need to create a script myVlc (or alias vlc) like this:

#!/bin/bash    
xinput set-button-map DEV_ID 1 2 10 4 5 6 7 8 9
vlc "$@"
xinput set-button-map DEV_ID 1 2 3 4 5 6 7 8 9

It rebinds right_mouse_button into Button10. For middle button just use 1 10 3 4…. To be sure double check with xev.

You have to replace DEV_ID with your mouse id. See xinput.

Or you may grep it as well:

xinput | grep -i mouse -m 1 | sed -E 's/.*id=([0-9]*).*/\1/'

So the script will be:

#!/bin/bash
xinput set-button-map $(xinput | grep -i mouse -m 1 | sed -E 's/.*id=([0-9]*).*/\1/') 1 2 10 4 5 6 7 8 9
vlc "$@"
xinput set-button-map $(xinput | grep -i mouse -m 1 | sed -E 's/.*id=([0-9]*).*/\1/') 1 2 3 4 5 6 7 8 9

Then rebind Button10 of your WM into space. For Openbox it goes like that (rc.xml):

<context name="Client">
  <mousebind button="Button10" action="Click">
    <action name="Execute">
      <command>xdotool key space</command>
    </action>
  </mousebind>
</context>

Actually one could rebind RMB or MMB directly into space, but that would conflict with default RMB/MMB behaviour. And usually we don't want that.

Using myVlc RMB/MMB will be rebound only while running vlc.

sZpak
  • 21
  • 2
1

This solution developed and tested by me in Ubuntu 18.04 with VLC 3.

To be able to pause/play VLC player by mouse button, I have created a script file. It runs every time the related mouse button clicked. The script check if the active window title contains "VLC media player". If true, then send "space" key.

Script file content:

wintitle=$(xdotool getwindowfocus getwindowname);
p=" - VLC media player$" ;
if [[ $wintitle =~ $p ]]; then 
    xte 'key space' 
fi

xbindkeys needs to be installed to catch and configure mouse events. I edited ~/.xbindkeysrc file and added some codes as follow:

"bash  /home/user/test/control_by_mouse.sh"
b:8  #mouse back button

After that, the following command should be run

xbindkeys

So, every time I press the back button on mouse, the specified script file run.

To get mouse buttons numbers:

xev

The folowing packages needed for this work on my Ubuntu system:

sudo apt install xbindkeys xautomation xev xdotool

Previously I posted this note at https://mim.mbirgin.com/?c=posts&id=105

podcast
  • 11
  • 2
  • I am the author. I created the note for me in the linked site and felt it would be useful if put it here. Sorry if I make any mistake.. If there is a problem I could delete it. How can I disclose it as it is my work? – podcast Oct 27 '18 at 02:27
  • Just [edit] your answer again, and edit the last line to say something like “I previously posted this answer at ____”, and you’ll be fine. – Scott - Слава Україні Oct 27 '18 at 02:43
  • Thanks for making the edit to your post. As you've determined, the disclosure requirements aren't intended to be onerous. When it's your own content, it's really pretty easy, just like you've done here. – Makyen Oct 27 '18 at 03:50