[mpris2 dataengine] Fix media key handling to match MediaPlayer2.Player
ClosedPublic

Authored by kossebau on Mar 3 2018, 1:54 PM.

Details

Summary
  • first check CanControl property, as it overrules things
  • next check each action Can* property, to spare D-Bus call and app activation if false
  • support CanPause and only call PlayPause is possible, otherwise use Play
Test Plan

Vlc can be controlled by keyboard media keys as before,
Gwenview patched to support MPRIS (with CanPause=false) can now be
controlled with the Play/Pause media key.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Mar 3 2018, 1:54 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 3 2018, 1:54 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Mar 3 2018, 1:54 PM
kossebau updated this revision to Diff 28796.Mar 6 2018, 9:05 AM

call play() and pause() depending on playbackStatus

This revision was not accepted when it landed; it landed in state Needs Review.Mar 6 2018, 12:04 PM
This revision was automatically updated to reflect the committed changes.