Plugin works on Windows but not MacOS X

Discuss your Lua playlist, album art and interface scripts.
Jonno_FTW
New Cone
New Cone
Posts: 3
Joined: 19 Mar 2017 03:34

Plugin works on Windows but not MacOS X

Postby Jonno_FTW » 23 Mar 2017 04:12

Hi,

I made a plugin to shuffle and loop a playlist once its played all items. It works fine on Windows, but on Mac OS X, the plugin loads and activate is called correctly, but none of the listeners are called and none of the dbg messages appear in the message log:

My code is here:

Code: Select all

function descriptor() return { title = "Shuffle Playlist", version = "1.1.3", shortdesc = "Shuffle Playlist", description = "Shuffles playlists once they are finished", author = "Jonathan Mackenzie", capabilities = {"input-listener", "playing-listener", "meta-listener"} } end function activate() vlc.playlist.loop('on') vlc.playlist.play() played = {vlc.playlist.current()} return true end function deactivate() vlc.playlist.loop('off') vlc.playlist.stop() vlc.deactivate() return true end function close() vlc.deactivate() end function meta_changed() -- related to capabilities={"meta-listener"} in descriptor() -- triggered by available media input meta data? local current = vlc.playlist.current() local input = vlc.object.input() local elapsed = vlc.var.get(input, "time") local total = vlc.var.get(input, "length") local diff = total - elapsed if diff <= 0 then local found = false for id,v in pairs(played) do if v == current then found = true end end if found then --if played[current] == true then played = {} vlc.playlist.sort("random") vlc.msg.dbg("[Shuffle] shuffling") else table.insert(played, current) local out = "" for id,v in pairs(played) do out = out ..v.. " " end vlc.msg.dbg("[Shuffle] Played: "..out) end end -- vlc.msg.dbg("[Shuffle] ".. elapsed.. "/".. total .. " diff= ".. tostring(total - elapsed)) end function input_changed() -- related to capabilities={"input-listener"} in descriptor() -- triggered by Start/Stop media input event end function playing_changed() -- vlc.msg.dbg("[Shuffle] playing changed to "..vlc.playlist.current()) end

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: Plugin works on Windows but not MacOS X

Postby mederi » 25 Mar 2017 16:13

It is possible. The Mac is always different. At least Windows and Linux use the same Qt GUI.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Plugin works on Windows but not MacOS X

Postby Jean-Baptiste Kempf » 26 Mar 2017 18:53

DId you try 3.0?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 8 guests