Play a video using JavaFX on Raspberry Pi

╄→гoц情女王★ 提交于 2019-11-29 15:11:16

WebView and Media were never part of the JavaFX ARM distribution, but Gluon recently added it to the embedded SDK that can be downloaded from here and installed with a recent JDK for ARM, available here.

Media requires a few extra steps as it depends in the native drivers that usually are not fully installed on a regular Jessie distribution.

First install these drivers:

sudo apt-get install gstreamer0.10-plugins-good
sudo apt-get install gstreamer0.10-plugins-bad 

Now edit /etc/apt/sources.list and add at the end:

deb http://ftp.uk.debian.org/debian/ wheezy main
deb-src http://ftp.uk.debian.org/debian/ wheezy main

Save the file (Ctrl+O, Ctrl+X).

Finally update and install the drivers:

sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-alsa

Now you can try to run again your JavaFX application.

If you find again the same exception (MediaException: UNKNOWN), check if it shows this message: Error in GstPipelineFactory, notice the driver that is missing, and try to install it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!