以全屏模式启动 MPlayer
我正在尝试从 Java 应用程序以全屏模式在 MPlayer 中打开视频。我正在使用 ProcessBuilder 类将命令发送到 MPlayer。问题是,当我调用 MPlayer 播放视频时,没有任何反应。它仅在我关闭应用程序窗口时显示。
换句话说,在我关闭程序窗口之前,我想要执行的进程不会执行任何操作。
我想知道如何在不关闭任何窗口的情况下启动 MPlayer。 这是我用来全屏调用 MPlayer 的代码。
ProcessBuilder prcbdr = new ProcessBuilder(Mplayerpath, "-quiet",
"-slave", "\"" + videoFile + "\"", "vo_fullscreen", "1");
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");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你应该在命令中添加 -fs 开关以全屏模式播放 mplayer。
I think you should add -fs switch in the command to play mplayer in full screen mode.
当使用
-slave
时,mplayer 需要来自您的应用程序的命令,我认为您稍后会发布该命令。关闭窗口可能会关闭您的应用程序,从而关闭命令流,从而刷新管道中的命令,从而启动 mplayer。尝试显式刷新命令流。
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.