-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobile.php
94 lines (87 loc) · 2.68 KB
/
mobile.php
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<html>
<?php
define('BASE_DIR', dirname(__FILE__));
require_once(BASE_DIR.'/config.php');
$config = array();
$config = readConfig($config, CONFIG_FILE1);
$config = readConfig($config, CONFIG_FILE2);
$mjpegmode = 0;
if(isset($_COOKIE["stream_mode"])) {
if($_COOKIE["stream_mode"] == "MJPEG-Stream") {
$streamButton = "Default-Stream";
$mjpegmode = 1;
}
}
$video_fps = $config['video_fps'];
$divider = $config['divider'];
$show_streaming = $_GET['action'] == 'stream'
?>
<head>
<title>Oculus</title>
<link rel="stylesheet" href="css/style_minified.css" />
<style>
body {
margin: 0;
padding: 0;
}
div {
-webkit-user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-ms-user-select: none;
}
#mjpeg_dest {
height: 100%;
width: 100%;
object-fit: cover;
}
#preview_select, #timelapse_button {
display: none;
}
#streaming_button {
left: 50%;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
}
#image_overlay {
height: 100%;
position: absolute;
top: 0;
width: 100%;
}
#main-buttons {
bottom: 5%;
position: absolute;
text-align: center;
width: 100%;
}
#main-buttons input {
margin-top: 5px;
}
</style>
<script src="js/script.js"></script>
</head>
<?php if ($show_streaming) { ?>
<body onload="setTimeout('init(<?php echo " $mjpegmode, $video_fps, $divider" ?>);', 100);">
<div id="preview_select"></div>
<img id="mjpeg_dest" src="./loading.jpg">
<div id="image_overlay">
<div id="main-buttons">
<input id="video_button" type="button" class="btn btn-primary">
<input id="image_button" type="button" class="btn btn-primary">
<input id="timelapse_button" type="button" class="btn btn-primary">
<input id="md_button" type="button" class="btn btn-primary">
<input id="halt_button" type="button" class="btn btn-danger">
<input id="halt_streaming_button" type="button" class="btn btn-danger" value="stop streaming" onclick="window.location='/mobile.php';">
</div>
</div>
</body>
<?php } else { ?>
<body>
<div id="streaming_button">
<input id="halt_streaming_button" type="button" class="btn btn-primary" value="start streaming" onclick="window.location='/mobile.php?action=stream';">
</div>
</body>
<?php } ?>
</html>