| | |
| | | |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import de.uhilger.avdirektor.App; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | import org.apache.commons.io.FileUtils; |
| | | |
| | | /** |
| | | * Play |
| | |
| | | super(cmd); |
| | | } |
| | | |
| | | @Override |
| | | protected String process(HttpExchange t, String params) { |
| | | String antwort = App.getPlayer().abspielen( |
| | | getParam(map, "titel"), params, getParam(map, "r"), "1"); |
| | | logger.log(Level.FINE, antwort); |
| | | return antwort; |
| | | } |
| | | |
| | | protected StringBuilder buildParams(HttpExchange t) { |
| | | StringBuilder params = super.buildParams(t); |
| | | params.append("-b -o "); |
| | |
| | | return params; |
| | | } |
| | | |
| | | @Override |
| | | protected String process(HttpExchange t, String params) { |
| | | if(cmd.equalsIgnoreCase(OMXPlayer.F_PLAY)) { |
| | | try { |
| | | FileUtils.deleteDirectory(new File(System.getProperty("omx.wd"), "omx-logs")); |
| | | } catch (IOException ex) { |
| | | logger.log(Level.SEVERE, null, ex); |
| | | } |
| | | } |
| | | String antwort = App.getPlayer().abspielen( |
| | | getParam(map, "titel"), params, getParam(map, "r"), "1"); |
| | | logger.log(Level.FINE, antwort); |
| | | return antwort; |
| | | } |
| | | |
| | | } |