我需要用Java在VLC播放器中打开一个视频。我已经创建了这个程序,但我不知道如何使用这个预先存在的代码运行视频,我应该在其中添加什么?
目前我使用的是:
package vlc.player;
import java.io.*;
public class vlc
{
public static void main(String[] args) throws IOException,
InterruptedException
{
Runtime.getRuntime().exec("\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\"");
System.out.println("VLC started.");
}
}发布于 2018-01-11 21:03:31
package vlc.player;
import java.io.*;
public class vlc {
public static void main(String[] args)
throws IOException, InterruptedException
{
String [] s= new String[]
{"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe","D:\\Video\\3G\\K.MP4"};
Runtime.getRuntime().exec(s);
System.out.println("VLC started."+"prashant.ibmce@gmail.com");
}
}发布于 2018-01-09 22:55:56
阅读文档时,您可以使用嵌入式HTTP服务器启动VLC:https://wiki.videolan.org/Documentation:Advanced_Use_of_VLC/#The_HTTP_interface
和发送HTTP请求来执行一些操作:
https://wiki.videolan.org/VLC_HTTP_requests/
如果你只想播放一个文件一次,就像这样启动它
vlc.exe file://c:\\path\\file.avi https://stackoverflow.com/questions/48169905
复制相似问题