From 539e681331d2b7d671eeb5fe66319e0e8c3ddc6f Mon Sep 17 00:00:00 2001 From: Dusko Angirevic Date: Thu, 26 Oct 2017 16:38:07 +0200 Subject: [PATCH] Video player - fixed wrong media URL - download media button repositioned --- qml/lib/Worker.js | 2 +- qml/pages/components/ImageFullScreen.qml | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/qml/lib/Worker.js b/qml/lib/Worker.js index 6597e63..4c52d02 100644 --- a/qml/lib/Worker.js +++ b/qml/lib/Worker.js @@ -262,7 +262,7 @@ function parseToot (data){ id: attachments['id'], id: attachments['id'], type: attachments['type'], - url: typeof attachments['remote_url'] == "string" ? attachments['remote_url'] : attachments['url'] , + url: attachments['remote_url'] && typeof attachments['remote_url'] == "string" ? attachments['remote_url'] : attachments['url'] , preview_url: loadImages ? attachments['preview_url'] : '' } console.log("-----------------------------------") diff --git a/qml/pages/components/ImageFullScreen.qml b/qml/pages/components/ImageFullScreen.qml index 2490bf5..37b9eaa 100644 --- a/qml/pages/components/ImageFullScreen.qml +++ b/qml/pages/components/ImageFullScreen.qml @@ -103,12 +103,26 @@ Page { indeterminate: true id: playerProgress anchors.left: playerIcon.right - anchors.right: parent.right + anchors.right: videoDlBtn.left anchors.verticalCenter: playerIcon.verticalCenter anchors.leftMargin: 0 anchors.bottomMargin: Theme.paddingMedium } + IconButton { + id: videoDlBtn + visible: true + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.rightMargin: Theme.paddingLarge + anchors.bottomMargin: Theme.paddingMedium + //width: Theme.iconSizeMedium+Theme.paddingMedium*2 + icon.source: "image://theme/icon-m-cloud-download" + onClicked: { + var filename = mediaURL.split("/"); + FileDownloader.downloadFile(mediaURL, filename[filename.length-1]); + } + } Rectangle { visible: videoError.text != "" anchors.left: parent.left @@ -151,6 +165,7 @@ Page { clip: true onHeightChanged: if (imagePreview.status === Image.Ready) imagePreview.fitToScreen(); + Item { id: imageContainer width: Math.max(imagePreview.width * imagePreview.scale, imageFlickable.width) @@ -264,8 +279,6 @@ Page { } } } - - } Component { id: failedLoading @@ -275,7 +288,6 @@ Page { color: Theme.highlightColor } } - VerticalScrollDecorator { flickable: imageFlickable } IconButton { visible: true anchors.right: parent.right @@ -289,4 +301,5 @@ Page { FileDownloader.downloadFile(mediaURL, filename[filename.length-1]); } } + VerticalScrollDecorator { flickable: imageFlickable } }