I have created a player where it plays a specific file, the problem is the file does't play i'm getting the error of
"Got exception javax.media.NoPlayerException: Cannot find a Player for :P.mp4 " Here's the code
Java Code:
import javax.media.*;
import javax.swing.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

public class Vid extends JFrame
	Player _player;
	JFileChooser fileChooser;
		addWindowListener( new WindowAdapter(){
			public void windowClosing( WindowEvent e)
				System.exit( 0 );
		setBounds( 0, 0, 320, 260 );
		JPanel panel = (JPanel)getContentPane();
		panel.setLayout(new BorderLayout() );
		String mediaFile = "P.mp4";

			MediaLocator mlr = new MediaLocator(mediaFile );
			_player = Manager.createRealizedPlayer(mlr);
			if (_player.getVisualComponent() !=null)
			panel.add("Center", _player.getVisualComponent());
			if(_player.getControlPanelComponent() != null)
			panel.add("South", _player.getControlPanelComponent());
		catch (Exception e){
			System.err.println( "Got exception " + e );


	public static void main(String[] args) {
		Vid v = new Vid();