on xenial help sign in
Remove video playing.
9e81c8fYing-Chun Liu
Dash/Movie/MoviePreview.qml+28−36
@@ -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
32
32
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);
36+ }
37+ }
38+
39+ header: UbuntuShape {
40+ id: urlLoader
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 {
39−
45+ id: previewImage
40− Video {
46+ asynchronous: true
41− id: video
47+ source: root.url
42− anchors.fill: parent
48+ fillMode: Image.PreserveAspectCrop
49+ }
43
50
44− source: previewData.imageSourceUri
45− fillMode: VideoOutput.PreserveAspectCrop
46−
47− Image {
51+ Image {
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" : "")
55− }
59+ }
56
60
57− MouseArea {
61+ MouseArea {
58− id: previewImageMouseArea
62+ id: previewImageMouseArea
59− anchors.fill: parent
63+ anchors.fill: parent
60− onClicked: {
61− root.previewImageClicked();
64+ onClicked: root.previewImageClicked()
62− if (root.playable) {
63− if (video.playbackState == MediaPlayer.PlayingState) {
64− video.pause();
65− } else if (video.playbackState == MediaPlayer.PausedState) {
66− video.play();
67− } else {
68− video.play();
69− }
70− }
71− }
72− }
73 }
65 }
74 }
66 }
75
67