Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
694e76ceb2 | ||
|
|
51df51c9a3 |
@@ -191,25 +191,69 @@ ColumnLayout {
|
|||||||
text: info.title ? info.title : i18n("No media playing")
|
text: info.title ? info.title : i18n("No media playing")
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.Slider {
|
RowLayout{
|
||||||
Layout.fillWidth: true
|
|
||||||
from: 0
|
Controls.Label{
|
||||||
to: audio.duration
|
visible: audio.duration > 0
|
||||||
value: audio.position
|
text: {
|
||||||
enabled: audio.seekable
|
var hours = new Date(audio.position).getUTCHours()
|
||||||
onMoved: {
|
if(hours>0)
|
||||||
console.log("Value:", value);
|
hours = (("0"+hours).slice(-2)) + ":"
|
||||||
audio.seek(Math.floor(value));
|
else
|
||||||
|
hours = ""
|
||||||
|
|
||||||
|
var minutes = new Date(audio.position).getUTCMinutes()
|
||||||
|
minutes = ("0"+minutes).slice(-2)
|
||||||
|
|
||||||
|
var seconds = new Date(audio.position).getUTCSeconds()
|
||||||
|
seconds = ("0"+seconds).slice(-2)
|
||||||
|
|
||||||
|
return hours+minutes+":"+seconds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on value {
|
Controls.Slider {
|
||||||
NumberAnimation {
|
Layout.fillWidth: true
|
||||||
|
from: 0
|
||||||
|
to: audio.duration
|
||||||
|
value: audio.position
|
||||||
|
enabled: audio.seekable
|
||||||
|
onMoved: {
|
||||||
|
console.log("Value:", value);
|
||||||
|
audio.seek(Math.floor(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on value {
|
||||||
|
NumberAnimation {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Controls.Label{
|
||||||
|
visible: audio.duration > 0
|
||||||
|
text: {
|
||||||
|
var hours = new Date(audio.duration).getUTCHours()
|
||||||
|
if(hours>0)
|
||||||
|
hours = (("0"+hours).slice(-2)) + ":"
|
||||||
|
else
|
||||||
|
hours = ""
|
||||||
|
|
||||||
|
var minutes = new Date(audio.duration).getUTCMinutes()
|
||||||
|
minutes = ("0"+minutes).slice(-2)
|
||||||
|
|
||||||
|
var seconds = new Date(audio.duration).getUTCSeconds()
|
||||||
|
seconds = ("0"+seconds).slice(-2)
|
||||||
|
|
||||||
|
return hours+minutes+":"+seconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.ToolButton {
|
Controls.ToolButton {
|
||||||
|
|||||||
Reference in new issue
Block a user