@@ -30,46 +30,38 @@ DashPreview {
30 title: root.ready ? previewData.title : ""
30 title: root.ready ? previewData.title : ""
31 previewWidthRatio: 0.6
31 previewWidthRatio: 0.6
33− // TODO: Need UbuntuShape support for Video component for create the round shape.
33+ onPreviewImageClicked: {
34− header: Rectangle {
34+ if (playable) {
35+ shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', previewData.imageSourceUri);
39+ header: UbuntuShape {
35 anchors.left: parent.left
41 anchors.left: parent.left
36 anchors.right: parent.right
42 anchors.right: parent.right
37− height: width * 9 / 16
43+ radius: "medium"
38− color: "black"
44+ image: Image {
40− Video {
46+ asynchronous: true
41− id: video
47+ source: root.url
42− anchors.fill: parent
48+ fillMode: Image.PreserveAspectCrop
44− source: previewData.imageSourceUri
45− fillMode: VideoOutput.PreserveAspectCrop
48− objectName: "playButton"
52+ objectName: "playButton"
49− anchors.centerIn: parent
53+ anchors.centerIn: parent
50− visible: root.playable
54+ visible: root.playable
51− readonly property bool bigButton: parent.width > units.gu(40)
55+ readonly property bool bigButton: parent.width > units.gu(40)
52− width: bigButton ? units.gu(8) : units.gu(4.5)
56+ width: bigButton ? units.gu(8) : units.gu(4.5)
53− height: width
57+ height: width
54− source: "../graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
58+ source: "../graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
57− MouseArea {
61+ MouseArea {
58− id: previewImageMouseArea
62+ id: previewImageMouseArea
59− anchors.fill: parent
63+ anchors.fill: parent
61− root.previewImageClicked();
64+ onClicked: root.previewImageClicked()
63− if (video.playbackState == MediaPlayer.PlayingState) {
65− } else if (video.playbackState == MediaPlayer.PausedState) {