I am trying to run the command Pause for 10 seconds on the currently opened vlc on Windows8.1 command line.
I opened the vlc and run video.mp4 file on it and after 5 seconds it's supposed to pause the video.mp4 for 10 seconds.
here is my code
public class VlcControl {
@Override
public void start(Stage primaryStage) {
try {
manipulateVLC("rotate");//open video.mp4 on vlc
Thread.sleep(5000);//let the video run for 5 seconds
manipulateVLC("enterd");//pause the video
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
public void manipulateVLC(String tachesysteme) throws IOException {
ProcessBuilder processBuilder = new ProcessBuilder();
if(tachesysteme.equals("rotate")) {
processBuilder.command("cmd.exe", "/c", "vlc C:\\video.mp4");
processBuilder.directory(new File("C:\\Program Files\\VideoLAN\\VLC"));
processBuilder.redirectErrorStream(true);
processBuilder.start();
}if(tachesysteme.equals("translate")) {
processBuilder.command("cmd.exe", "/c", "TASKKILL /IM vlc.exe");
processBuilder.directory(new File("C:\\Program Files\\VideoLAN\\VLC"));
processBuilder.redirectErrorStream(true);
processBuilder.start();
}if(tachesysteme.equals("enterd")) {
processBuilder.command("cmd.exe", "/c", "vlc vlc://pause:10");
processBuilder.directory(new File("C:\\Program Files\\VideoLAN\\VLC"));
processBuilder.redirectErrorStream(true);
processBuilder.start();
}
}
}
The command pause doesn't work for me, any help is much appreciated. I am using VLC 3.0.11