Search code examples
media-playerjavafx-2

JavaFX : MEDIA_UNSUPPORTED : media type not supported


When I try playing .mov file within my application I get the following error :

MediaException: MEDIA_UNSUPPORTED : media type not supported (file:///C:/videos/start.mov)

JavaFX Verion : 2.1

IDE : Netbeans 7.2

Platform : Windows XP.

Any idea about this.


Solution

  • The Media you are trying to play is unsupported for playback in JavaFX, you need to convert it to a different type.


    For JavaFX 2.2, has a limited number of supported media types and encodings. You will notice that .mov is not a supported container format for JavaFX. It doesn't matter that Windows Media Player or other software on the machine can play it back - the format needs to be explicitly supported by JavaFX for it to work.

    Additionally, on platforms like WindowsXP, additional external codecs are required to be installed on the system for playback of some formats (like MP4).


    So what you need to do to be able to playback the video using JavaFX is re-encode it in a format which JavaFX is able to playback. If you want to allow the playback on XP without installing extra codecs, then you can use a VP6 encoding in an FLV container. You can (probably) convert your file to this format using Wildform's encoding software. Or you could re-encode to MP4 if you don't mind installing extra codecs on the client system (e.g. by installing DivX). A google search will turn up info on how to encode to H264+AAC in an MP4 container.

    Note that for OSX or Win7 no extra codecs are required for playback of H264+AAC in an MP4 container (but in any case the mov container is not supported by JavaFX on those platforms either at the moment).