hi,
I'm trying to make my app Muuzik - an audio player from the store -
recognize bluetooth headset media button without luck.

The headset is paired and works with the default / jolla media app as
expected (prev, next, play/pause)

My app provide an mpris2 interface, registered on dbus, it work perfectly
from the phone panel (previous, play/stop, next, track info...), I also
added a listener on org.mpris.MediaPlayer2 and I'm getting callback from
other app but nothing when pressing the headset button. Guessing this is
not a mpris2 issue.

So I tried to work from qml with Permissions / Resource / MediaKey.
I can "hijack" the volumes buttons with Resource.ScaleButtons -
Qt.Key_VolumeUp/Down but nothing working with Resource.HeadsetButtons /
Qt.Key_Media*

Here some code : Don't work (but does with Resource.ScaleButtons -
Qt.Key_VolumeUp/Down):

MediaKey {
        id: mediaNext
        enabled: true
        key: Qt.Key_MediaNext
        onPressed : {
            console.log("expect Key_MediaNext")
        }
    }
Permissions {
        enabled: app.applicationActive
        autoRelease: true
        applicationClass: "player"

        Resource {
            id: headsetAccessResource
            type: Resource.HeadsetButtons
            optional: false
        }
}

What next solution would you recommend ?

Thank,
Jerome.
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to