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: show ? 20 : -1 * (height + 20)
98 anchors.left: parent.left
99 anchors.leftMargin: 20
102 Behavior on anchors.bottomMargin {
103 PropertyAnimation { duration: 200; }
106 tools: CameraToolBarTools {
108 iconSource: cameraTheme.videoStopIconId
109 onClicked: video.stop()
114 height: toolBar.height
115 anchors.verticalCenter: parent.verticalCenter
118 handleBackgroundPressed: ""
121 maximumValue: video.duration
122 value: video.position
123 orientation: Qt.Horizontal
126 if (!slider.pressed) {
127 video.position = slider.value
136 iconSource: video.state != VideoPlayer.StatePaused ? cameraTheme.videoPauseIconId : cameraTheme.videoPlayIconId