diff options
author | Pekka Gehör <pekka.gehor@qt.io> | 2021-12-14 10:31:01 +0200 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2021-12-15 15:30:02 +0200 |
commit | 2fb34c011914e05f35c9aecf7015821c2f31be54 (patch) | |
tree | 1b1ad8071574372fb5fbb7757403718ac5424578 | |
parent | 3477536b30b3e3c484df316ae5943dba5bc22d28 (diff) |
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 <lars.knoll@qt.io>
(cherry picked from commit 452caffc791e4be614ffc46ae6dc34e3da8be90d)
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
-rw-r--r-- | examples/multimedia/declarative-camera/VideoCaptureControls.qml | 4 | ||||
-rw-r--r-- | 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 { |