From b806f3b07cf687a727675eaa31bbc0b9e45ac329 Mon Sep 17 00:00:00 2001 From: "T. Okubo" Date: Sun, 29 Nov 2015 11:29:44 +0900 Subject: [PATCH] Edit README.md --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 5521980..f9a5e3b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,40 @@ # vlc-rs Rust bindings for libVLC media framework. + +## Status +Many missing functions and wrappers. + +## Use +Please add the following dependencies to your Cargo.toml. + +```Toml +[dependencies.vlc-rs] +git = "https://github.com/Orenantedose/vlc-rs.git" +``` + +## Example +Play for 10 seconds from an media file. +```Rust +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_ms(10000); +} +``` + +## License +MIT