+ function stopPlayback() {
+ if (loader.item) {
+ loader.item.stop()
+ }
+ }
+
+ Loader {
+ id: loader
+ anchors.fill: parent
+ }
+
+ Connections {
+ target: loader.item
+ onFinished: loader.source = ""
+ }
+
+ FullScreenThumbnail {
+ id: image
+ source: itemUrl
+ mimeType: itemMimeType
+ rotation: calculateRotation(orientation.orientation)
+ width: isPortrait ? parent.height : parent.width - 10
+ height: isPortrait ? parent.width - 10 : parent.height
+ anchors.centerIn: parent
+ visible: loader.source == ""
+ property bool isPortrait: rotation == -90
+
+ Behavior on width {
+ PropertyAnimation { duration: 100 }
+ }
+
+ Behavior on height {
+ PropertyAnimation { duration: 100 }
+ }
+
+ Behavior on rotation {
+ PropertyAnimation { duration: 100 }
+ }
+
+ function calculateRotation(orientation) {
+ switch (orientation) {
+ case CameraOrientation.InvertedLandscape:
+ case CameraOrientation.Landscape:
+ return 0
+ case CameraOrientation.InvertedPortrait:
+ case CameraOrientation.Portrait:
+ return -90
+ default:
+ return 0
+ }
+ }
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ enabled: true
+ onClicked: postCaptureItem.clicked()
+ }
+
+ Column {
+ anchors.centerIn: parent
+ width: parent.width
+
+ CameraLabel {
+ id: errorLabel
+ width: parent.width
+ visible: image.error
+ text: qsTr("Failed to load preview")