-
Notifications
You must be signed in to change notification settings - Fork 9
/
omxplayer.php
executable file
·150 lines (141 loc) · 4.23 KB
/
omxplayer.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
require_once 'cfg.php';
mb_internal_encoding('UTF-8');
setlocale(LC_ALL, 'ru_RU.UTF-8');
?>
<html>
<head>
<title>PHP OMXPlayer Control</title>
<style type="text/css">
.error{ color:red; font-weight:bold; }
.button{ height: 50px; width: 85px; }
</style>
<script src="JsHttpRequest.js"></script>
<script>
function omxajax(act) {
if (act == 'play') {
var arg=document.getElementById('selected_file').value;
//alert (arg);
}
JsHttpRequest.query(
'omx_control.php',
{
"act": act,
"arg": arg
},
function(result, errors) {
if (result['err']) {
document.getElementById('err').innerHTML = result['err'];
//alert (result['err']);
} else {
if (result) {
document.getElementById('res').innerHTML = result['res'];
document.getElementById('err').innerHTML = ' ';
}
}
},
true //disable caching
);
}
</script>
</head>
<body>
<center>
<?php
$files = glob(PATH.'/{*.[mM][kK][vV],*.[aA][vV][iI],*.[mM][pP][4]}', GLOB_BRACE | GLOB_MARK);
//print_r($files);
$vids = array_filter ($files, function ($file) { if (substr($file,-1) != '/') return true;} ); //filter out directories
?>
<select id="selected_file">
<?php
foreach ($vids as $key=>$val) {
echo '<option value="'.$val.'">'.basename($val).'</option>';
}
?>
</select>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
<button type="button" class="button" onclick="omxajax('voldown');">VOLUME -</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('play');">PLAY</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('volup');">VOLUME +</button>
</td>
</tr>
<tr>
<td>
<button type="button" class="button" onclick="omxajax('seek-30');">SEEK -30</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('pause');">PAUSE</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('seek30');">SEEK +30</button>
</td>
</tr>
<tr>
<td>
<button type="button" class="button" onclick="omxajax('seek-600');">SEEK -600</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('stop');">STOP</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('seek600');">SEEK +600</button>
</td>
</tr>
<tr><td colspan="3"><hr></td></tr>
<tr>
<td>
<button type="button" class="button" onclick="omxajax('speedup');">SPEED +</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('nextchapter');">NEXT CHAPTER</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('nextaudio');">NEXT AUDIO</button>
</td>
</tr>
<tr>
<td>
<button type="button" class="button" onclick="omxajax('speeddown');">SPEED -</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('prevchapter');">PREV CHAPTER</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('prevaudio');">PREV AUDIO</button>
</td>
</tr>
<tr><td colspan="3"><hr></td></tr>
<tr>
<td>
<button type="button" class="button" onclick="omxajax('prevsubtitles');">PREV SUBTITLES</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('togglesubtitles');">TOGGLE SUBTITLES</button>
</td>
<td>
<button type="button" class="button" onclick="omxajax('nextsubtitles');">NEXT SUBTITLES</button>
</td>
</tr>
<tr><td colspan="3"><hr></td></tr>
<tr>
<td>
<button type="button" class="button" onclick=""> </button>
</td>
<td>
<a href="setup.php?path=<?php echo PATH;?>"><button type="button" class="button" >SETUP</button></a>
</td>
<td>
<button type="button" class="button" onclick=""> </button>
</td>
</tr>
</table>
</center>
<div id="res"> </div><div id="err"> </div>
</body>
</html>