aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2017-10-25 19:01:17 -0400
committerZackaryWelch <welch.zackary@gmail.com>2017-10-25 19:02:25 -0400
commit5b5e79737f38b7eee6ced0cd08d7cdd437c0e708 (patch)
tree3136985e42048c6d51a9b602b5089ff3c43d7fca /src-qt5/core/lumina-desktop-unified
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-5b5e79737f38b7eee6ced0cd08d7cdd437c0e708.tar.gz
lumina-5b5e79737f38b7eee6ced0cd08d7cdd437c0e708.tar.bz2
lumina-5b5e79737f38b7eee6ced0cd08d7cdd437c0e708.zip
Added the QML Video screensaver
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified')
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json25
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml50
2 files changed, 75 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json
new file mode 100644
index 00000000..2fa6e6da
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json
@@ -0,0 +1,25 @@
+{
+ "name" : {
+ "default" : "Video"
+ },
+ "description" : {
+ "default" : "Play a single video or a list of videos in a loop"
+ },
+ "author" : {
+ "name" : "Zackary Welch",
+ "email" : "zwelch@ixsystems.com",
+ "website" : "https://github.com/ZackaryWelch",
+ "company" : "iXsystems",
+ "company_website" : "http://ixsystems.com"
+ },
+ "meta" : {
+ "license" : "3-clause BSD",
+ "license_url" : "https://github.com/trueos/lumina/blob/master/LICENSE",
+ "copyright" : "Copyright (c) 2017, Ken Moore (ken@ixsystems.com)",
+ "date_created" : "20171025",
+ "version" : "1.0"
+ },
+ "qml" : {
+ "exec" : "qml_scripts/Video.qml"
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml
new file mode 100644
index 00000000..e7d0626d
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml
@@ -0,0 +1,50 @@
+import QtQuick 2.0
+import QtMultimedia 5.7
+import QtQuick.Window 2.2
+import Qt.labs.folderlistmodel 2.1
+
+Rectangle {
+ //width: Screen.width
+ //height: Screen.height
+ width: 800
+ height: 600
+ color: "black"
+
+ FolderListModel {
+ id: folderModel
+ folder: "/usr/local/videos"
+ }
+
+ Repeater {
+ model: folderModel
+ Component {
+ Item {
+ Component.onCompleted: { playlist.addItem(fileURL) }
+ }
+ }
+ }
+
+ Playlist {
+ id: playlist
+ playbackMode: Playlist.Random
+ PlaylistItem { source: "/" }
+ onError: { console.log("ERROR") }
+ }
+
+ MediaPlayer {
+ id: player
+ autoPlay: true
+ playlist: playlist
+ }
+
+ VideoOutput {
+ id: videoOutput
+ source: player
+ anchors.fill: parent
+ }
+
+ Component.onCompleted: {
+ playlist.shuffle()
+ console.log(playlist.itemCount)
+ }
+}
bgstack15