-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayback.qml
56 lines (48 loc) · 1014 Bytes
/
Playback.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 QtQuick
import QtQuick.Controls
import QtMultimedia
Item {
id: root
property bool active: false
property bool playing: false
visible: active && playing
onActiveChanged: {
if(!root.active){
stop()
}
}
function playUrl(url){
playing = true
mediaPlayer.source = url
mediaPlayer.play()
}
function stop(){
playing = false
mediaPlayer.stop()
}
VideoOutput{
id: videoOutput
anchors.fill: parent
}
MediaPlayer{
id: mediaPlayer
videoOutput: videoOutput
audioOutput: AudioOutput{}
}
HoverHandler{
id: hover
}
RoundButton{
width: 50
height: 50
opacity: hover.hovered && active ? 1.0 : 0.0
anchors.centerIn: root
text: qsTr("\u25A0")
onClicked: root.stop()
Behavior on opacity {
NumberAnimation {
duration: 200
}
}
}
}