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
1=== modified file 'src/qml/MMS/PreviewerVideo.qml'
2--- src/qml/MMS/PreviewerVideo.qml 2016-02-01 15:11:45 +0000
3+++ src/qml/MMS/PreviewerVideo.qml 2016-02-01 15:11:45 +0000
4@@ -27,6 +27,8 @@
5 Previewer {
6 id: videoPreviewer
7
8+ property size thumbnailSize: Qt.size(viewer.width * 1.05, viewer.height * 1.05)
9+
10 title: i18n.tr("Video Preview")
11 clip: true
12
13@@ -37,6 +39,22 @@
14 }
15 Component.onDestruction: application.fullscreen = false
16
17+ onWidthChanged: {
18+ // Only change thumbnailSize if width increases more than 5%
19+ // that way we do not reload image for small resizes
20+ if (width > thumbnailSize.width) {
21+ thumbnailSize = Qt.size(width * 1.05, height * 1.05);
22+ }
23+ }
24+
25+ onHeightChanged: {
26+ // Only change thumbnailSize if height increases more than 5%
27+ // that way we do not reload image for small resizes
28+ if (height > thumbnailSize.height) {
29+ thumbnailSize = Qt.size(width * 1.05, height * 1.05);
30+ }
31+ }
32+
33 Connections {
34 target: application
35 onFullscreenChanged: {
36@@ -94,6 +112,42 @@
37 anchors.fill: parent
38 source: player
39 }
40+
41+ Rectangle {
42+ id: thumbnail
43+
44+ anchors.fill: parent
45+ visible: player.status == MediaPlayer.EndOfMedia
46+
47+ color: "black"
48+
49+ ActivityIndicator {
50+ anchors.centerIn: parent
51+ visible: running
52+ running: image.status != Image.Ready
53+ }
54+
55+ Image {
56+ id: image
57+
58+ anchors.fill: parent
59+ visible: status == Image.Ready
60+ opacity: visible ? 1.0 : 0.0
61+ Behavior on opacity { UbuntuNumberAnimation {} }
62+
63+ fillMode: Image.PreserveAspectFit
64+ smooth: true
65+ source: "image://thumbnailer/" + player.source.toString().replace("file://", "")
66+
67+ asynchronous: true
68+ cache: true
69+
70+ sourceSize {
71+ width: videoPreviewer.thumbnailSize.width
72+ height: videoPreviewer.thumbnailSize.height
73+ }
74+ }
75+ }
76 }
77 }
78 }

Subscribers

People subscribed via source and target branches

to all changes: