X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=share%2Flua%2FREADME.txt;h=5d3343b1300844a6682ecb1ef3a9dd09807b0150;hb=a5a33334e810a73fd5f136d58dc2cd3f95bc6493;hp=58f4d22cd47a06e278e92d35ad1a32724d987177;hpb=f5e71e2a371cc713d8bbd7bba4d892e207bda0e9;p=vlc diff --git a/share/lua/README.txt b/share/lua/README.txt index 58f4d22cd4..5d3343b130 100644 --- a/share/lua/README.txt +++ b/share/lua/README.txt @@ -103,7 +103,7 @@ h:redirect( url_dst, url_src ): Redirect all connections from url_src to url_dst Input ----- input.is_playing(): Return true if input exists. -input.add_subtitle(url): Add a subtitle to the current input +input.add_subtitle(url): Add a subtitle file (by path) to the current input input.item(): Get the current input item. Input item methods are: :uri(): Get item's URI. :name(): Get item's name. @@ -159,6 +159,10 @@ misc.quit(): Quit VLC. Net --- +---------------------------------------------------------------- +/!\ NB: this namespace is ONLY usable for interfaces and extensions. +--- +---------------------------------------------------------------- net.url_parse( url, [option delimiter] ): Parse URL. Returns a table with fields "protocol", "username", "password", "host", "port", path" and "option". @@ -181,10 +185,13 @@ net.send( fd, string, [length] ): Send data on fd. net.recv( fd, [max length] ): Receive data from fd. net.poll( { fd = events } ): Implement poll function. Returns the numbers of file descriptors with a non 0 revent. The function - modifies the input table to { fd = revents }. See "man poll". + modifies the input table to { fd = revents }. See "man poll". This function + is not available on Windows. net.POLLIN/POLLPRI/POLLOUT/POLLRDHUP/POLLERR/POLLHUP/POLLNVAL: poll event flags -net.read( fd, [max length] ): Read data from fd. -net.write( fd, string, [length] ): Write data to fd. +net.read( fd, [max length] ): Read data from fd. This function is not + available on Windows. +net.write( fd, string, [length] ): Write data to fd. This function is not + available on Windows. net.stat( path ): Stat a file. Returns a table with the following fields: .type .mode @@ -297,16 +304,25 @@ playlist.sort( key ): sort the playlist according to the key. 'artist', 'genre', 'random', 'duration', 'title numeric' or 'album'. playlist.status(): return the playlist status: 'stopped', 'playing', 'paused' or 'unknown'. +playlist.delete( id ): check if item of id is in playlist and delete it. returns -1 when invalid id. +playlist.move( id_item, id_where ): take id_item and if id_where has children, it put it as first children, + if id_where don't have children, id_item is put after id_where in same playlist. returns -1 when invalid ids. FIXME: add methods to get an item's meta, options, es ... -SD --- +Services discovery +------------------ + +Interfaces and extensions can use the following SD functions: + sd.get_services_names(): Get a table of all available service discovery modules. The module name is used as key, the long name is used as value. sd.add( name ): Add service discovery. sd.remove( name ): Remove service discovery. sd.is_loaded( name ): Check if service discovery is loaded. + +Services discovery scripts can use the following SD functions: + sd.add_node( ... ): Add a node to the service discovery. The node object has the following members: .title: the node's name @@ -384,8 +400,6 @@ var.create( object, name, value ): Create and set the object's variable "name" var.trigger_callback( object, name ): Trigger the callbacks associated with the object's "name" variable. -var.command( object name, name, argument ): Issue "object name"'s "name" - command with argument "argument". var.libvlc_command( name, argument ): Issue libvlc's "name" command with argument "argument".