Merge lp:~phablet-team/messaging-app/add_thumbnail_to_video_previewer into lp:messaging-app

Proposed by Arthur Mello
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 489
Merged at revision: 506
Proposed branch: lp:~phablet-team/messaging-app/add_thumbnail_to_video_previewer
Merge into: lp:messaging-app
Prerequisite: lp:~phablet-team/messaging-app/add-apparmor-profile
Diff against target: 78 lines (+54/-0)
1 file modified
src/qml/MMS/PreviewerVideo.qml (+54/-0)
To merge this branch: bzr merge lp:~phablet-team/messaging-app/add_thumbnail_to_video_previewer
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+284442@code.launchpad.net

Commit message

Add a thumbnail to MMS previewer after video has ended to reduce visual issues

Description of the change

Add a thumbnail to MMS previewer after video has ended to reduce visual issues

To post a comment you must log in.
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Just one comment inline.

review: Needs Fixing
488. By Arthur Mello

Rename property

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
489. By Arthur Mello

Change previewer fillMode to wk better with landscape mode

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good now!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/qml/MMS/PreviewerVideo.qml'
--- src/qml/MMS/PreviewerVideo.qml 2016-02-01 15:11:45 +0000
+++ src/qml/MMS/PreviewerVideo.qml 2016-02-01 15:11:45 +0000
@@ -27,6 +27,8 @@
27Previewer {27Previewer {
28 id: videoPreviewer28 id: videoPreviewer
2929
30 property size thumbnailSize: Qt.size(viewer.width * 1.05, viewer.height * 1.05)
31
30 title: i18n.tr("Video Preview")32 title: i18n.tr("Video Preview")
31 clip: true33 clip: true
3234
@@ -37,6 +39,22 @@
37 }39 }
38 Component.onDestruction: application.fullscreen = false40 Component.onDestruction: application.fullscreen = false
3941
42 onWidthChanged: {
43 // Only change thumbnailSize if width increases more than 5%
44 // that way we do not reload image for small resizes
45 if (width > thumbnailSize.width) {
46 thumbnailSize = Qt.size(width * 1.05, height * 1.05);
47 }
48 }
49
50 onHeightChanged: {
51 // Only change thumbnailSize if height increases more than 5%
52 // that way we do not reload image for small resizes
53 if (height > thumbnailSize.height) {
54 thumbnailSize = Qt.size(width * 1.05, height * 1.05);
55 }
56 }
57
40 Connections {58 Connections {
41 target: application59 target: application
42 onFullscreenChanged: {60 onFullscreenChanged: {
@@ -94,6 +112,42 @@
94 anchors.fill: parent112 anchors.fill: parent
95 source: player113 source: player
96 }114 }
115
116 Rectangle {
117 id: thumbnail
118
119 anchors.fill: parent
120 visible: player.status == MediaPlayer.EndOfMedia
121
122 color: "black"
123
124 ActivityIndicator {
125 anchors.centerIn: parent
126 visible: running
127 running: image.status != Image.Ready
128 }
129
130 Image {
131 id: image
132
133 anchors.fill: parent
134 visible: status == Image.Ready
135 opacity: visible ? 1.0 : 0.0
136 Behavior on opacity { UbuntuNumberAnimation {} }
137
138 fillMode: Image.PreserveAspectFit
139 smooth: true
140 source: "image://thumbnailer/" + player.source.toString().replace("file://", "")
141
142 asynchronous: true
143 cache: true
144
145 sourceSize {
146 width: videoPreviewer.thumbnailSize.width
147 height: videoPreviewer.thumbnailSize.height
148 }
149 }
150 }
97 }151 }
98 }152 }
99 }153 }

Subscribers

People subscribed via source and target branches

to all changes: