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

MediaPlayer.play() method stops execution by almost 2 minutes while it must be asynchronous

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • 8.0-graphics-scrum-b1894-x64

      According to the following quote of MediaPlayer javadoc, any requests to play() method are asynchronous.

      However, in AudioAreaChart sample in Ensemble8 I encountered 1 min 50 sec lag in play() (or even in setAutoPlay(true)) method when audio was not accessible due to network outage and setAudioSpectrumListener() is attached.

      "The operation of a MediaPlayer is inherently asynchronous. A player is not prepared to respond to commands quasi-immediately until its status has transitioned to MediaPlayer.Status.READY, which in effect generally occurs when media pre-roll completes. Some requests made of a player prior to its status being READY will however take effect when that status is entered. These include invoking play() without an intervening invocation of pause() or stop() before the READY transition, as well as setting any of the autoPlay, balance, mute, rate, startTime, stopTime, and volume properties."

            almatvee Alexander Matveev
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: