2 个版本
| 0.1.1 | 2022 年 8 月 8 日 |
|---|---|
| 0.1.0 | 2021 年 6 月 12 日 |
11 在 #mpris
18KB
284 行
pris
一个用于与 MPRIS 兼容的播放器进行交互的库,构建在 tokio 异步运行时上。
lib.rs:
此库提供了对 MPRIS DBus 规范的高层接口。
它允许控制播放器,同时监听事件并执行回调。
基本的播放器控制器
use pris::{self, Player};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a connection to work with
let conn = pris::get_connection();
// Get a player under the name "vlc"
let player = Player::try_new("vlc", &conn).await?;
// Play/pause the player
player.play_pause().await?;
}
此软件包重新导出 Message 以用于非闭包回调的类型。
依赖关系
~8–17MB
~235K SLoC