public MediaEditor() {
		super("Video Player");

		mediaPlayerComponent = new EmbeddedMediaPlayerComponent();

		// setContentPane(screen);
		setLocation(250,150);
		setSize(1150, 730);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setVisible(true);

		panel = new JPanel();
		panel.setLayout(new BorderLayout());
		panel.add(mediaPlayerComponent);

		panel1 = new JPanel(new BorderLayout());

		panel4 = new JPanel(new BorderLayout());
		panel1.add(panel4, BorderLayout.CENTER);
		time = new JLabel("Time: 00:00:00");
		time.setPreferredSize(new Dimension(100, 20));
		panel4.add(time,BorderLayout.WEST);
		move = new JSlider();
		move.setValue(0);
		move.setPreferredSize(new Dimension(this.getWidth() - 370, 20));
		panel4.add(move);
		// panel1.add(move,BorderLayout.CENTER);

		panel2 = new JPanel(new BorderLayout());
		panel3 = new JPanel();
		openfile = new JButton("Open file");
		panel3.add(openfile);

		backward = new JButton("<|");
		panel3.add(backward);

		stop = new JButton(">");
		panel3.add(stop);

		forward = new JButton("|>");
		panel3.add(forward);
		panel2.add(panel3, BorderLayout.CENTER);

		panel5 = new JPanel();
		mute = new JButton("Mute");
		panel5.add(mute);
		voice = new JSlider();
		voice.setPreferredSize(new Dimension(120, 20));
		panel5.add(voice);
		edit = new JButton("Edit");
		edit.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				if (editor.isVisible()) {
					editor.setVisible(false);
				} else {
					editor.setVisible(true);
					editor.getVideo(videoFile);
					
				}
			}

		});
		panel5.add(edit);
		panel2.add(panel5, BorderLayout.EAST);

		panel1.add(panel2, BorderLayout.SOUTH);
		panel.add(panel1, BorderLayout.SOUTH);

		editor = new Editor();
		// editor.setBackground(Color.pink);
		editor.setPreferredSize(new Dimension(230, panel.getHeight()));
		panel.add(editor, BorderLayout.EAST);
		editor.setVisible(false);

		add(panel);
		setContentPane(panel);
		addFile();
		stop();
		forward();
		backward();

		setVolume();
		setMove();

		ticker = new Timer(1000, new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				
				int t = (int) video.getTime() / 1000;
				int hours = t / 3600;
				int minutes = t / 60 - 60 * hours;
				int seconds = (t % 3600) % 60;
				String m = Integer.toString(minutes), s = Integer
						.toString(seconds);
				;
				if (minutes < 10) {
					m = "0" + Integer.toString(minutes);
				}
				if (seconds < 10) {
					s = "0" + Integer.toString(seconds);
				}
				time.setText("Time: 0" + hours + ":" + m + ":" + s);

				int time = (int) video.getTime();
				move.setMaximum((int) video.getLength());
				move.setValue(time);
				
				if((int)video.getLength()==move.getValue()){
					if (speedup != null) {
						speedup.cancel(true);
						speedup = null;
						video.play();
						stop.setLabel("||");
					}
				}
				
				if(move.getValue()==0){
					if (speeddown != null) {
						speeddown.cancel(true);
						speeddown = null;
						video.play();
						stop.setLabel("||");
					}
				}

			}
		});

		// JButton addText = new JButton("Add Text at the start");
		// addText.addActionListener(new ActionListener() {
		// public void actionPerformed(ActionEvent e) {
		// String cmd =
		// "avconv -i input.avi -vf drawtext=fontcolor=white:fontsize=30:fontfile=/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-L.ttf:text='$date':x=30:y=h-text_h-30 ";
		// cmd = cmd + mp3;
		//
		// ProcessBuilder downBuilder = new ProcessBuilder("/bin/bash",
		// "-c", cmd);
		//
		// Process process;
		// try {
		// process = downBuilder.start();
		// int exit = process.waitFor();
		// } catch (IOException e1) {
		// // TODO Auto-generated catch block
		// e1.printStackTrace();
		// } catch (InterruptedException e1) {
		// // TODO Auto-generated catch block
		// e1.printStackTrace();
		// }
		//
		// }
		// });
		// panel2.add(addText, BorderLayout.WEST);

	}