vlc-rs/README.md

43 lines
921 B
Markdown
Raw Normal View History

2015-11-29 01:26:04 +00:00
# vlc-rs
Rust bindings for libVLC media framework.
2015-11-29 02:29:44 +00:00
## Status
Many missing functions and wrappers.
## Use
Please add the following dependencies to your Cargo.toml.
```Toml
[dependencies.vlc-rs]
2016-07-03 04:20:50 +00:00
git = "https://github.com/garkimasera/vlc-rs.git"
2015-11-29 02:29:44 +00:00
```
## Example
2016-01-28 11:15:26 +00:00
Play for 10 seconds from a media file.
2015-11-29 02:29:44 +00:00
```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
2016-01-28 11:15:26 +00:00
thread::sleep(::std::time::Duration::from_secs(10));
2015-11-29 02:29:44 +00:00
}
```
2015-11-29 08:30:19 +00:00
Other examples are in the examples directory.
2015-11-29 02:29:44 +00:00
## License
2015-11-29 08:30:19 +00:00
MIT (Examples are licensed under CC0)