Video player
- fixed wrong media URL - download media button repositioned
This commit is contained in:
parent
2588a802ea
commit
539e681331
2 changed files with 18 additions and 5 deletions
|
@ -262,7 +262,7 @@ function parseToot (data){
|
||||||
id: attachments['id'],
|
id: attachments['id'],
|
||||||
id: attachments['id'],
|
id: attachments['id'],
|
||||||
type: attachments['type'],
|
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'] : ''
|
preview_url: loadImages ? attachments['preview_url'] : ''
|
||||||
}
|
}
|
||||||
console.log("-----------------------------------")
|
console.log("-----------------------------------")
|
||||||
|
|
|
@ -103,12 +103,26 @@ Page {
|
||||||
indeterminate: true
|
indeterminate: true
|
||||||
id: playerProgress
|
id: playerProgress
|
||||||
anchors.left: playerIcon.right
|
anchors.left: playerIcon.right
|
||||||
anchors.right: parent.right
|
anchors.right: videoDlBtn.left
|
||||||
|
|
||||||
anchors.verticalCenter: playerIcon.verticalCenter
|
anchors.verticalCenter: playerIcon.verticalCenter
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: 0
|
||||||
anchors.bottomMargin: Theme.paddingMedium
|
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 {
|
Rectangle {
|
||||||
visible: videoError.text != ""
|
visible: videoError.text != ""
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
@ -151,6 +165,7 @@ Page {
|
||||||
clip: true
|
clip: true
|
||||||
onHeightChanged: if (imagePreview.status === Image.Ready) imagePreview.fitToScreen();
|
onHeightChanged: if (imagePreview.status === Image.Ready) imagePreview.fitToScreen();
|
||||||
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: imageContainer
|
id: imageContainer
|
||||||
width: Math.max(imagePreview.width * imagePreview.scale, imageFlickable.width)
|
width: Math.max(imagePreview.width * imagePreview.scale, imageFlickable.width)
|
||||||
|
@ -264,8 +279,6 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
id: failedLoading
|
id: failedLoading
|
||||||
|
@ -275,7 +288,6 @@ Page {
|
||||||
color: Theme.highlightColor
|
color: Theme.highlightColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VerticalScrollDecorator { flickable: imageFlickable }
|
|
||||||
IconButton {
|
IconButton {
|
||||||
visible: true
|
visible: true
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -289,4 +301,5 @@ Page {
|
||||||
FileDownloader.downloadFile(mediaURL, filename[filename.length-1]);
|
FileDownloader.downloadFile(mediaURL, filename[filename.length-1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
VerticalScrollDecorator { flickable: imageFlickable }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue