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
61 cameraConfig: camera.cameraConfig
63 onError: showError(qsTr("Error playing video. Please try again or restart the application"))
66 if (state != VideoPlayer.StatePaused) {
74 if (state == VideoPlayer.StateStopped) {
81 target: Qt.application
83 if (!Qt.application.active) {
92 property bool show: true
96 anchors.bottom: parent.bottom
97 anchors.bottomMargin: 20
98 anchors.left: parent.left
99 anchors.leftMargin: 20
100 opacity: show ? 0.8 : 0.0
103 Behavior on opacity {
104 PropertyAnimation { duration: 200; }
107 tools: CameraToolBarTools {
109 iconSource: cameraTheme.videoStopIconId
110 onClicked: video.stop()
115 height: toolBar.height
116 anchors.verticalCenter: parent.verticalCenter
119 handleBackgroundPressed: ""
122 maximumValue: video.duration
123 value: video.position
124 orientation: Qt.Horizontal
127 if (!slider.pressed) {
128 video.position = slider.value
137 iconSource: video.state != VideoPlayer.StatePaused ? cameraTheme.videoPauseIconId : cameraTheme.videoPlayIconId