Crates.io | vlc-rc |
lib.rs | vlc-rc |
version | 0.1.1 |
source | src |
created_at | 2022-05-23 14:07:11.172116 |
updated_at | 2022-05-24 09:12:51.082241 |
description | A library used to interact with a VLC player's TCP interface. |
homepage | https://github.com/Rickz75/vlc-rc |
repository | https://github.com/Rickz75/vlc-rc |
max_upload_size | |
id | 591820 |
size | 31,091 |
A rust library used to interact with a VLC player's TCP interface.
This is a (WIP) rust library you can use to interact with VLC programmatically by using its built-in TCP interface.
VLC's TCP interface is not well documented, and is very unpredictable at times, making it exceedingly hard to test in a deterministic matter. Regardless, the library aims to be as stable and testable as possible!
There are two ways to enable VLC's TCP interface.
You can launch VLC with CLI args like so:
vlc --rc-host 127.0.0.1:9090 # Or any <host>:<port> you prefer!
You can enable it via the GUI and it will run each time you start VLC.
Tools
-> Preferences
(Ctrl+P)All
at the bottom left of the preferences window (just under Show Settings
).Interface
item and then select Main interfaces
.Lua interpreter
option.Main interfaces
and then select the Lua
item.Lua interface
field's value to rc
.Lua interface configuration
field's value to rc={host='127.0.0.1:9090'}
(or any host/port you prefer).Add the library as a dependency to Cargo.toml:
[dependencies]
vlc-rc = "0.1.1
use vlc_rc::Client;
let mut client = Client::connect("127.0.0.1:9090")?;
// Set the player's volume.
client.set_volume(25)?;
assert_eq!(client.get_volume()?, 25);
// Stop the track's playback.
client.stop()?;
assert_eq!(client.is_playing()?, false);
// Skip to the next track.
client.next()?;
See CONTRIBUTING.