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 ?
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
Return to “Scripting VLC in lua”
Users browsing this forum: No registered users and 6 guests