我最近升级到了fedora 21。我真的很喜欢它,但是,javafx MediaPlayer 不起作用。
根据 JavaFX 系统要求站点,对于创建 MediaPlayer 的 Linux 发行版,我需要:
libavcodec53
libavformat53
我在 Fedora 存储库中找不到任何这些软件包(或者通过谷歌搜索 Fedora 21 和我还检查了对 Fedora 20 的搜索,但我设法将它们从 ATRpm 成功安装到我的系统上,并且仍然没运气。
我还安装了ffmpeg
and ffmpeg-devel
and ffmpeg-libs
,并且还转码,它仍然抛出这个异常。
如果需要,这是我的 StackTrace:
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(LauncherImpl.java:157)
at com.sun.javafx.application.LauncherImpl$$Lambda$1/791452441.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: 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:511)
at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
at brainwaveentrainment.Main.start(Main.java:22)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
at com.sun.javafx.application.LauncherImpl$$Lambda$55/632695357.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
at com.sun.javafx.application.PlatformImpl$$Lambda$51/744796612.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$53/731343915.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$52/7923443.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$45(GtkApplication.java:126)
at com.sun.glass.ui.gtk.GtkApplication$$Lambda$43/896313952.run(Unknown Source)
... 1 more
Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
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(MediaPlayer.java:467)
... 16 more
谁能指出我正确的方向,为我的 Fedora 系统找到必要的库以允许 JavaFX 成功创建 MediaPlayer 对象?
任何帮助将不胜感激。