MCPcopy Index your code
hub / github.com/Mange/mpris-rs

github.com/Mange/mpris-rs @v2.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1.0 ↗ · + Follow
441 symbols 971 edges 24 files 207 documented · 47%

Browse by type

Functions 402 Types & classes 39
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

mpris

A Rust library for dealing with MPRIS2-compatible players over D-Bus.

Crates.io Documentation Build Status Actively developed

What is MPRIS2?

The Media Player Remote Interfacing Specification is a standard D-Bus interface which aims to provide a common programmatic API for controlling media players.

It provides a mechanism for discovery, querying and basic playback control of compliant media players, as well as a tracklist interface which is used to add context to the active media item.

From About, in the MPRIS2 specification.

Basically, you can use it to control media players on your computer. This is most commonly used to build media player applets, UIs or to pause other players before your own software performs some action.

You can also use it in order to query metadata about what is currently playing, or if something is playing.

How to use

use mpris::PlayerFinder;

// Pauses currently playing media and prints metadata information about that
// media.
// If no player is running, exits with an error.
fn main() {
  let player = PlayerFinder::new()
    .expect("Could not connect to D-Bus")
    .find_active()
    .expect("Could not find any player");

  player.pause().expect("Could not pause");

  let metadata = player.get_metadata().expect("Could not get metadata for player");
  println!("{:#?}", metadata);
}

See the examples directory for more examples.

License

Copyright 2017-2026 Magnus Bergmark

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 320
Function 82
Class 21
Enum 12
Interface 6

Languages

Rust100%

Modules by API surface

src/player.rs102 symbols
src/metadata/value.rs55 symbols
src/track_list.rs36 symbols
src/generated/media_player_player.rs32 symbols
src/metadata.rs27 symbols
examples/control.rs26 symbols
src/progress.rs24 symbols
src/pooled_connection.rs23 symbols
src/find.rs17 symbols
src/event.rs14 symbols
src/generated/media_player_tracklist.rs13 symbols
src/generated/media_player.rs13 symbols

For agents

$ claude mcp add mpris-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page