Merge lp:~ahayzen/music-app/remix-seeking-workaround into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 657
Merged at revision: 660
Proposed branch: lp:~ahayzen/music-app/remix-seeking-workaround
Merge into: lp:music-app/remix
Diff against target: 48 lines (+15/-3)
1 file modified
MusicNowPlaying.qml (+15/-3)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-seeking-workaround
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+237669@code.launchpad.net

Commit message

* Ignore first value back after seeking [Workaround]

Description of the change

* Ignore first value back after seeking [Workaround]

Until it is fixed in media-hub ignore the first value back so the progress bar doesn't jump to 0 and then to the real position. Note this is a *workaround*.

To post a comment you must log in.
Revision history for this message
Victor Thompson (vthompson) wrote :

I'll test this out in around 5 hours or so. I think we should also document in commentary that this is a workaround for lp:1310706. Probably on "onPositionChanged".

review: Needs Fixing
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

This does work quite nicely on my mako device. There does seem to be one small issue though. When the music is paused and the user taps or drags the progress handle it always shows the previous position, rather than the current one.

review: Needs Fixing
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

I believe this maybe be happening in lp:music-app/remix as well, possible when we moved to using Slider - I'll investigate and if I find a fix it in this mp.

657. By Andrew Hayzen

* Fix for label not updating while seeking
* Add code comments

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicNowPlaying.qml'
2--- MusicNowPlaying.qml 2014-10-08 18:33:38 +0000
3+++ MusicNowPlaying.qml 2014-10-09 16:32:12 +0000
4@@ -201,9 +201,17 @@
5 anchors.left: parent.left
6 anchors.right: parent.right
7 objectName: "progressSliderShape"
8- function formatValue(v) { return durationToString(v) }
9+
10+ function formatValue(v) {
11+ if (seeking) { // update position label while dragging
12+ musicToolbarFullPositionLabel.text = durationToString(v)
13+ }
14+
15+ return durationToString(v)
16+ }
17
18 property bool seeking: false
19+ property bool seeked: false
20
21 onSeekingChanged: {
22 if (seeking === false) {
23@@ -218,7 +226,8 @@
24 onPressedChanged: {
25 seeking = pressed
26 if (!pressed) {
27- player.seek(value)
28+ seeked = true
29+ player.seek(value)
30 }
31 }
32
33@@ -229,11 +238,14 @@
34 progressSliderMusic.maximumValue = player.duration
35 }
36 onPositionChanged: {
37- if (progressSliderMusic.seeking === false) {
38+ // seeked is a workaround for bug 1310706 as the first position after a seek is sometimes invalid (0)
39+ if (progressSliderMusic.seeking === false && !progressSliderMusic.seeked) {
40 progressSliderMusic.value = player.position
41 musicToolbarFullPositionLabel.text = durationToString(player.position)
42 musicToolbarFullDurationLabel.text = durationToString(player.duration)
43 }
44+
45+ progressSliderMusic.seeked = false;
46 }
47 onStopped: {
48 musicToolbarFullPositionLabel.text = durationToString(0);

Subscribers

People subscribed via source and target branches