lua-mpris icon indicating copy to clipboard operation
lua-mpris copied to clipboard

Add support for SetPosition, Position and other mpris properties

Open antlarr opened this issue 7 years ago • 0 comments

Added support for callbacks when getting values so there's no need to keep a variable updated and so we can provide the current media position throught mpris' Position property

Added support for SetPosition so mpris clients can seek freely.

Fix media length reporting (which was always nil) by getting the mpris:length value from the duration property.

Fill values for the following metadata: xesam:album xesam:albumArtist xesam:artist xesam:trackNumber xesam:genre xesam:lyricist xesam:discNumber mpris:trackid mpris:artUrl xesam:url

Note that mpris:trackid has a fixed value (it needs to be a dbus object reference). This value is later provided by the mpris client as the first parameter of SetPosition.

Also, in order to find out the full path of the url, we need to find out the current working directory, which requires to add lfs as a dependency. Maybe there's another way to find out the CWD but I don't know so much lua. Also, to show the artUrl, a 'cover.jpg' file has to be available in the same directory as the media. The ideal solution would be to extract the cover from the music file, but again, that's beyond my lua knowledge.

This makes KDE Plasma mediacontroller completely usable to control mpv.

antlarr avatar Aug 10 '17 07:08 antlarr