@@ -15,6 +15,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18+import QtMultimedia 5.0
18import Ubuntu.Components 0.1
19import Ubuntu.Components 0.1
19import ".."
20import ".."
20import "../../Components"
21import "../../Components"
@@ -23,7 +24,7 @@ DashPreview {
25 property bool ready: previewData ? true : false
26 property bool ready: previewData ? true : false
26− property bool playable: false
27+ property bool playable: previewData.imageSourceUri != null
27 property url url: ready ? previewData.image : ""
28 property url url: ready ? previewData.image : ""
29 title: root.ready ? previewData.title : ""
30 title: root.ready ? previewData.title : ""
@@ -31,38 +32,52 @@ DashPreview {
32 onPreviewImageClicked: {
33 onPreviewImageClicked: {
33 if (playable) {
34 if (playable) {
34− shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', root.fileUri);
35+ //shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', previewData.imageSourceUri);
38 // TODO: replace this UbuntuShape with the Video component once that lands
39 // TODO: replace this UbuntuShape with the Video component once that lands
39 // with the player.
40 // with the player.
40− header: UbuntuShape {
41+ header: Rectangle {
42 anchors.left: parent.left
42 anchors.left: parent.left
43 anchors.right: parent.right
43 anchors.right: parent.right
49− fillMode: Image.PreserveAspectCrop
53− objectName: "playButton"
54− anchors.centerIn: parent
55− visible: root.playable
56− readonly property bool bigButton: parent.width > units.gu(40)
57− width: bigButton ? units.gu(8) : units.gu(4.5)
58− height: width
44+ height: units.gu(16)
59− source: "../graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
45+ color: "black"
62− MouseArea {
47+ Video {
63− id: previewImageMouseArea
48+ id: video
64 anchors.fill: parent
49 anchors.fill: parent
51+ source: previewData.imageSourceUri
52+ fillMode: VideoOutput.PreserveAspectCrop
55+ objectName: "playButton"
56+ anchors.centerIn: parent
57+ visible: root.playable
58+ readonly property bool bigButton: parent.width > units.gu(40)
59+ width: bigButton ? units.gu(8) : units.gu(4.5)
61+ source: "../graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
65+ id: previewImageMouseArea
65− onClicked: root.previewImageClicked()
68+ root.previewImageClicked();
70+ if (video.playbackState == MediaPlayer.PlayingState) {
72+ } else if (video.playbackState
73+ == MediaPlayer.PausedState) {
@@ -126,7 +141,7 @@ DashPreview {
126 color: "white"
141 color: "white"
127 horizontalAlignment: Text.AlignRight
142 horizontalAlignment: Text.AlignRight
128 width: parent.firstColWidth
143 width: parent.firstColWidth
129− text: i18n.tr("Directed by:")
144+ text: i18n.tr("Subtitle:")
130 style: Text.Raised
145 style: Text.Raised
131 styleColor: "black"
146 styleColor: "black"