-
-CameraPage {
- id: page
-
- property bool popTwice: false
- controlsVisible: false
- policyMode: CameraResources.PostCapture
- needsPipeline: false
- standbyVisible: false
-
- property alias source: video.source
- function play() {
- video.play();
+import QtCamera 1.0
+import QtCameraExtras 1.0
+
+Item {
+ id: page
+
+ signal finished
+ property alias source: video.source
+
+ function play() {
+ return video.play()
+ }
+
+ MouseArea {
+ anchors.top: parent.top
+ anchors.bottom: toolBar.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ onClicked: toolBar.show = !toolBar.show
+ }
+
+ Timer {
+ id: hideTimer
+ running: toolBar.show
+ interval: 3000
+ onTriggered: toolBar.show = false
+ }
+
+ VideoPlayer {
+ id: video
+ anchors.fill: parent
+ cameraConfig: cam.cameraConfig
+
+ onError: showError(qsTr("Error playing video. Please try again or restart the application"))
+
+ function toggle() {
+ if (!video.paused) {
+ video.pause()
+ } else {
+ page.play()
+ }