| | |
| | | */ |
| | | package de.uhilger.calypso.handler; |
| | | |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import de.uhilger.calypso.App; |
| | | import de.uhilger.calypso.MeldeThread; |
| | | import static de.uhilger.calypso.handler.OMXPlayer.BLANK; |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | |
| | | * |
| | | * @author ulrich |
| | | */ |
| | | public class VLCPlayer implements Player { |
| | | public class VLCPlayer extends BasePlayer implements Player { |
| | | |
| | | private static final Logger logger = Logger.getLogger(VLCPlayer.class.getName()); |
| | | |
| | | public static final String CMD_STOP = "s"; |
| | | public static final String DBUS_PREFIX = "dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."; |
| | | public static final String CMD_PAUSE_RESUME = "PlayPause"; |
| | | public static final String CMD_SEEK = "Seek"; |
| | | |
| | | @Override |
| | | public String abspielen(String urlStr, String parameter, String meldeUrlStr, String token) { |
| | |
| | | |
| | | kommando.append(urlStr); |
| | | } |
| | | kommando.append(" vlc://quit"); |
| | | logger.log(Level.FINE, "kommando: {0}", kommando.toString()); |
| | | Process player_process = Runtime.getRuntime().exec(kommando.toString()); |
| | | if(meldeUrlStr != null) { |
| | |
| | | return antwort; |
| | | } |
| | | |
| | | @Override |
| | | |
| | | /* |
| | | public String kommando(String k) { |
| | | if(k.equalsIgnoreCase(OMXPlayer.CMD_STOP)) { |
| | | if(k.equalsIgnoreCase(VLCPlayer.CMD_STOP)) { |
| | | Process p = App.getPlayerProcess(); |
| | | p.destroy(); |
| | | App.setPlayerProcess(null); |
| | |
| | | String antwort = "Kommando '" + k + "' ausgefuehrt."; |
| | | return antwort; |
| | | } |
| | | */ |
| | | |
| | | @Override |
| | | public void prozessBeendet(String meldeUrlStr) { |
| | | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
| | | public StringBuilder buildParams(HttpExchange t, Map m) { |
| | | return new StringBuilder(); |
| | | } |
| | | |
| | | @Override |
| | | public String tilgen() { |
| | | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
| | | } |
| | | |
| | | |
| | | } |