videos played are now random
This commit is contained in:
26
Main.qml
26
Main.qml
@@ -56,9 +56,14 @@ Rectangle {
|
||||
MediaPlayer {
|
||||
id: mediaplayer
|
||||
autoPlay: true
|
||||
loops: MediaPlayer.Infinite
|
||||
source: config.background
|
||||
muted: true
|
||||
playlist: Playlist {
|
||||
id: playlist
|
||||
playbackMode: Playlist.Random
|
||||
onLoaded: {
|
||||
mediaplayer.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VideoOutput {
|
||||
@@ -67,6 +72,14 @@ Rectangle {
|
||||
source: mediaplayer
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
onPressed: {
|
||||
playlist.shuffle();
|
||||
playlist.next();
|
||||
}
|
||||
}
|
||||
|
||||
// Clock and Login Area
|
||||
Rectangle {
|
||||
id: rectangle
|
||||
@@ -331,13 +344,18 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set Focus
|
||||
Component.onCompleted: {
|
||||
// Set Focus
|
||||
if (username_input_box.text == "")
|
||||
username_input_box.focus = true
|
||||
else
|
||||
password_input_box.focus = true
|
||||
|
||||
// load and randomize playlist
|
||||
playlist.load(Qt.resolvedUrl(config.background), 'm3u')
|
||||
for (var k = 0; k < Math.ceil(Math.random() * 10) ; k++) {
|
||||
playlist.shuffle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user