0



I'm trying to open a video in MPlayer in fullscreen mode from a Java application. I'm using the ProcessBuilder class to send the commands to MPlayer. The problem is, when I invoke MPlayer to play the video, nothing happens. It only shows up when I close my application window.

In other words, the process that I want to execute don't do anything till I close the program's window.

I wonder how I could to launch MPlayer without have to close any window. Here's the code I'm using to invoke MPlayer in fullscreen.

ProcessBuilder prcbdr = new ProcessBuilder(Mplayerpath, "-quiet",
                    "-slave", "\"" + videoFile + "\"", "vo_fullscreen", "1");
Manoel Afonso
  • 47
  • 1
  • 10

2 Answers2

2

I think you should add -fs switch in the command to play mplayer in full screen mode.

Blue Phoenix
  • 153
  • 11
0

When using -slave, mplayer expects commands from your application, which I presume you are posting later on. Closing the window probably closes your application, which closes the command stream, which in turn flushes the commands in the pipeline, thus starting mplayer.

Try explicitly flushing the command stream.

Simon Richter
  • 28,572
  • 1
  • 42
  • 64
  • Hello! I did launch Mlayer in fullscreen, but it didn't worked flushing the command stream explicity. I only had to *close* the stream (not flush). And then, MPlayer would oppen in fullscreen. Thank you for the help, I wouldn't do without your hint =P – Manoel Afonso Mar 16 '11 at 12:07