@@ -12,15 +12,26 @@ MediaServicesControls {
1212 QtObject {
1313 id: priv
1414
15− function formatTime(position) {
16− var pos = (position/1000).toFixed(0)
17−
18− var m = Math.floor(pos/60);
19− var ss = pos % 60;
20− if (ss >= 10) {
21− return m + ":" + ss;
15+ function formatProgress(time) {
16+ time = Math.floor(time / 1000);
17+
18+ var secs = time % 60;
19+ time = Math.floor(time / 60);
20+ var min = time % 60;
21+ var hour = Math.floor(time / 60);
22+
23+ if (secs < 10) secs = "0%1".arg(secs);
24+ if (min < 10) min = "0%1".arg(min);
25+ if (hour > 0) {
26+ // TRANSLATORS: this refers to a duration/remaining time of the video in hours, minutes and seconds,
27+ // of which you can change the order.
28+ // %1 refers to hours, %2 refers to minutes and %3 refers to seconds.
29+ return i18n.tr("%1:%2:%3").arg(hour).arg(min).arg(secs);
2230 } else {
23− return m + ":0" + ss;
31+ // TRANSLATORS: this refers to a duration/remaining time of the video in minutes and seconds,
32+ // of which you can change the order.
33+ // %1 refers to minutes and %2 refers to seconds.
34+ return i18n.tr("%1:%2").arg(min).arg(secs);
2435 }
2536 }
2637 }
@@ -35,7 +46,7 @@ MediaServicesControls {
3546 slider.value = mediaPlayer.position;
3647 slider.valueGuard = false;
3748 if (!slider.pressed) {
38− positionLabel.text = priv.formatTime(mediaPlayer.position);
49+ positionLabel.text = priv.formatProgress(mediaPlayer.position);
3950 }
4051 }
4152 }
@@ -57,7 +68,7 @@ MediaServicesControls {
5768 fontSize: "x-small"
5869 color: "#F3F3E7"
5970
60− text: priv.formatTime(mediaPlayer.position)
71+ text: priv.formatProgress(mediaPlayer.position)
6172 }
6273
6374 Slider {
@@ -96,7 +107,7 @@ MediaServicesControls {
96107 mediaPlayer.pause();
97108 } else {
98109
99− positionLabel.text = priv.formatTime(mediaPlayer.position);
110+ positionLabel.text = priv.formatProgress(mediaPlayer.position);
100111 if (wasPlaying) {
101112 mediaPlayer.play();
102113 }
@@ -104,7 +115,7 @@ MediaServicesControls {
104115 }
105116
106117 function formatValue(value) {
107− return priv.formatTime(value);
118+ return priv.formatProgress(value);
108119 }
109120 }
110121
@@ -118,7 +129,7 @@ MediaServicesControls {
118129 fontSize: "x-small"
119130 color: "#F3F3E7"
120131
121− text: priv.formatTime(mediaPlayer.duration)
132+ text: priv.formatProgress(mediaPlayer.duration)
122133 }
123134 }
124135