Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8210828

MediaPlayer not playing mp3 files with photoshopped album art

    XMLWordPrintable

Details

    • 9
    • x86_64
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 version 1803
      Java 10.0.2

      A DESCRIPTION OF THE PROBLEM :
      I have a small JavaFX application to test MediaPlayer with mp3 files. The code is available at my stackoverflow question here https://stackoverflow.com/questions/52312007/javafx-mediaplayer-not-playing-with-jdk-10
      I have narrowed down the issue to the album art of the mp3 which was generated from photoshop (cos sometimes I photoshop album art). The code works with other mp3 files that doesnt have album art or the album art wasnt photoshopped. Furthermore, this issue doesnt exist for Java 8.

      REGRESSION : Last worked in version 8u181

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Download the following files:
      - sample mp3 with original album art (haikei.mp3) https://drive.google.com/file/d/1WIc57GH4m3GTCFOeqrxMH7n0iLQJWmIH/view?usp=sharing
      - extracted original album art (haikei.jpg) https://drive.google.com/file/d/19c9Dckk8Fi4fL5dmlOMaEA9DEGg6uorw/view?usp=sharing
      - photoshopped album art (haikei2.jpg) https://drive.google.com/file/d/10FbsjEwCd81rRetHvCheCTlDjisTm3mR/view?usp=sharing
      - sample mp3 with photoshopped album art (haikei2.mp3) https://drive.google.com/file/d/1s9L5HQ1IQkp1zU_Jr8eaWucSkqZhhgLd/view?usp=sharing

      Change line 20 to either "haikei.mp3" to "haikei2.mp3"
      Open terminal and enter javac Main.java --add-modules=javafx.media,javafx.graphics
      Then run by entering java Main

      If you used "haikei.mp3", a small window will open and there is audio playing.
      If you used "haikei2.mp3", a small window will open but there is no audio playing.

      Tools used:
      Mp3Tag v2.85 (for album art extraction and insertion)
      Adobe Photoshop CC 19.1.2

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      haikei2.mp3 should be playing
      ACTUAL -
      haikei2.mp3 is not playing

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.media.Media;
      import javafx.scene.Scene;
      import javafx.scene.media.MediaPlayer;
      import javafx.scene.media.MediaView;
      import javafx.stage.Stage;
      import java.io.File;

      public class Main extends Application {

          @Override
          public void start(Stage primaryStage) throws Exception {
              primaryStage.setTitle("Hello World");
              Group root = new Group();
              Scene scene = new Scene(root, 300, 275);
              primaryStage.setScene(scene);
              primaryStage.sizeToScene();
              primaryStage.show();
              String bip = "haikei2.mp3"; // "haikei.mp3"
              Media hit = new Media(new File(bip).toURI().toString());
              MediaPlayer mediaPlayer = new MediaPlayer(hit);
              mediaPlayer.setAutoPlay(true);
              MediaView mediaView = new MediaView(mediaPlayer);
              ((Group)scene.getRoot()).getChildren().add(mediaView);
          }

          public static void main(String[] args) {
              launch(args);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      use JDK 8

      Attachments

        1. haikei.mp3
          8.59 MB
        2. haikei2.mp3
          8.64 MB
        3. MPlayerTest.java
          1 kB

        Issue Links

          Activity

            People

              almatvee Alexander Matveev
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: