23

Is it possible to do the following things with VLC?

  • Make the playback window stay always on top
  • Make the playback window transparent when another window has the focus?

This would allow watching videos while doing other things such as checking emails since you could still access other windows (assuming the player is not maximized).

ThiefMaster
  • 6,505
  • 9
  • 38
  • 43

5 Answers5

25

To make the playback window always on top select Video -> Always On Top from the menu. (Mac Video -> "Float on Top")

I don't see a way to change the transparency when VLC goes out of focus without using a window manager that has this capability. You can change the transparency in VLC manually though.

To make the playback window transparent:

  • Tools -> Preferences
  • Show All Settings -> Click the plus next to Interface -> Main Interface
  • Change the Interface Module to Qt Interface
  • Click the plus next to Main Interface -> Qt
  • Change the Window Opacity to the desired amount
  • Close and reopen VLC for the change to take effect
Jason
  • 611
7

I've adapted an AutoHotKey script from here which will do what you ask (on Windows - I don't know if there's an AutoHotKey for Linux).

When the script is run, it finds a window with "VLC media player" in the title and makes it 60% transparent and 'unclickable'. To exit the script and reactivate VLC, right click the green H in the taskbar and choose Exit.

If you trust me, a (decompilable) compiled version of this which sets one running VLC instance to 60% transparency and unclickable is here: https://www.dropbox.com/s/to4wrlmnuym9kjb/TransparentVLC.exe

If you don't trust me, want to adapt it for use with Media Player Classic (it's just better =), or just want to learn, install AutoHotKey and run this script: https://www.dropbox.com/s/exj00fpssx761lc/TransparentVLC.ahk

If my links are broken, the AHK code follows:

/*
WinSet_Click_Through - Makes a window unclickable. Written by Wicked & SKAN.
I - ID of the window to set as unclickable.
T - The transparency to set the window. Leaving it blank will set it to 254. It can also be set On or Off. Any numbers lower then 0 or greater then 254 will simply be changed to 254.
If the window ID doesn't exist, it returns 0.
*/

WinSet_Click_Through(I, T="254") {
   IfWinExist, % "ahk_id " I
   {
      If (T == "Off")
      {
         WinSet, AlwaysOnTop, Off, % "ahk_id " I
         WinSet, Transparent, Off, % "ahk_id " I
         WinSet, ExStyle, -0x20, % "ahk_id " I
      }
      Else
      {
         WinSet, AlwaysOnTop, On, % "ahk_id " I
         If(T < 0 || T > 254 || T == "On")
            T := 254
         WinSet, Transparent, % T, % "ahk_id " I
         WinSet, ExStyle, +0x20, % "ahk_id " I
      }
   }
   Else
      Return 0
}
#SingleInstance force
#Persistent
;app code starts here
;get window ID for a VLC instance
ID := WinExist("VLC media player")

;set it to 60% transparent and unclickable
WinSet_Click_Through(ID, 0.6 * 255)

;wait until the user quits, then show window again
OnExit, AppEnd
Return

AppEnd:
;set it back to clickable
WinSet_Click_Through(ID, "Off")
ExitApp
Luke
  • 1,155
2

On OSX, when you set Opaqueness in the Interface > macosx, it's sufficient to enter fullscreen and exit fullscreen for the changes to take effect.

Erik
  • 200
1

One or more of the Skrommel applications might do the job :

WinWarden - Automatically control how to display a window.
TransOther - Make all windows but the active one transparent.
OnTop - Puts a window on top of all others.

Another possibility is the free Eusing Auto Window Manager which can set VLC to always on-top and transparent.

harrymc
  • 498,455
0

Expanding on Luke's code, the code below is for AutoHotkey v2.0.18 and for any window. The hotkeys here can be changed by changing "#o::" (Win + O) to something like "#n::" (Win + N).

  1. Install AutoHotkey
  2. Save the code below as *.ahk
  3. Run the *.ahk file
  4. Open or focus on the window which will be made transparent
  5. Press Win+I and make sure the information of active window is right, then click "Proceed"
  6. Press Win+M to instantly hide/show the window, press Win+O to change the transparency and click through
  7. Right click the green H in the taskbar to exit
