Crates.io | vlc-rs |
lib.rs | vlc-rs |
version | 0.3.0 |
source | src |
created_at | 2017-04-02 01:07:48.451953 |
updated_at | 2018-06-10 11:16:19.631477 |
description | Rust bindings for libVLC media framework. |
homepage | |
repository | https://github.com/garkimasera/vlc-rs |
max_upload_size | |
id | 9344 |
size | 93,269 |
Rust bindings for libVLC media framework.
Many missing functions and wrappers.
Please add the following dependencies to your Cargo.toml.
[dependencies]
vlc-rs = "0.3"
Or:
[dependencies.vlc-rs]
git = "https://github.com/garkimasera/vlc-rs.git"
Play for 10 seconds from a media file.
extern crate vlc;
use vlc::{Instance, Media, MediaPlayer};
use std::thread;
fn main() {
// Create an instance
let instance = Instance::new().unwrap();
// Create a media from a file
let md = Media::new_path(&instance, "path_to_a_media_file.ogg").unwrap();
// Create a media player
let mdp = MediaPlayer::new(&instance).unwrap();
mdp.set_media(&md);
// Start playing
mdp.play().unwrap();
// Wait for 10 seconds
thread::sleep(::std::time::Duration::from_secs(10));
}
Other examples are in the examples directory.
MIT (Examples are licensed under CC0)