Video player

- fixed wrong media URL
- download media button repositioned
This commit is contained in:
Dusko Angirevic 2017-10-26 16:38:07 +02:00
parent 2588a802ea
commit 539e681331
2 changed files with 18 additions and 5 deletions

View file

@ -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("-----------------------------------")

View file

@ -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 }
}