commit | author | age
|
60719c
|
1 |
/* |
U |
2 |
AV-Direktor - Control OMXPlayer on Raspberry Pi via HTTP |
|
3 |
Copyright (C) 2021 Ulrich Hilger |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
63b711
|
19 |
package de.uhilger.avdirektor.handler; |
U |
20 |
|
|
21 |
import com.sun.net.httpserver.HttpExchange; |
cfe367
|
22 |
import de.uhilger.avdirektor.App; |
63b711
|
23 |
import java.util.logging.Level; |
U |
24 |
import java.util.logging.Logger; |
|
25 |
|
|
26 |
/** |
|
27 |
* |
|
28 |
* @author ulrich |
|
29 |
*/ |
|
30 |
public class SeekHandler extends PlayHandler { |
|
31 |
|
|
32 |
private static final Logger logger = Logger.getLogger(SeekHandler.class.getName()); |
|
33 |
|
|
34 |
public SeekHandler(String cmd) { |
|
35 |
super(cmd); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
protected String process(HttpExchange t, String params) { |
cfe367
|
40 |
String antwort = App.getPlayer().abspielen( |
63b711
|
41 |
getParam(map, "titel"), params, getParam(map, "r"), "1"); |
U |
42 |
logger.log(Level.FINE, antwort); |
|
43 |
return antwort; |
|
44 |
} |
|
45 |
|
fa4bcf
|
46 |
/* |
U |
47 |
start "C:Program FilesVLCvlc.exe" rel="nofollow" "D:MoviesThe Italian Job.avi" --start-time 12 --stop-time 20 |
|
48 |
|
|
49 |
You simply have to use the command line as given above, with the file paths and the time changed as needed. |
|
50 |
The numbers 12 and 20 in the command line indicate 12 seconds and 20 seconds respectively. |
|
51 |
|
|
52 |
|
|
53 |
--global-key-play-pause=<string> |
|
54 |
Play/Pause |
|
55 |
Select the hotkey to use to swap paused state. |
|
56 |
*/ |
63b711
|
57 |
protected StringBuilder buildParams(HttpExchange t) { |
U |
58 |
StringBuilder params = super.buildParams(t); |
|
59 |
params.append(" --pos "); |
852f20
|
60 |
params.append(getParam(map, "pos")); |
63b711
|
61 |
return params; |
U |
62 |
} |
|
63 |
|
|
64 |
} |