title: javafx sound/video playback
body: <p>I've been trying playback some mp3, videos using JavaFX without a result. I have also searched through every topic on this forum looking for solution without success... 
  If anyone can help me I would appreciate</p>
  
  <p><strong>Here's my code:</strong></p>
  
  <pre><code>  @Override
  public void start(Stage primaryStage) throws MalformedURLException {
      primaryStage.setTitle("Embedded Media Player");
      Group root = new Group();
      Scene scene = new Scene(root, 540, 241);
      File f = new File("src/sample/test2.mp3");
  
      Media media = new Media(f.toURI().toString());
  
      MediaPlayer mediaPlayer = new MediaPlayer(media);
      mediaPlayer.setAutoPlay(true);
  
      MediaView mediaView = new MediaView(mediaPlayer);
  
      System.out.println("mediaPlayer.getMedia() = " + mediaPlayer.getMedia().getSource());
      System.out.println("mp.getStatus() = " + mediaPlayer.getStatus());
      System.out.println("mediaPlayer.getTotalDuration() = " + mediaPlayer.getTotalDuration());
      System.out.println("mediaPlayer.getMedia().getSource() = " + mediaPlayer.getMedia().getSource());
  
      ((Group)scene.getRoot()).getChildren().add(mediaView);
      primaryStage.setScene(scene);
      primaryStage.show();
      mediaPlayer.play();
  </code></pre>
  
  <p><strong>and the output:</strong></p>
  
  <pre><code>mediaPlayer.getMedia() = file:/C:/Users/Piotr/Desktop/okon/src/sample/test2.mp3
  mp.getStatus() = UNKNOWN
  mediaPlayer.getTotalDuration() = UNKNOWN
  mediaPlayer.getMedia().getSource() = file:/C:/Users/Piotr/Desktop/okon/src/sample/test2.mp3
  </code></pre>
  
  <p><strong>Edit:</strong>
  Moving to Ubuntu solved my problems</p>