@@ -12,15 +12,26 @@ MediaServicesControls {
12 QtObject {
12 QtObject {
15− function formatTime(position) {
15+ function formatProgress(time) {
16− var pos = (position/1000).toFixed(0)
16+ time = Math.floor(time / 1000);
18+ var secs = time % 60;
18− var m = Math.floor(pos/60);
19+ time = Math.floor(time / 60);
19− var ss = pos % 60;
20+ var min = time % 60;
20− if (ss >= 10) {
21+ var hour = Math.floor(time / 60);
21− return m + ":" + ss;
22+
23+ if (secs < 10) secs = "0%1".arg(secs);
24+ if (min < 10) min = "0%1".arg(min);
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);
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);
@@ -35,7 +46,7 @@ MediaServicesControls {
35 slider.value = mediaPlayer.position;
46 slider.value = mediaPlayer.position;
36 slider.valueGuard = false;
47 slider.valueGuard = false;
37 if (!slider.pressed) {
48 if (!slider.pressed) {
38− positionLabel.text = priv.formatTime(mediaPlayer.position);
49+ positionLabel.text = priv.formatProgress(mediaPlayer.position);
@@ -57,7 +68,7 @@ MediaServicesControls {
57 fontSize: "x-small"
68 fontSize: "x-small"
58 color: "#F3F3E7"
69 color: "#F3F3E7"
60− text: priv.formatTime(mediaPlayer.position)
71+ text: priv.formatProgress(mediaPlayer.position)
@@ -96,7 +107,7 @@ MediaServicesControls {
96 mediaPlayer.pause();
107 mediaPlayer.pause();
99− positionLabel.text = priv.formatTime(mediaPlayer.position);
110+ positionLabel.text = priv.formatProgress(mediaPlayer.position);
100 if (wasPlaying) {
111 if (wasPlaying) {
101 mediaPlayer.play();
112 mediaPlayer.play();
@@ -104,7 +115,7 @@ MediaServicesControls {
106 function formatValue(value) {
117 function formatValue(value) {
107− return priv.formatTime(value);
118+ return priv.formatProgress(value);
@@ -118,7 +129,7 @@ MediaServicesControls {
118 fontSize: "x-small"
129 fontSize: "x-small"
119 color: "#F3F3E7"
130 color: "#F3F3E7"
121− text: priv.formatTime(mediaPlayer.duration)
132+ text: priv.formatProgress(mediaPlayer.duration)