Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public JFrame ourFrame = new JFrame();
  2. public JPanel jPanelMovie = new JPanel();
  3. public EmbeddedMediaPlayerComponent ourMediaPlayer;
  4. public String mediaPath = "";
  5.  
  6. MediaPlayer(String vlcPath, String mediaURL) {
  7. setLayout(new BorderLayout());
  8. this.mediaPath = mediaURL;
  9. NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), vlcPath);
  10. ourMediaPlayer = new EmbeddedMediaPlayerComponent();
  11. jPanelMovie.setSize(new Dimension(500, 260));
  12. ourFrame.add(jPanelMovie, BorderLayout.WEST);
  13. jPanelMovie.add(ourMediaPlayer, BorderLayout.CENTER);
  14. ourFrame.setSize(850, 430);
  15. ourFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  16. ourFrame.setVisible(true);
  17.  
  18. }
  19.  
  20. public void run() {
  21. ourMediaPlayer.getMediaPlayer().playMedia(mediaPath);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement