2import QtQuick.Layouts 1.1
4import Ubuntu.Components 1.3
5import Ubuntu.Components.Themes 1.0
9 readonly property alias mediaPlayer: _mediaPlayer
10 property bool interacting: false
15 function formatProgress(time) {
16 time = Math.floor(time / 1000);
19 time = Math.floor(time / 60);
21 var hour = Math.floor(time / 60);
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);
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);
43 if (slider.valueGuard) return;
45 slider.valueGuard = true;
46 slider.value = mediaPlayer.position;
47 slider.valueGuard = false;
48 if (!slider.pressed) {
49 positionLabel.text = priv.formatProgress(mediaPlayer.position);
56 property: "interacting"
65 bottomMargin: -units.dp(3)
67 verticalAlignment: Text.AlignBottom
71 text: priv.formatProgress(mediaPlayer.position)
76 property bool valueGuard: false
84 enabled: mediaPlayer.seekable && mediaPlayer.duration > 0
86 maximumValue: mediaPlayer.duration > 0 ? mediaPlayer.duration : 1
87 value: mediaPlayer.position
88 theme: ThemeSettings {
90 normal.base: "#F3F3E7"
96 if (slider.valueGuard) return;
98 slider.valueGuard = true;
99 mediaPlayer.seek(value);
100 slider.valueGuard = false;
103 property bool wasPlaying: mediaPlayer.playbackState === MediaPlayer.PlayingState
106 wasPlaying = mediaPlayer.playbackState === MediaPlayer.PlayingState
110 positionLabel.text = priv.formatProgress(mediaPlayer.position);
117 function formatValue(value) {
118 return priv.formatProgress(value);
125 bottom: parent.bottom
126 bottomMargin: -units.dp(3)
128 verticalAlignment: Text.AlignBottom
132 text: priv.formatProgress(mediaPlayer.duration)
138 objectName: "mediaPlayer"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list