Skip to content

virashu/media-session.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MediaSession.rs

Educational project

Rust library to control / get metadata of music playback

Utilizes: WinRT.Windows.Media.Control API on Windows | DBus/MPRIS API on Linux

Note

See a deeper usage example at virashu/media-control.rs.

Example

let player = media_session::MediaSession::new().await;

let info: media_session::MediaInfo = player.get_info();

println!("{:#?}", info);
// Output
MediaInfo {
    title: "St. Chroma (feat. Daniel Caesar)",
    artist: "Tyler, The Creator",
    album_title: "CHROMAKOPIA",
    album_artist: "Tyler, The Creator",
    duration: 197019000, // microseconds
    position: 5700398,   // microseconds
    state: "playing",
    cover_b64: <...>, // encoded (without data type)
    cover_raw: <...>, // file data (bytes)
}

TODO

  • Callback on update
  • Parse type of image
  • Make update on signal in unix imp

About

Crossplatform media playback API

Resources

Stars

Watchers

Forks

Languages