-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscene.qml
56 lines (45 loc) · 929 Bytes
/
scene.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import Qt 4.7
import QtQuick 1.0
import QtMultimediaKit 1.1
Rectangle {
signal quit;
signal finished;
function resetAll() {
image.visible = false
video.visible = false
}
function showImage(url) {
resetAll()
image.source = url
image.visible = true
}
function showVideo(url) {
resetAll()
video.source = url
video.visible = true
video.play()
}
anchors.fill: parent; color: "black"
Video {
id: video
visible: false
anchors.fill: parent
smooth: true
onStopped: finished()
onError: finished()
onPaused: finished()
}
Image {
id: image
visible: false
anchors.fill: parent
fillMode: Image.PreserveAspectFit
smooth: true
}
MouseArea {
anchors.fill: parent
onClicked: quit()
}
focus: true
Keys.onEscapePressed: quit()
}