Running extension in the background

Discuss your Lua playlist, album art and interface scripts.
Hamid_PaK
New Cone
New Cone
Posts: 3
Joined: 19 Jan 2020 19:24

Running extension in the background

Postby Hamid_PaK » 19 Jan 2020 21:44

I apologize if this question was asked already, I'm trying to develop an extension for VLC in Lua but for some reasons as soon as I hide the dialog I cannot show it back and reactivating the extension from the Menu also destroys/deactivates it completely and won't reshow the previous state.

Is there any way to achieve this?

I only test this code below on macOS I'm not sure if the issue is related to the OS:

Code: Select all

local dlg = nil local function handle_hide() dlg:hide() end function descriptor() return { title = "Test", version = "0.1.0", } end function meta_changed() return false end function close() vlc.deactivate() end function activate() local row = 0 dlg = vlc.dialog("Show Tracker") dlg:add_button("Hide", handle_hide) end function deactivate() end
I'm running VLC v3.0.8

Hamid_PaK
New Cone
New Cone
Posts: 3
Joined: 19 Jan 2020 19:24

Re: Running extension in the background

Postby Hamid_PaK » 21 Jan 2020 03:16

I made it work by checking the status of the player and show the dialog on `input_changed()`:

Code: Select all

function input_changed() -- ... some other logic if vlc.player.status() == "stopped" then dlg:show() end end
just a small problem it seems `playing-listener()` never gets triggered on macOS :|

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Running extension in the background

Postby mederi » 21 Jan 2020 13:10

It is possible to define a (sub)menu (https://cdn.pling.com/img/a/1/f/b/7b56612ab04f58f72a644493b55a0487ffc4.png). Probably it is not available in VLC for macOS (not implemented yet or a bug). You could file a ticket at https://trac.videolan.org/vlc/
If you are sure that the playing-listener never triggers playing_changed() on pause/play event, then you should report it, too. It works on Windows/Linux.

Code: Select all

... capabilities = {"playing-listener"} ... function playing_changed() ... end

Hamid_PaK
New Cone
New Cone
Posts: 3
Joined: 19 Jan 2020 19:24

Re: Running extension in the background

Postby Hamid_PaK » 26 Jan 2020 10:21

mederi, thanks for reply.

Yeah someone else has already reported it here (https://trac.videolan.org/vlc/ticket/22778.)

Menu also never worked for me on macOS, might not be implemented at all :|


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 13 guests