「MPRIS」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(多言語版へのリンクを追加)
(Expansion を削除。リンクを修正)
6行目: 6行目:
   
 
== Supported clients ==
 
== Supported clients ==
 
{{Expansion|You can see your player of choise in the [[List_of_applications/Multimedia|list]] and check if it supports mpris with playerctl utility. In case it does, add it to the following list.}}
 
   
 
* [[Chromium]]
 
* [[Chromium]]
23行目: 21行目:
 
== Control utilities ==
 
== Control utilities ==
   
{{Tip|Create a [[key binding]] for common control commands and multimedia keys such as {{ic|XF86AudioPlay}}, {{ic|XF86AudioStop}}, {{ic|XF86AudioPrev}} and {{ic|XF86AudioNext}}.}}
+
{{Tip|Create a [[キーバインド]] for common control commands and multimedia keys such as {{ic|XF86AudioPlay}}, {{ic|XF86AudioStop}}, {{ic|XF86AudioPrev}} and {{ic|XF86AudioNext}}.}}
   
 
=== Playerctl ===
 
=== Playerctl ===
56行目: 54行目:
 
Media control from bluetooth headsets and similar devices may be forwarded to MPRIS.
 
Media control from bluetooth headsets and similar devices may be forwarded to MPRIS.
   
{{Note|Some headphones such as Sony WH-1000XM3 provide an AVRCP interface. For these types ''mpris-proxy'' is not required. Just make sure you have [[key binding]]s set up for media keys.}}
+
{{Note|Some headphones such as Sony WH-1000XM3 provide an AVRCP interface. For these types ''mpris-proxy'' is not required. Just make sure you have [[キーバインド]] set up for media keys.}}
   
[[Install]] the {{Pkg|bluez-utils}} package and run {{ic|mpris-proxy}}. In order to start up ''mpris-proxy'' in the background and/or when your system starts, you may create a [[systemd/User]] service:
+
[[インストール]] the {{Pkg|bluez-utils}} package and run {{ic|mpris-proxy}}. In order to start up ''mpris-proxy'' in the background and/or when your system starts, you may create a [[systemd/ユーザー]] service:
   
 
{{hc|~/.config/systemd/user/mpris-proxy.service|<nowiki>
 
{{hc|~/.config/systemd/user/mpris-proxy.service|<nowiki>
72行目: 70行目:
 
</nowiki>}}
 
</nowiki>}}
   
Then [[start]]/[[enable]] the service with the {{ic|--user}} flag.
+
Then [[起動]]/[[有効化]] the service with the {{ic|--user}} flag.

2021年12月18日 (土) 13:02時点における版

MPRIS (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 track list interface which is used to add context to the active media item.

Supported clients

Control utilities

ヒント: Create a キーバインド for common control commands and multimedia keys such as XF86AudioPlay, XF86AudioStop, XF86AudioPrev and XF86AudioNext.

Playerctl

The playerctl utility provides a command line tool to send commands to MPRIS clients. The most common commands are play-pause, next and previous:

$ playerctl play-pause
$ playerctl next
$ playerctl previous

playerctl will send the command to the first player it finds. To select a player manually, use the --player option, e.g. --player=vlc.

mpris-player-control

The mpris_player_control is a shell script which integrates dbus-send and pactl to control MPRIS clients. It supports the Play, Pause, PlayPause and Stop actions and sink volume control (mute/unmute/up/down) for Spotify.

Run mpris_player_control -h to show basic script usage.

D-Bus

An alternative to the above is to manually use D-Bus, which should be available by default as it is a dependency of systemd.

For example, the following commands can be used to control Spotify:

$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop

Bluetooth

Media control from bluetooth headsets and similar devices may be forwarded to MPRIS.

ノート: Some headphones such as Sony WH-1000XM3 provide an AVRCP interface. For these types mpris-proxy is not required. Just make sure you have キーバインド set up for media keys.

インストール the bluez-utils package and run mpris-proxy. In order to start up mpris-proxy in the background and/or when your system starts, you may create a systemd/ユーザー service:

~/.config/systemd/user/mpris-proxy.service
[Unit]
Description=Forward bluetooth media controls to MPRIS

[Service]
Type=simple
ExecStart=/usr/bin/mpris-proxy

[Install]
WantedBy=default.target

Then 起動/有効化 the service with the --user flag.