Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.sun.jna.NativeLibrary;
- import javax.swing.JFrame;
- import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;
- import uk.co.caprica.vlcj.runtime.RuntimeUtil;
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author Wotan
- */
- public class MediaPlayer {
- private JFrame ourFrame = new JFrame();
- private EmbeddedMediaPlayerComponent ourMediaPlayer;
- private String mediaPath = "";
- MediaPlayer(String vlcPath, String mediaURL) {
- this.mediaPath = mediaURL;
- NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), vlcPath);
- ourMediaPlayer = new EmbeddedMediaPlayerComponent();
- ourFrame.setContentPane(ourMediaPlayer);
- ourFrame.setSize(1280, 800);
- ourFrame.setVisible(true);
- ourFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- }
- public void run() {
- ourMediaPlayer.getMediaPlayer().playMedia(mediaPath);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement