Utilities for Service Discovery scripts.
Availability
| Script Types |
|---|
| Services Discovery |
Service Discovery Items
Items are the media elements provided by the service.
add_item()
Adds an item to the root of the service panel.
Usage
local song_path = vlc.strings.make_uri("/path/to/local/mp3/file.mp3")
local song_item = vlc.sd.add_item({path=song_path, title="Cool song", genre="The best genre"})
Parameters
infoTable with the following keys:pathString containing URI/URL pointing to the item’s media- Optional keys
- Any Metadata field
durationNumber indicating the item’s duration in secondsuiddataString to build the input uid
Return value
An item object
Item Setters
Each variable relating to an item’s metadata settable via a function call. Each function’s name conforms to the template item:set_name(value), where “value” is a string containing the value to assign and “name” is the name of the metadata to set.
Example
local itm = vlc.sd.add_item({path=some_path, title="My Item"})
itm:set_language("French")
Item Metadata
Items can have values assigned to the following metadata fields:
titleartistgenrecopyrightalbumtracknumdescriptionratingdatesettingurllanguagenowplayingpublisherencodedbyarturltrackidtracktotaldirectorseasonepisodeshownameactors
Service Discovery Nodes
Nodes can be thought of as folder/directories/playlists. Each child of a node can be either an item or another node.
Each node has the following fields:
.titleThe node’s name.arturlURL to the node’s playlist art
add_node()
Add a node to the root of the service panel.
Parameters
infoTable defining values for the node’s fields:title- Optional keys
arturl
Return value
node:add_subitem()
Add a child item to a node.
Parameters
infoTable with the following keys:pathString containing URI/URL pointing to the item’s media- Optional keys
- Any Metadata field
durationNumber indicating the item’s duration in secondsuiddataString to build the input uid
Return value
An item object
node:add_subnode()
Add a child node to a node.
Parameters
infoTable defining values for the node’s fields:title- Optional keys
arturl