From 2fb34c011914e05f35c9aecf7015821c2f31be54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Geh=C3=B6r?= Date: Tue, 14 Dec 2021 10:31:01 +0200 Subject: Fix Declarative Camera issues on video side After the fix, the buttons on video side will behave as they should and preview plays the video. Fixes: QTBUG-99134 Change-Id: I593aad3f37b93b3699781c6b143e7e0c9a157ec3 Reviewed-by: Lars Knoll (cherry picked from commit 452caffc791e4be614ffc46ae6dc34e3da8be90d) Reviewed-by: Assam Boudjelthia --- examples/multimedia/declarative-camera/VideoCaptureControls.qml | 4 ++-- examples/multimedia/declarative-camera/VideoPreview.qml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/multimedia/declarative-camera/VideoCaptureControls.qml b/examples/multimedia/declarative-camera/VideoCaptureControls.qml index 53682f88b..b2dbe3bd3 100644 --- a/examples/multimedia/declarative-camera/VideoCaptureControls.qml +++ b/examples/multimedia/declarative-camera/VideoCaptureControls.qml @@ -80,7 +80,7 @@ FocusScope { CameraButton { text: "Record" anchors.fill: parent - visible: captureSession.recorder.status !== MediaRecorder.RecordingStatus + visible: captureSession.recorder.recorderState !== MediaRecorder.RecordingState onClicked: captureSession.recorder.record() } } @@ -92,7 +92,7 @@ FocusScope { id: stopButton text: "Stop" anchors.fill: parent - visible: captureSession.recorder.status === MediaRecorder.RecordingStatus + visible: captureSession.recorder.recorderState === MediaRecorder.RecordingState onClicked: captureSession.recorder.stop() } } diff --git a/examples/multimedia/declarative-camera/VideoPreview.qml b/examples/multimedia/declarative-camera/VideoPreview.qml index 843fa82cc..e2d6a47e0 100644 --- a/examples/multimedia/declarative-camera/VideoPreview.qml +++ b/examples/multimedia/declarative-camera/VideoPreview.qml @@ -61,9 +61,13 @@ Item { //switch back to viewfinder after playback finished onMediaStatusChanged: { - if (status == MediaPlayer.EndOfMedia) + if (mediaStatus == MediaPlayer.EndOfMedia) videoPreview.closed(); } + onSourceChanged: { + if (visible && source !== "") + play(); + } videoOutput: output audioOutput: AudioOutput { -- cgit v1.2.3