3 个版本 (重大变更)
使用旧的 Rust 2015
0.3.0 | 2018 年 6 月 10 日 |
---|---|
0.2.0 | 2018 年 3 月 10 日 |
0.1.0 | 2017 年 4 月 2 日 |
#94 在 多媒体 中
每月 119 次下载
91KB
2K SLoC
vlc-rs
Rust 对 libVLC 媒体框架的绑定。
状态
许多函数和包装器缺失。
使用
请将以下依赖项添加到您的 Cargo.toml 文件中。
[dependencies]
vlc-rs = "0.3"
或者
[dependencies.vlc-rs]
git = "https://github.com/garkimasera/vlc-rs.git"
示例
从媒体文件中播放 10 秒。
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));
}
其他示例在 examples 目录中。
许可证
MIT (示例使用 CC0 许可)