-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIcookPlayer.qml
48 lines (39 loc) · 1.31 KB
/
IcookPlayer.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
import controls.Player;
Player {
id: videoPlayer;
visible: true;
anchors.fill: parent;
focus: true;
isFullscreen: true;
function playVideoById(v_url) {
icookPlayerParent.visible = true;
videoPlayer.setFocus();
var request = new XMLHttpRequest();
request.open("POST", "https://icookserver.online", true);
request.onreadystatechange = function() {
if (request.readyState !== XMLHttpRequest.DONE)
return;
if (request.status === 200) {
log("response was received");
videoPlayer.abort();
var url_trash = v_url;
log(url_trash);
videoPlayer.playUrl(url_trash);
videoPlayer.setFocus();
} else
log("unhandled status", request.status);
}
request.send();
}
onBackPressed: {
log("player abort");
videoPlayer.abort();
icookPlayerParent.visible = false;
if (icookPlayerParent.showFrom == "playlist") {
videoList.setFocus();
}
}
onFinished: {
icookPlayerParent.visible = false;
}
}