Skip to content

applets/mediacontroller: add option to set preferred player

Fushan Wen requested to merge work/fuf/preferred into master

This adds an option to set the preferred player, which will be used as the active player once available, regardless of changes in the playback status. This is useful for media shortcuts when a user wants to control a specific player.

Two new properties are added:

  • multiplexerEnabled: whether to enable the multiplexer. If set to false, the multiplexer will not be added to Mpris2Model. @devinlin
  • preferredPlayer: if it's not empty, the multiplexer will always try to find a player with the same identity (case insensitive), and use it as the active player.

Example to set Elisa as the preferred player:

Mpris.Mpris2Model {
    id: mpris2Model
    multiplexerEnabled: true
    preferredPlayer: "org.kde.elisa"
}

Autotest Plan

  • Set the preferred player, and match the active player
  • Disable the multiplexer, and match the first player
Global setting 2024-03-23_23-50-52
Widget config 图片
Edited by Fushan Wen

Merge request reports

Loading