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