la lecture de la vidéo à l'aide de jmf

Je suis en train de lire un fichier vidéo à l'aide de JMF, mais il me donne No Media Player found exception.

Voici mon code, quelqu'un peut-il me dire ce que je fais de mal ici?

public class MediaPanel extends JPanel {
public MediaPanel(URL mediaURL) {
setLayout(new BorderLayout());
try {
Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, true);
Player mediaPlayer = Manager.createRealizedPlayer(mediaURL);
Component video = mediaPlayer.getVisualComponent();
Component controls = mediaPlayer.getControlPanelComponent();
if (video != null)
add(video, BorderLayout.CENTER);
if (controls != null)
add(controls, BorderLayout.SOUTH);
mediaPlayer.start();
} catch (NoPlayerException noPlayerException) {
System.err.println("No media player found");
} //end catch
catch (CannotRealizeException cannotRealizeException) {
System.err.println("Could not realize media player");
} //end catch
catch (IOException iOException) {
System.err.println("Error reading from the source");
}
}
}
public class MediaTest {
public static void main(String args[]) {
//create a file chooser
JFileChooser fileChooser = new JFileChooser();
//show open file dialog
int result = fileChooser.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION) //user chose a file
{
URL mediaURL = null;
Player mediaPlayer = null;
try {
//get the file as URL 
mediaURL = fileChooser.getSelectedFile().toURL();
} catch (MalformedURLException malformedURLException) {
System.err.println("Could not create URL for the file");
}
if (mediaURL != null) {
JFrame mediaTest = new JFrame("Media Tester");
mediaTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
MediaPanel mediaPanel = new MediaPanel(mediaURL);
mediaTest.add(mediaPanel);
mediaTest.setSize(300, 300);
mediaTest.setVisible(true);
}
}
}
}

L'exception que je reçois est No media player found

InformationsquelleAutor Ruby | 2012-06-19