; WinSet_Click_Through - Makes a window unclickable.

WinSet_Click_Through(I, T := "Off", S := 0) { if WinExist("ahk_id " I) { if (S = 1) { WinSetAlwaysOnTop(true, "ahk_id " I) WinSetExStyle("+0x20", "ahk_id " I) } else { WinSetAlwaysOnTop(false, "ahk_id " I) WinSetExStyle("-0x20", "ahk_id " I) } WinSetTransparent(T, "ahk_id " I) } else { return 0 } }

#SingleInstance Force

; Using the class name "Qt5QWindowIcon" for VLC window VLCClass := "Qt5QWindowIcon" ; Correct class name for VLC VLCTitle := "VLC media player" ; You can use the window title if needed

; Attempt to find VLC window by class name ID := WinExist("ahk_class " VLCClass)

if (ID) { ; MsgBox "VLC window found by class!" } else { ; If VLC is not found by class, try by title (you can use the full title if needed) ID := WinExist("ahk_title " VLCTitle) if (ID) { ;MsgBox "VLC window found by title!" } else { ;MsgBox "VLC window not found!" ;ExitApp() } }

; Set it to 60% transparent initially OriginalTransparency := Round(0.6 * 255) OriginalSpecial := 1 WinSet_Click_Through(ID, OriginalTransparency, OriginalSpecial)

MyGui := Gui(, "Transparency Control") MyGui.Add("Text",, "Transparency:") MyGui.Add("Text", "y+25", "Click Through:") MyGui.Add("Slider", "vTransparency ym", 60) ; The ym option starts a new column of controls. MyGui.Add("CheckBox", "vSpecial Checked") MyGui.Add("Button", "default", "OK").OnEvent("Click", ProcessUserInput) MyGui.OnEvent("Close", ProcessUserInput)

ProcessUserInput() { Global OriginalTransparency, OriginalSpecial Saved := MyGui.Submit() ; Save the contents of named controls into an object. OriginalTransparency := Round(Saved.Transparency255/100) OriginalSpecial := Saved.Special WinSet_Click_Through(ID, OriginalTransparency, OriginalSpecial) }

; Hotkey (Win + M) to toggle between transparent and original transparency #m:: { ; Get the current transparency of the VLC window if !WinExist("ahk_id" ID) { return 0 } CurrentTransparency := WinGetTransparent(ID)

if (CurrentTransparency != 0) {
    ; Set it to fully transparent (0 opacity)
    WinSet_Click_Through(ID, 0, 0)
} else {
    ; Set it back to original transparency (60%)
    WinSet_Click_Through(ID, OriginalTransparency, OriginalSpecial)
}

}

; Hotkey (Win + O) to show transparency and click through #o:: { WinSet_Click_Through(ID, 255, 0) WinSet_Click_Through(ID, 255, 0) MyGui.Show() }

; Hotkey (Win + I) to confirm changing window to make transparent #i:: { TempID := WinExist("A") TempGui := Gui(, "Ready to change window") TempGui.Add("Text", , "Window Title: " WinGetTitle()) TempGui.Add("Text", , "Window Class: " WinGetClass()) TempGui.Add("Text", , "Process Name: " WinGetProcessName())

TempGui.Add(&quot;Button&quot;, &quot;Default&quot;, &quot;Proceed&quot;).OnEvent(&quot;Click&quot;, (*) =&gt; ProceedAction(TempGui, TempID))
TempGui.Add(&quot;Button&quot;, , &quot;Cancel&quot;).OnEvent(&quot;Click&quot;, (*) =&gt; TempGui.Destroy())
TempGui.Show()

}

; Wait until the user quits (no need for a Return before OnExit) OnExit(AppEnd)

; Main loop to keep the script running

ProceedAction(gui, TempID) { WinSet_Click_Through(ID, "Off", 0) Global ID ID := TempID gui.Destroy() WinSet_Click_Through(ID, OriginalTransparency, OriginalSpecial) }

AppEnd(*) { ; Restore window state to clickable and default transparency if (ID) { WinSet_Click_Through(ID, "Off", 0) } ExitApp() }