返回首页
Player

VLC Extension Example

开发

编写脚本 hello.lua

function descriptor()
    return {
        title = "Hello World";
        version = "1.0";
        author = "WangJunjian";
        url = 'www.wangjunjian.com';
        shortdesc = "Hello World";
        description = "Hello World!";
        capabilities = {"menu"}
    }
end

-- activate() : called when the extension is activated from within VLC
function activate()
    create_dialog()
end

-- deactivate() : called when the extension is deactivated from within VLC
function deactivate()
    close()
    vlc.deactivate()
end

-- create_dialog() : creates the dialog containing the initial widgets
function create_dialog()
    dlg = vlc.dialog(descriptor().title)
    dlg:add_label("<b>Hello World: VLC Lua scripts and extensions</b>")
end

安装

拷贝脚本 hello.lua 到 extensions 目录

  • Windows
/Program Files/VideoLAN/VLC/lua/extensions
  • Mac OS X
/Applications/VLC.app/Contents/MacOS/share/lua/extensions/
  • Linux
/home/$USER/.local/share/vlc/lua/extensions/
/usr/share/vlc/lua/extensions/
/usr/lib/vlc/lua/playlist/

使用

打开VLC Media Player,选择菜单:View->Hello World。

参考资料