Skins and Lua-script

Discuss your Lua playlist, album art and interface scripts.
csx333
New Cone
New Cone
Posts: 2
Joined: 29 Jun 2023 12:57

Skins and Lua-script

Postby csx333 » 29 Jun 2023 13:07

I wrote a playlist script in lua and it works well in the standard interface but when I use a skin it doesn't.
Is there a way to use a custom skin and a lua playlist script simultaneously ?

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: Skins and Lua-script

Postby unidan » 29 Jun 2023 16:47

Hi, just to be sure, can you share the script (potentially with the inner function blanked so that I can see the structure)?

playlist lua script are independant of the interface, but lua extensions like service discovery are only loaded by the Qt interface currently.

csx333
New Cone
New Cone
Posts: 2
Joined: 29 Jun 2023 12:57

Re: Skins and Lua-script

Postby csx333 » 30 Jun 2023 19:30

Hi, here is the code...
nothing advanced - I'm just using VLC to search for songs and ambience sounds for my video editing.

Code: Select all

require 'common' function descriptor() return { title = "SongSearchRandom"; version = "1.0"; author = ""; url = ''; shortdesc = "SongSearchRandom"; description = "<div><b>Starts next Track at Random Time and copies Path to Clipboard</b></div"; capabilities = {"input-listener" } } end function getName() -- copy path to clipboard local item = vlc.input.item() local uri = item:uri() uri = string.gsub(uri, '^file:///', '') uri = string.gsub(uri, '/', '\\') uri = string.gsub(uri, '%%20', ' ') strCmd = 'echo '..uri..' |clip' os.execute(strCmd) end function seeker() math.randomseed(os.time()) -- random initialize math.random(); math.random(); math.random() -- warming up x = math.random(20,80) y = tostring(x).."%" common.seek(y) -- seeks random % of track end function activate() seeker() getName() end function deactivate() end function meta_changed() end function input_changed() vlc.playlist.pause() seeker() getName() end
I activate the script via the view menu - or in skinned mode via the context menu. But when VLC is skinned nothing happens.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 8 guests