[SailfishDevel] Using org.nemomobile.dbus with MPRIS2

Andrey Kozhevnikov coderusinbox at gmail.com
Sat Dec 20 16:11:37 UTC 2014


Hello!

I just tried to make MPRIS2 controls for MediaPlayer and QuasarMX with 
QML only, but failed. Both players have no PropertiesChanged in 
introspection of /org/mpris/MediaPlayer2, and it seems to be a reason of 
my fail.

import org.nemomobile.dbus 2.0 as NemoDBus

     NemoDBus.DBusInterface {
         id: quasarmxProperties
         bus: NemoDBus.DBus.SessionBus
         service: "org.mpris.MediaPlayer2.quasarmx"
         path: "/org/mpris/MediaPlayer2"
         iface: "org.freedesktop.DBus.Properties"
         signalsEnabled: true

         function propertiesChanged(name, changed, invalidated) {
             console.log("*** QMX PROPERTY CHANGED ***")
             console.log(JSON.stringify(changed))
         }
     }

     NemoDBus.DBusInterface {
         id: jollamediaProperties
         bus: NemoDBus.DBus.SessionBus
         service: "org.mpris.MediaPlayer2.jolla-mediaplayer"
         path: "/org/mpris/MediaPlayer2"
         iface: "org.freedesktop.DBus.Properties"
         signalsEnabled: true

         function propertiesChanged(name, changed, invalidated) {
             console.log("*** JOLLA PROPERTY CHANGED ***")
             console.log(JSON.stringify(changed))
         }
     }

Also tried both propertiesChanged and rcPropertiesChanged, not working. 
Any suggestions will be appreciated!

Best regards,
Andrey


More information about the Devel mailing list