Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import javax.swing.JFileChooser;
- /*
- * 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 Start {
- private static JFileChooser ourFileSelector = new JFileChooser();
- public static void main(String[] args) {
- String vlcPath="",mediaPath="";
- File ourFile;
- //Analisa qual sistema operacional utilizado:
- String OS = System.getProperty("os.name").toLowerCase();
- if(OS.contains("win")) {
- vlcPath = "VLC/VLCWindows/";
- } else if ((OS.contains("nix") || OS.contains("nux") || OS.contains("aix"))) {
- vlcPath = "/usr/include/vlc";
- // ourFileSelector.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- // ourFileSelector.showSaveDialog(null);
- // ourFile = ourFileSelector.getSelectedFile();
- // vlcPath = ourFile.getAbsolutePath();
- }
- //Seleciona arquivo a ser reproduzido
- ourFileSelector.setFileSelectionMode(JFileChooser.FILES_ONLY);
- ourFileSelector.showSaveDialog(null);
- ourFile = ourFileSelector.getSelectedFile();
- mediaPath = ourFile.getAbsolutePath();
- new MediaPlayer(vlcPath, mediaPath).run();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement