Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.6
- import QtMultimedia 5.6
- import org.kde.plasma.core 2.0 as Plasmacore
- Item {
- property var i: 0
- property var j: 0
- MediaPlayer {
- id: playlistplayer
- autoPlay: true
- muted: wallpaper.configuration.Muted
- onStatusChanged: {
- if ( wallpaper.configuration.Shuffle ) { shuffleList() }
- }
- playlist: Playlist {
- id: playlist
- playbackMode: Playlist.Loop
- property var videoList: load( wallpaper.configuration.Playlist )
- }
- }
- VideoOutput {
- fillMode: VideoOutput.PreserveAspectCrop
- anchors.fill: parent
- source: playlistplayer
- }
- function shuffleList() {
- if ( !(i % 2 == 0)) {
- j++
- }
- i++
- if ( j > playlist.itemCount ) {
- j = 0
- i = 0
- }
- if ( j == 1 ) {
- // more random shuffling
- for (var k = 0; k < Math.ceil(Math.random() * 10) ; k++) {
- playlist.shuffle()
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment