Java Eclipse Vlcj Java 本机访问 (JNA)

问题描述

我正在尝试在 Java 上使用 VLCJ 播放 VIDEO。当我尝试运行时,我在控制台上收到此消息并且框架未打开。

Java 本机访问 (JNA) API 版本 3 版本:3.5.2 (b66) 本机:3.5.0 (60417f69d77e4d8d693b43391a4a5b91) 前缀:win32-amd64

这是我的代码

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;

import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;

public class App extends JFrame`{


private static final long serialVersionUID = 1L;
   private static final String TITLE = "My First Media Player";
   private static final String VIDEO_PATH = "C:\\videos\\video.mp4";
   private final EmbeddedMediaPlayerComponent mediaPlayerComponent;
   private JButton playButton;

   public App(String title) {
      super(title);
      mediaPlayerComponent = new EmbeddedMediaPlayerComponent();        
   }
   public void initialize() {
      this.setBounds(100,100,600,400);
      this.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);
      this.addWindowListener(new WindowAdapter() {
         @Override
         public void windowClosing(WindowEvent e) {
            mediaPlayerComponent.release();
            System.exit(0);
         }
      });       
      JPanel contentPane = new JPanel();
      contentPane.setLayout(new BorderLayout());     
      contentPane.add(mediaPlayerComponent,BorderLayout.CENTER);

      JPanel controlsPane = new JPanel();
      playButton = new JButton("Play");
      controlsPane.add(playButton);     
      contentPane.add(controlsPane,BorderLayout.soUTH);
      playButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            mediaPlayerComponent.getMediaPlayer().play();;
         }
      });        
      this.setContentPane(contentPane);
      this.setVisible(true);
   }
   public void loadVideo(String path) {
     // mediaPlayerComponent.getMediaPlayer()
   }
   public static void main( String[] args ){
      try {
         UIManager.setLookAndFeel(
         UIManager.getSystemLookAndFeelClassName());
      } 
      catch (Exception e) {
         System.out.println(e);
      }
      App application = new App(TITLE);
      application.initialize(); 
      application.setVisible(true);  
      application.loadVideo(VIDEO_PATH);
   }

}

我的库:

vlcj-3.0.1 jar jna -3.5.2

我的dll:

libvlc.dll 32 位 和 JDE 32 位更改 和 libs 32 位,dll 32 位

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...