videos played are now random
This commit is contained in:
26
Main.qml
26
Main.qml
@@ -56,9 +56,14 @@ Rectangle {
|
|||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: mediaplayer
|
id: mediaplayer
|
||||||
autoPlay: true
|
autoPlay: true
|
||||||
loops: MediaPlayer.Infinite
|
|
||||||
source: config.background
|
|
||||||
muted: true
|
muted: true
|
||||||
|
playlist: Playlist {
|
||||||
|
id: playlist
|
||||||
|
playbackMode: Playlist.Random
|
||||||
|
onLoaded: {
|
||||||
|
mediaplayer.play()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoOutput {
|
VideoOutput {
|
||||||
@@ -67,6 +72,14 @@ Rectangle {
|
|||||||
source: mediaplayer
|
source: mediaplayer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent;
|
||||||
|
onPressed: {
|
||||||
|
playlist.shuffle();
|
||||||
|
playlist.next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clock and Login Area
|
// Clock and Login Area
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rectangle
|
id: rectangle
|
||||||
@@ -331,13 +344,18 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set Focus
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
// Set Focus
|
||||||
if (username_input_box.text == "")
|
if (username_input_box.text == "")
|
||||||
username_input_box.focus = true
|
username_input_box.focus = true
|
||||||
else
|
else
|
||||||
password_input_box.focus = true
|
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