[Dev] Media player controls

asked 2019-01-03 18:36:30 +0300

attah gravatar image

updated 2019-01-04 12:41:41 +0300

jiit gravatar image

Having implemented a steaming app for my Sailfish Devember got me wanting to add lock screen controls, as well as headset/hands-free controls. But being unable to find any apps to steal inspiration from, and having read this leaves me wondering: can I have any of it at all?

Are all of lockscreen, wired and BT controls accessed through mpris? Why isn't that allowed to use? Because there is no guarantee the implementor will behave well? In that case, and probably other cases, perhaps Jolla should consider making an extended QML MediaPlayer that behaves nicely by default, and at least allow that..? And if the implementation needs to change with e.g. new bluetooth stack and whatnot they can do so.

Could we as a community contribute here somehow?

edit retag flag offensive close delete

Comments

Muuzik! Has locksreen controls, but unfortunately I have no idea how they are implemented.

LemD ( 2019-01-03 19:10:41 +0300 )edit

hutspot has lockscreen control (but not working with bluetooth controls)

rgrnetalk ( 2019-01-03 19:21:38 +0300 )edit

In CuteSpot it worked quite well with controls both on lockscreen and earphones. Stock media player also have mpris contols at least for lockscreen.

ljo ( 2019-01-03 21:10:32 +0300 )edit

I was able to add mpris support with inspiration from hutspot. Thanks! I'm a bit uneasy about advertising the mpris player before it actually has any media selected... but if i mess with the registration everything breaks horribly :( Changing canControl makes it lose track of the playing state. Re-registering the service loses the metadata. Refreshing the metadata does not seem to help at all (i guess registration wasn't completed). So that's how it will have to be.

Wired headset controls does not seem to be going over mpris, the built-in media player picks them up separately. Hrmpf. All the more reason to bake this into a single reusable component.

attah ( 2019-01-03 21:43:40 +0300 )edit

This is in line of the discussion in this question... Be aware that mpris controls are not allowed in harbour...

rgrnetalk ( 2019-01-03 22:02:54 +0300 )edit