Skip to content

Commit

Permalink
Add Support for Headset MediaKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
chstem committed Jun 3, 2017
1 parent 09f8843 commit f394902
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions qml/Main.qml
Expand Up @@ -70,6 +70,7 @@ PodcastsPage {
}

MprisPlayer {}
MediaKeys {}

GPodderPodcastListModel { id: podcastListModel }
GPodderPodcastListModelConnections {}
Expand Down
35 changes: 35 additions & 0 deletions qml/MediaKeys.qml
@@ -0,0 +1,35 @@

import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Media 1.0


Item {

MediaKey {
enabled: true
key: Qt.Key_MediaTogglePlayPause
onReleased: player.togglePause()
}
MediaKey {
enabled: true
key: Qt.Key_MediaPlay
onReleased: player.play()
}
MediaKey {
enabled: true
key: Qt.Key_MediaPause
onReleased: player.pause()
}
MediaKey {
enabled: true
key: Qt.Key_ToggleCallHangup
onReleased: player.togglePause()
}
MediaKey {
enabled: true
key: Qt.Key_MediaStop
onReleased: player.stop()
}

}

0 comments on commit f394902

Please sign in to comment.