[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-mobile] applets/active-welcome/contents/code: Add a video item
From:       Sebastian_Kügler <sebas () kde ! org>
Date:       2011-09-30 23:55:57
Message-ID: 20110930235557.CE258A60BE () git ! kde ! org
[Download RAW message or body]

Git commit 6720f98c9a025ead3651be6e434e3296f0e4a9d8 by Sebastian Kügler.
Committed on 01/10/2011 at 01:53.
Pushed by sebas into branch 'master'.

Add a video item

I'm not committing a video, since I feel uneasy to pollute the Git repo
with binary data that is not the fiinal version anyway. The video should probably
be installed separately anyway. For now put a file called "video.ogv"
into plasma-mobile/applets/active-welcome/contents/data/, then install.
This will be picked up by the Plasmoid.

M  +33   -2    applets/active-welcome/contents/code/StartPage.qml

http://commits.kde.org/plasma-mobile/6720f98c9a025ead3651be6e434e3296f0e4a9d8

diff --git a/applets/active-welcome/contents/code/StartPage.qml \
b/applets/active-welcome/contents/code/StartPage.qml index f4f6f72..e673486 100644
--- a/applets/active-welcome/contents/code/StartPage.qml
+++ b/applets/active-welcome/contents/code/StartPage.qml
@@ -24,9 +24,11 @@ import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
 import org.kde.plasma.core 0.1 as PlasmaCore
 import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts
 
+import QtMultimediaKit 1.1
+
 Item {
     width: 400
-    height: 300
+    height: 400
 
     Column {
         anchors.fill: parent
@@ -52,6 +54,7 @@ Item {
             color: theme.textColor
             styleColor: theme.backgroundColor
         }
+
         /*
         QIconItem {
             width: 128
@@ -64,5 +67,33 @@ Item {
 
         }
         */
-    }
+
+        Item {
+            id: videoItem
+            anchors.horizontalCenter: parent.horizontalCenter
+            width: 400
+            height: 300
+
+            Video {
+                id: video
+                width : 400
+                height : 300
+                //source: "video.avi"
+                anchors.fill: parent
+                source: plasmoid.file("data", "video.ogv")
+
+                MouseArea {
+                    anchors.fill: parent
+                    onClicked: {
+                        video.play()
+                    }
+                }
+
+                focus: true
+                Keys.onSpacePressed: video.paused = !video.paused
+                Keys.onLeftPressed: video.position -= 5000
+                Keys.onRightPressed: video.position += 5000
+            }
+        }
+    } // Column
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic