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

Mediaplayer not working with HTTP Live Stream link with query parameter appended with file extension m3u8

XMLWordPrintable

    • x86_64
    • windows

        ADDITIONAL SYSTEM INFORMATION :
        Windows 11, Java OpenJdk 17.0.2

        A DESCRIPTION OF THE PROBLEM :
        Hi, I'm trying to play the following link:
        https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8

        It is working fine on mac and windows but issue if any link has query parameters then it will not only on windows but work fine on mac.

        The same following link is not working on windows:
        https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?s=t

        Here are logs:
        MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
        at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
        at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:519)
        at javafx.scene.media.MediaPlayer$InitMediaPlayer.run(MediaPlayer.java:533)
        at java.base/java.lang.Thread.run(Thread.java:831)
        Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
        at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:297)
        at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118)
        at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:475)

        This issue is only on windows and i will change this link by appending it.m3u8 then it will work fine


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        // issue only on windows not mac

         val mediaView = MediaView()
                val media =
                    Media("https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?t=s")
                val player = MediaPlayer(media)
                player.isAutoPlay = true
                mediaView.mediaPlayer = player

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8
        https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?t=s

        Both links should work but the second link is not working.
        ACTUAL -
        Getting following crash if query append with link:
        MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
        at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
        at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:519)
        at javafx.scene.media.MediaPlayer$InitMediaPlayer.run(MediaPlayer.java:533)
        at java.base/java.lang.Thread.run(Thread.java:831)
        Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
        at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:297)
        at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118)
        at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:475)

        ---------- BEGIN SOURCE ----------
        // issue only on windows not mac

         val mediaView = MediaView()
                val media =
                    Media("https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?t=s")
                val player = MediaPlayer(media)
                player.isAutoPlay = true
                mediaView.mediaPlayer = player
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Change link from this
        https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?t=s
        to this
        https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?t=s&s=.m3u8
        Or remove query parameters

        FREQUENCY : always


          1. MediaExample.java
            1 kB
            Praveen Narayanaswamy

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

                Created:
                Updated:
                Resolved: