summaryrefslogtreecommitdiffstats
path: root/app/MediaPlayer.qml
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-04-25 22:19:16 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-04-26 14:59:48 -0700
commitba39b5e73165886e9739d23f97f7df842ae7d7e1 (patch)
tree1db0b44c986bf02f8f3fa9777d6a1cd450d462b6 /app/MediaPlayer.qml
parentc9f1c84b30076d2750c73364870a9b5884a183bd (diff)
bluetooth: fix avrcp previous play position offset
Initially a previous command goes back to the beginning of the track but most media applications don't reset the position property. So keep the current position and use that as an offset for the UI. Bug-AGL: SPEC-565 Change-Id: If7124537c6d66d328f9c4c918fe917b8fc877ce0 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/MediaPlayer.qml')
-rw-r--r--app/MediaPlayer.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/MediaPlayer.qml b/app/MediaPlayer.qml
index a937bc6..4a29d95 100644
--- a/app/MediaPlayer.qml
+++ b/app/MediaPlayer.qml
@@ -33,12 +33,14 @@ ApplicationWindow {
property string title
property int duration: 0
property int position: 0
+ property int pos_offset: 0
function disableBluetooth() {
bluetooth.artist = ''
bluetooth.title = ''
bluetooth.duration = 0
bluetooth.position = 0
+ bluetooth.pos_offset = 0
bluetooth.connected = false
}
}
@@ -77,6 +79,7 @@ ApplicationWindow {
if (avrcp_title)
bluetooth.title = avrcp_title
bluetooth.duration = avrcp_duration
+ bluetooth.pos_offset = 0
}
onUpdatePlayerStatus: {
@@ -109,7 +112,7 @@ ApplicationWindow {
running: (bluetooth.connected && bluetooth.state == "playing")
repeat: true
onTriggered: {
- bluetooth.position = dbus.getCurrentPosition()
+ bluetooth.position = dbus.getCurrentPosition() - bluetooth.pos_offset
slider.value = bluetooth.position
}
}
@@ -233,6 +236,7 @@ ApplicationWindow {
offImage: './images/AGL_MediaPlayer_BackArrow.svg'
onClicked: {
if (bluetooth.connected) {
+ bluetooth.pos_offset = dbus.getCurrentPosition()
dbus.processQMLEvent("Previous")
} else {
playlist.previous()