I have an application that works well on Windows and Mac. I'm trying to run the application on Ubuntu / Debian, but the attempt was not successful. I found that the codecs for mp3 are problematic. For example, I made a simple code that ends with an error. Is there a solution to this problem? Thank you!
Result:
Waiting for debugger to connect...
Program started.
MediaException: MEDIA_UNSUPPORTED : [] ERROR_MEDIA_AUDIO_FORMAT_UNSUPPORTED: ERROR_MEDIA_AUDIO_FORMAT_UNSUPPORTED
at javafx.scene.media.MediaException.getMediaException(MediaException.java:160)
at javafx.scene.media.MediaPlayer$_MediaErrorListener.onError(MediaPlayer.java:2610)
at com.sun.media.jfxmediaimpl.MediaUtils.nativeError(MediaUtils.java:293)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMedia.init(GSTMedia.java:69)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMedia.<init>(GSTMedia.java:52)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMediaPlayer.<init>(GSTMediaPlayer.java:62)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTPlatform.createMediaPlayer(GSTPlatform.java:121)
at com.sun.media.jfxmediaimpl.platform.PlatformManager.createMediaPlayer(PlatformManager.java:201)
at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:222)
at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:104)
at javafx.scene.media.MediaPlayer.init(Me
diaPlayer.java:467)
at javafx.scene.media.MediaPlayer.access$1000(MediaPlayer.java:150)
at javafx.scene.media.MediaPlayer$InitMediaPlayer.run(MediaPlayer.java:525)
at java.lang.Thread.run(Thread.java:748)
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
' MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
Dim mediaPlayer As MediaPlayer
Dim url As String = "http://ol3.mp3party.net/online/3401/3401743.mp3"
mediaPlayer.Initialize("mediaPlayer", url)
mediaPlayer.Play
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Result:
Waiting for debugger to connect...
Program started.
MediaException: MEDIA_UNSUPPORTED : [] ERROR_MEDIA_AUDIO_FORMAT_UNSUPPORTED: ERROR_MEDIA_AUDIO_FORMAT_UNSUPPORTED
at javafx.scene.media.MediaException.getMediaException(MediaException.java:160)
at javafx.scene.media.MediaPlayer$_MediaErrorListener.onError(MediaPlayer.java:2610)
at com.sun.media.jfxmediaimpl.MediaUtils.nativeError(MediaUtils.java:293)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMedia.init(GSTMedia.java:69)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMedia.<init>(GSTMedia.java:52)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMediaPlayer.<init>(GSTMediaPlayer.java:62)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTPlatform.createMediaPlayer(GSTPlatform.java:121)
at com.sun.media.jfxmediaimpl.platform.PlatformManager.createMediaPlayer(PlatformManager.java:201)
at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:222)
at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:104)
at javafx.scene.media.MediaPlayer.init(Me
diaPlayer.java:467)
at javafx.scene.media.MediaPlayer.access$1000(MediaPlayer.java:150)
at javafx.scene.media.MediaPlayer$InitMediaPlayer.run(MediaPlayer.java:525)
at java.lang.Thread.run(Thread.java:748)