package com.salcedo.rapbot.keyboard;

import akka.actor.ActorRef;
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;
import uk.co.caprica.vlcj.player.media.callback.seekable.RandomAccessFileMedia;

import javax.swing.*;
import java.awt.*;
import java.net.MalformedURLException;
import java.net.URL;

public class KeyEventSource implements EventSource {
    @Override
    public void listen(ActorRef actor) {
        JFrame frame = new JFrame("RapBot");
        EmbeddedMediaPlayerComponent mediaPlayerComponent = new EmbeddedMediaPlayerComponent();

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.addKeyListener(new KeyEventForwarder(actor));
        frame.setBounds(100, 100, 600, 400);
        frame.setContentPane(mediaPlayerComponent);
        frame.setVisible(true);

        mediaPlayerComponent.getMediaPlayer().playMedia("http://192.168.1.41:3001/stream.mjpg");
    }
}

@@ -129,188 +129,29 @@
 nt;%0A
-import uk.co.caprica.vlcj.player.media.callback.seekable.RandomAccessFileMedia;%0A%0Aimport javax.swing.*;%0Aimport java.awt.*;%0Aimport java.net.MalformedURLException;%0Aimport java.net.URL
+%0Aimport javax.swing.*
 ;%0A%0Ap
@@ -560,14 +560,14 @@
 0, 6
-0
+4
 0, 4
-0
+8
 0);%0A

Set correct size for window.