播放视频文件而不保存

时间:2014-01-11 14:31:58

标签: java video vlcj

我必须编写一个必须播放视频的java应用程序。此视频未保存在文件中,但我在结构(如FileStreamer)上保存,我无法将其保存在磁盘上。我尝试了vlcj插件和java本机库,但据我所知,他们都想要一个文件路径  谢谢您的帮助 !

 function createPlayer(FileInputStream media){
    JFrame frame = new JFrame("Project");
    FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(frame);
    mediaPlayer = new EmbeddedMediaPlayerComponent();
    JPanel  controlsPanel = new PannelCreate(mediap);
    frame.setContentPane(mediaPlayer);
    frame.setLocation(100, 100);
    frame.setSize(1050, 600);
    frame.add(controlsPanel, BorderLayout.SOUTH);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);

     /* vlcj wants a file path as argument of playMedia, however I don't have a filepath because the video isn't saved on disk but in a variable.*/
    mediaPlayer.getMediaPlayer().playMedia(media);

0 个答案:

没有答案