4 * This file is part of CameraPlus.
6 * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 import QtCameraExtras 1.0
32 property alias source: video.source
43 anchors.top: parent.top
44 anchors.bottom: toolBar.top
45 anchors.left: parent.left
46 anchors.right: parent.right
48 onClicked: toolBar.show = !toolBar.show
55 onTriggered: toolBar.show = false
60 active: Qt.application.active && pipelineManager.scaleAcquired
65 video.volume = Math.min(video.volume + 2, 100)
68 onVolumeDownPressed: {
70 video.volume = Math.max(video.volume - 2, 0)
77 anchors.top: parent.top
78 anchors.left: parent.left
79 width: (parent.width * video.volume) / 100
83 opacity: timer.running ? 1.0 : 0.0
86 NumberAnimation { duration: 250 }
98 cameraConfig: camera.cameraConfig
100 onError: showError(qsTr("Error playing video. Please try again or restart the application"))
103 if (state != VideoPlayer.StatePaused) {
111 if (state == VideoPlayer.StateStopped) {
118 target: Qt.application
120 if (!Qt.application.active) {
129 property bool show: true
133 anchors.bottom: parent.bottom
134 anchors.bottomMargin: 20
135 anchors.left: parent.left
136 anchors.leftMargin: 20
137 opacity: show ? 0.8 : 0.0
140 Behavior on opacity {
141 PropertyAnimation { duration: 200; }
144 tools: CameraToolBarTools {
146 iconSource: cameraTheme.videoStopIconId
147 onClicked: video.stop()
152 height: toolBar.height
153 anchors.verticalCenter: parent.verticalCenter
156 handleBackgroundPressed: ""
159 maximumValue: video.duration
160 value: video.position
161 orientation: Qt.Horizontal
164 if (!slider.pressed) {
165 video.position = slider.value
174 iconSource: video.state != VideoPlayer.StatePaused ? cameraTheme.videoPauseIconId : cameraTheme.videoPlayIconId