umair yasin
umair yasin

Reputation: 159

JavaFX : MediaException: MEDIA_UNSUPPORTED : media type not supported

I need to play the 3gp, mov and mp4 videos in the media player. Right now I am using JavaFx media player but it supports only mp4 videos. So what I can do to play the other two formats as well in this player or is there any other solution also available for this. Any help and suggestions please?

jdk = 1.7

JavaFx: 2.1

Upvotes: 0

Views: 2202

Answers (2)

Justin
Justin

Reputation: 2031

Here is a list of JavaFX supported audio and video formats.

For anything unsupported by JavaFX, you have the option of either converting them to another format or finding a way to decode them inside your application.

There are libraries available for decoding, such as JCodec or Jffmpeg

You will need to do some further research to determine your exact requirements and which formats you will need to support. Some solutions are more difficult than others.

Upvotes: 2

icza
icza

Reputation: 417452

The supported media types can be viewed on this page: Introduction to JavaFX Media

Quoting:

Video: FLV containing VP6 video and MP3 audio; MPEG-4 multimedia container with H.264/AVC (Advanced Video Coding) video compression

What you may do is convert your videos to .flc or .mp4 and you will be able to play them with JavaFX MediaPlayer.

Related StackOverflow questions:

Adding other video codecs / DVD support to JavaFX 2.2

How to play other video formats in JavaFX

Upvotes: 1

Related Questions