Merge lp:~renatofilho/gallery-app/use-mediaplayer-components into lp:gallery-app

Proposed by Renato Araujo Oliveira Filho
Status: Needs review
Proposed branch: lp:~renatofilho/gallery-app/use-mediaplayer-components
Merge into: lp:gallery-app
Diff against target: 73 lines (+18/-13)
1 file modified
rc/qml/MediaViewer/SingleMediaViewer.qml (+18/-13)
To merge this branch: bzr merge lp:~renatofilho/gallery-app/use-mediaplayer-components
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+242001@code.launchpad.net

Commit message

Make use of MediaPlayer components.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

1112. By Renato Araujo Oliveira Filho

Make use of MediaPlayer components.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'rc/qml/MediaViewer/SingleMediaViewer.qml'
--- rc/qml/MediaViewer/SingleMediaViewer.qml 2014-10-09 16:08:50 +0000
+++ rc/qml/MediaViewer/SingleMediaViewer.qml 2014-11-17 17:28:10 +0000
@@ -15,12 +15,12 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtMultimedia 5.0
19import Ubuntu.Components 1.018import Ubuntu.Components 1.0
20import Ubuntu.Components.ListItems 1.0 as ListItems19import Ubuntu.Components.ListItems 1.0 as ListItems
21import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
22import Ubuntu.Content 0.121import Ubuntu.Content 0.1
23import Ubuntu.Thumbnailer 0.122import Ubuntu.Thumbnailer 0.1
23import Ubuntu.Components.Extras.MediaPlayer 0.1 as MediaPlayer
24import Gallery 1.024import Gallery 1.0
25import "../Components"25import "../Components"
2626
@@ -184,11 +184,10 @@
184 visible: viewer.isVideo && video.status == Loader.Ready &&184 visible: viewer.isVideo && video.status == Loader.Ready &&
185 video.item.playbackState !== MediaPlayer.StoppedState185 video.item.playbackState !== MediaPlayer.StoppedState
186 onLoaded: {186 onLoaded: {
187 item.source = mediaSource.path;187 item.playUri(mediaSource.path)
188 item.play()
189 }188 }
190189
191 property bool isPlaying: item && item.playbackState === MediaPlayer.PlayingState190 property bool isPlaying: item && item.playing
192 function play() {191 function play() {
193 if (item) {192 if (item) {
194 item.play();193 item.play();
@@ -215,6 +214,7 @@
215214
216 MouseArea {215 MouseArea {
217 anchors.fill: parent216 anchors.fill: parent
217 enabled: !video.visible
218 onDoubleClicked: {218 onDoubleClicked: {
219 clickTimer.stop();219 clickTimer.stop();
220 if (viewer.isVideo) return;220 if (viewer.isVideo) return;
@@ -233,19 +233,24 @@
233 onTriggered: viewer.clicked()233 onTriggered: viewer.clicked()
234 }234 }
235 }235 }
236
237 MouseArea {
238 anchors.centerIn: parent
239 width: units.gu(10)
240 height: units.gu(10)
241 enabled: viewer.isVideo
242 onClicked: viewer.togglePlayPause()
243 }
244 }236 }
245237
246 Component {238 Component {
247 id: component_video239 id: component_video
248 Video { }240 MediaPlayer.VideoPlayer {
241 settingsEnabled: false
242 onStatusChanged: {
243 if (status === MediaPlayer.EndOfMedia) {
244 stop()
245 controlsActive = true
246 }
247 }
248 onFullscreenModeChanged: {
249 if (!fullscreenMode) {
250 //FIXME: go back to list page
251 }
252 }
253 }
249 }254 }
250 }255 }
251}256}

Subscribers

People subscribed via source and target branches