<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    This might be a regression introduced by the fix for
    <a class="moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8282054">https://bugs.openjdk.org/browse/JDK-8282054</a><br>
    <br>
    Can you file a bug at <a class="moz-txt-link-freetext" href="https://bugreport.java.com/">https://bugreport.java.com/</a> ?<br>
    <br>
    Maybe Alexander can comment further.<br>
    <br>
    -- Kevin<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 9/15/2022 8:27 AM, Alessandro
      Mercier wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAEN8YAHyhCzNOZS-Yc6gjT2KoMQxoVXkdMErn_7M5zxxJH-j2A@mail.gmail.com">
      
      <div dir="ltr">Hello all,
        <div><br>
        </div>
        <div>After this commit:<br>
          <a href="https://github.com/openjdk/jfx/commit/d1110f479567c314ecb6848700bcf4552509d7e9" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jfx/commit/d1110f479567c314ecb6848700bcf4552509d7e9</a><br>
          <br>
          Creating a new Media object using a MP3 file in the resources
          of a project, you can get exceptions:<br>
          <br>
          Exception in thread "JavaFX Application Thread"
          MediaException: MEDIA_UNSUPPORTED : Unrecognized file
          signature!<br>
          at
          <a class="moz-txt-link-abbreviated" href="mailto:javafx.media@20-ea/javafx.scene.media.Media">javafx.media@20-ea/javafx.scene.media.Media</a>.<init>(Media.java:411)<br>
          <br>
          At first glance, the error is in this Locator file in the
          JavaFX source code:<br>
          <a href="https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java</a><br>
        </div>
        <div><br>
        </div>
        <div><b>Steps to reproduce the bug:</b></div>
        <div>1. Create a new Media object and load an MP3 from the
          resources<br>
          2. Watch the Media object throw a MediaException:
          MEDIA_UNSUPPORTED : Unrecognized file signature!</div>
        <div><br>
        </div>
        <div><b>Example code that produces the bug:</b></div>
        <div>final MediaPlayer mediaPlayer = new MediaPlayer(new
          Media(getClass().getResource("/path/to/file.mp3").toExternalForm()));<br>
          <br>
          <b>Extra:</b><br>
          I've made a free MP3 file available to try with here (royalty
          free):<br>
          <a href="https://codedead.com/static.mp3" moz-do-not-send="true" class="moz-txt-link-freetext">https://codedead.com/static.mp3</a><br>
          <br>
          I've also got a GIT repository in which the exception occurs
          immediately when running the Gradle task 'application':<br>
          <a href="https://github.com/CodeDead/opal/tree/development" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/CodeDead/opal/tree/development</a>
          (please make sure to use the development branch as this branch
          makes use of the latest JavaFX versions)</div>
        <div><br>
          Oddly enough, it does not always happen, and loading the file
          directly from a file location instead of the project resources
          seems to work, but when loading from the resources, you get
          the exception that the media file signature is not recognized.<br>
        </div>
        <div>I don't see a problem with the media files themselves,
          encoding is all fine, at first glance and because it worked in
          JavaFX 18.0.2, creating a Media object using a URI to a
          project resources location should work in newer versions as
          well, I think. The same MP3 file does work when you load it
          from the disk instead of the project resources so this makes
          it a bug, I believe.<br>
        </div>
        <div><br>
        </div>
        <div>The work-around right now is to revert back to JavaFX
          version 18.0.2.</div>
        <div><br>
        </div>
        <div><b>System / OS / Runtime info:</b></div>
        <div>Linux Fedora 36<br>
          5.19.8-200.fc36.x86_64<br>
          openjdk version "18.0.2" 2022-07-19<br>
          OpenJDK Runtime Environment
          (Red_Hat-18.0.2.0.9-1.rolling.fc36) (build 18.0.2+9)<br>
          OpenJDK 64-Bit Server VM (Red_Hat-18.0.2.0.9-1.rolling.fc36)
          (build 18.0.2+9, mixed mode, sharing)<br>
        </div>
        <div>
          <div><br>
          </div>
          <div>Thank you and kind regards</div>
          <div><br>
          </div>
          <div>Alessandro Mercier</div>
          -- <br>
          <div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>CodeDead Administrator<br>
              </div>
              <div><a href="https://codedead.com/" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://codedead.com/</a></div>
              <div><br>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>