57

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.

0

9 Answers 9

35

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.)

7
  • 1
    In my case, it was necessary to restart the program for the changes to take effect!
    – Akito
    Commented Sep 8, 2022 at 22:30
  • 1
    @FahriGüreşçi - the option is added by the Nurupo's plugin. You have to install that first.
    – cipricus
    Commented Nov 6, 2022 at 20:54
  • This is the correct answer.
    – ETL
    Commented Dec 11, 2022 at 2:32
  • Didn't work on VLC 3.0.18 and Ubuntu 22.04. After installation & restart no extra menu items appeared.
    – Apogentus
    Commented Feb 2, 2023 at 15:27
  • 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
    Commented Feb 3, 2023 at 16:59
7

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.

3
  • 6
    It's ok, but not what I want. I want to left click and pause.
    – alex
    Commented Aug 5, 2010 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
    Commented May 20, 2014 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
    Commented Sep 13, 2022 at 15:14
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.

5
  • 2
    The feature has to be manually enabled each time you start the player though
    – user162573
    Commented Oct 8, 2017 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
    Commented Oct 11, 2017 at 9: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
    Commented May 31, 2019 at 10:24
  • 1
    github.com/nurupo/vlc-pause-click-plugin was updated 10 days ago.
    – Ryan
    Commented Aug 12, 2019 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
    Commented Apr 3, 2020 at 7:22
4

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
0
3

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

5
  • 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 ?! Commented Oct 20, 2013 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
    – user162573
    Commented Dec 7, 2013 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. Commented Dec 7, 2013 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
    Commented Jan 2, 2016 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 Worked for me some time ago.
    – 3demax
    Commented Jan 9, 2016 at 19:27
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.

0
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.

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.

0
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

3
  • 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
    Commented Oct 27, 2018 at 2: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. Commented Oct 27, 2018 at 2: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
    Commented Oct 27, 2018 at 3:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .