Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwineffects/package/contents/ui/Video.qml
Show All 12 Lines | |||||
13 | * This program is distributed in the hope that it will be useful, * | 13 | * This program is distributed in the hope that it will be useful, * | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
16 | * GNU General Public License for more details. * | 16 | * GNU General Public License for more details. * | ||
17 | * * | 17 | * * | ||
18 | * You should have received a copy of the GNU General Public License * | 18 | * You should have received a copy of the GNU General Public License * | ||
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. * | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
20 | **************************************************************************/ | 20 | **************************************************************************/ | ||
21 | import QtQuick 2.1 | 21 | | ||
22 | import QtQuick.Controls 1.1 | 22 | import QtQuick 2.5 | ||
23 | import QtQuick.Controls 2.0 as QQC2 | 23 | import QtQuick.Controls 2.5 as QQC2 | ||
24 | import QtQuick.Layouts 1.0 | 24 | import QtQuick.Layouts 1.1 | ||
25 | import QtMultimedia 5.0 as Multimedia | 25 | import QtMultimedia 5.0 as Multimedia | ||
26 | 26 | | |||
27 | Multimedia.Video { | 27 | Multimedia.Video { | ||
28 | id: videoItem | 28 | id: videoItem | ||
29 | autoPlay: true | 29 | autoPlay: true | ||
30 | source: model.VideoRole | 30 | source: model.VideoRole | ||
31 | width: 400 | 31 | width: 400 | ||
32 | height: 400 | 32 | height: 400 | ||
33 | QQC2.BusyIndicator { | 33 | QQC2.BusyIndicator { | ||
34 | anchors.centerIn: parent | 34 | anchors.centerIn: parent | ||
35 | visible: videoItem.status == Multimedia.MediaPlayer.Loading | 35 | visible: videoItem.status == Multimedia.MediaPlayer.Loading | ||
36 | running: true | 36 | running: true | ||
37 | } | 37 | } | ||
38 | Button { | 38 | QQC2.Button { | ||
39 | id: replayButton | 39 | id: replayButton | ||
40 | visible: false | 40 | visible: false | ||
41 | anchors.centerIn: parent | 41 | anchors.centerIn: parent | ||
42 | iconName: "media-playback-start" | 42 | icon.name: "media-playback-start" | ||
43 | onClicked: { | 43 | onClicked: { | ||
44 | replayButton.visible = false; | 44 | replayButton.visible = false; | ||
45 | videoItem.play(); | 45 | videoItem.play(); | ||
46 | } | 46 | } | ||
47 | Connections { | 47 | Connections { | ||
48 | target: videoItem | 48 | target: videoItem | ||
49 | onStopped: { | 49 | onStopped: { | ||
50 | replayButton.visible = true | 50 | replayButton.visible = true | ||
51 | } | 51 | } | ||
52 | } | 52 | } | ||
53 | } | 53 | } | ||
54 | } | 54 | } |