Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 21583)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 21584)
@@ -18,4 +18,5 @@
 	private List<WayPoint> ls;
 	private WayPoint prev,curr,next;
+	private WayPoint start;
 	
 
@@ -35,4 +36,5 @@
 		super();
 		this.ls = l;
+		start=ls.get(0);
 		prev=null;
 		curr=ls.get(0);
@@ -78,5 +80,4 @@
 			}
 			else next=null;
-			
 		}
 	}
@@ -86,5 +87,5 @@
 		if ((ls.indexOf(curr)+t>0)&&(ls.indexOf(curr)<ls.size()))
 		{
-			jump(ls.get(ls.indexOf(curr)+t));
+			jump(ls.get(ls.indexOf(curr)+t)); //FIXME here is a bug
 		}		
 	}
@@ -280,9 +281,14 @@
 	}
 
-	public void pause() {
-		// TODO Auto-generated method stub
-		
-	}
-	
+	public long getRelativeTime()
+	{
+		return curr.getTime().getTime()-start.getTime().getTime(); //TODO assumes timeintervall is constant!!!!
+	}
+
+	//jumps to a speciffic time
+	public void jump(long relTime) {
+		jump(relTime/1000);		//TODO ugly quick hack	
+		
+	}
 	
 }
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 21583)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 21584)
@@ -49,5 +49,5 @@
 public class PositionLayer extends Layer implements MouseListener,MouseMotionListener, KeyListener {
 	private List<WayPoint> ls;
-	private GpsPlayer l;
+	public GpsPlayer l;
 	private Collection<WayPoint> selected;
 	private Timer t;
@@ -67,50 +67,8 @@
 		df = new SimpleDateFormat("hh:mm:ss:S");
 		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);
-		addKeys();								
-		
-	}
-
-	//add key bindings for navigate through the track (and if synced trough the video, too)
-	private void addKeys() {
-		Action backward = new AbstractAction() {
-			public void actionPerformed(ActionEvent e) {
-				if(l!=null)l.prev();
-				Main.map.mapView.repaint();
-			}};
-			
-		Action forward = new AbstractAction() {
-			public void actionPerformed(ActionEvent e) {
-				if(l!=null)l.next();
-				Main.map.mapView.repaint();
-			}};
-		Action startStop = new AbstractAction() {
-			public void actionPerformed(ActionEvent e) {
-				if (t==null)
-				{
-					//start
-					t= new Timer();
-					TimerTask ani=new TimerTask() {			
-						@Override
-						//some cheap animation stuff
-						public void run() {				
-							l.next();
-							Main.map.mapView.repaint();
-						}
-					};
-					t.schedule(ani,500,500);
-				}
-				else
-				{
-					//stop
-					t.cancel();
-					t=null;					
-				}
-			}};
-		//TODO custome Shortkey management
-		Main.registerActionShortcut(backward, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));
-		Main.registerActionShortcut(forward, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
-		//Main.registerActionShortcut(startStop, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0));
-	}
+		Main.map.mapView.addMouseMotionListener(this);							
+		
+	}
+
 
 	@Override
@@ -215,8 +173,165 @@
 			if (l.getCurr()!=null){
 			p=Main.map.mapView.getPoint(l.getCurr().getEastNorth());
-			icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);			
-			g.drawString(df.format(l.getCurr().getTime()),p.x,p.y);
-			}
-		}
+			icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);
+			SimpleDateFormat ms=new SimpleDateFormat("mm:ss");
+			g.drawString(ms.format(l.getRelativeTime()),p.x,p.y);
+			}
+		}
+	}
+	
+	private void markNearestWayPoints(Point mouse) {
+		final int MAX=10; 
+		Point p;		
+		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
+		//iterate through all possible notes
+		for(WayPoint n : ls)
+		{
+			p = Main.map.mapView.getPoint(n.getEastNorth());
+			if (rect.contains(p))
+			{				
+				selected.add(n);
+			}
+			
+		}	
+	}
+	
+	private WayPoint getNearestWayPoint(Point mouse)
+	{
+		final int MAX=10;
+		Point p;
+		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
+		//iterate through all possible notes
+		for(WayPoint n : ls) //TODO this is not very clever, what better way to find this WP?
+		{
+			p = Main.map.mapView.getPoint(n.getEastNorth());
+			if (rect.contains(p))
+			{				
+				return n;
+			}
+			
+		}
+		return null;
+		
+	}
+	
+	@Override
+	public void visitBoundingBox(BoundingXYVisitor arg0) {
+		// TODO dunno what to do here
+
+	}
+
+	//mark selected points
+	public void mouseClicked(MouseEvent e) {		
+	}
+
+	public void mouseEntered(MouseEvent arg0) {	
+	}
+
+	public void mouseExited(MouseEvent arg0) {
+	}
+
+	public void mousePressed(MouseEvent e) {
+		if(e.getButton() == MouseEvent.BUTTON1) {
+			//is it on the cam icon?
+			if (l.getCurr()!=null)
+			{
+				if (getIconRect().contains(e.getPoint()))
+				{
+					mouse=e.getPoint();
+					dragIcon=true;
+					//ani.cancel();
+				}
+			}
+		}
+		
+	}
+
+	public void mouseReleased(MouseEvent e) {
+		
+		//only on leftclicks of our layer
+		if(e.getButton() == MouseEvent.BUTTON1) {
+			if(dragIcon)
+			{
+				dragIcon=false;
+			}
+			else
+			{
+				//JOptionPane.showMessageDialog(Main.parent,"test");
+				markNearestWayPoints(e.getPoint());
+				WayPoint wp = getNearestWayPoint(e.getPoint());
+				if(wp!=null)
+				{
+					l.jump(wp);			
+				}
+			}
+			Main.map.mapView.repaint();
+		}
+		
+	}
+	
+	
+	public void mouseDragged(MouseEvent e) {		
+		if(dragIcon)
+		{			
+			mouse=e.getPoint();
+			//restrict to GPS track
+			iconPosition=l.getInterpolatedWaypoint(mouse);
+
+			Main.map.mapView.repaint();
+		}
+	}
+
+	private Rectangle getIconRect()
+	{
+		Point p = Main.map.mapView.getPoint(l.getCurr().getEastNorth());
+		return new Rectangle(p.x-icon.getIconWidth()/2,p.y-icon.getIconHeight()/2,icon.getIconWidth(),icon.getIconHeight());
+	}
+	
+	public void mouseMoved(MouseEvent e) {		
+		
+		if (l.getCurr()!=null)
+		{						
+			if (getIconRect().contains(e.getPoint()))
+			{
+				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+			}
+			else
+			{
+				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+			}
+		}
+		
+	}
+
+	public void keyPressed(KeyEvent e) {
+		int i;
+		System.out.println(e.getKeyCode());
+		switch(e.getKeyCode())
+		{
+			case KeyEvent.VK_RIGHT:
+				{
+					l.jump(1);
+				};break;
+			case KeyEvent.VK_LEFT:
+			{
+				l.jump(-1);
+
+			};break;
+			case KeyEvent.VK_SPACE:
+			{
+				ani.cancel();
+			}
+		}
+		
+	}
+
+	public void keyReleased(KeyEvent e) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void keyTyped(KeyEvent e) {
+		// TODO Auto-generated method stub
+		
 	}
 	
@@ -236,4 +351,6 @@
 			};
 			t.schedule(ani,500,500);
+			//and video
+			
 		}
 		else
@@ -245,159 +362,20 @@
 	}
 
-	private void markNearestWayPoints(Point mouse) {
-		final int MAX=10; 
-		Point p;		
-		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
-		//iterate through all possible notes
-		for(WayPoint n : ls)
-		{
-			p = Main.map.mapView.getPoint(n.getEastNorth());
-			if (rect.contains(p))
-			{				
-				selected.add(n);
-			}
-			
-		}	
-	}
-	
-	private WayPoint getNearestWayPoint(Point mouse)
-	{
-		final int MAX=10;
-		Point p;
-		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
-		//iterate through all possible notes
-		for(WayPoint n : ls) //TODO this is not very clever, what better way to find this WP?
-		{
-			p = Main.map.mapView.getPoint(n.getEastNorth());
-			if (rect.contains(p))
-			{				
-				return n;
-			}
-			
-		}
-		return null;
-		
-	}
-	
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor arg0) {
-		// TODO dunno what to do here
-
-	}
-
-	//mark selected points
-	public void mouseClicked(MouseEvent e) {		
-	}
-
-	public void mouseEntered(MouseEvent arg0) {	
-	}
-
-	public void mouseExited(MouseEvent arg0) {
-	}
-
-	public void mousePressed(MouseEvent e) {
-		if(e.getButton() == MouseEvent.BUTTON1) {
-			//is it on the cam icon?
-			if (l.getCurr()!=null)
-			{
-				if (getIconRect().contains(e.getPoint()))
-				{
-					mouse=e.getPoint();
-					dragIcon=true;
-					//ani.cancel();
-				}
-			}
-		}
-		
-	}
-
-	public void mouseReleased(MouseEvent e) {
-		
-		//only on leftclicks of our layer
-		if(e.getButton() == MouseEvent.BUTTON1) {
-			if(dragIcon)
-			{
-				dragIcon=false;
-			}
-			else
-			{
-				//JOptionPane.showMessageDialog(Main.parent,"test");
-				markNearestWayPoints(e.getPoint());
-				WayPoint wp = getNearestWayPoint(e.getPoint());
-				if(wp!=null)
-				{
-					l.jump(wp);			
-				}
-			}
-			Main.map.mapView.repaint();
-		}
-		
-	}
-	
-	
-	public void mouseDragged(MouseEvent e) {		
-		if(dragIcon)
-		{			
-			mouse=e.getPoint();
-			//restrict to GPS track
-			iconPosition=l.getInterpolatedWaypoint(mouse);
-
-			Main.map.mapView.repaint();
-		}
-	}
-
-	private Rectangle getIconRect()
-	{
-		Point p = Main.map.mapView.getPoint(l.getCurr().getEastNorth());
-		return new Rectangle(p.x-icon.getIconWidth()/2,p.y-icon.getIconHeight()/2,icon.getIconWidth(),icon.getIconHeight());
-	}
-	
-	public void mouseMoved(MouseEvent e) {		
-		
-		if (l.getCurr()!=null)
-		{						
-			if (getIconRect().contains(e.getPoint()))
-			{
-				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-			}
-			else
-			{
-				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-			}
-		}
-		
-	}
-
-	public void keyPressed(KeyEvent e) {
-		int i;
-		System.out.println(e.getKeyCode());
-		switch(e.getKeyCode())
-		{
-			case KeyEvent.VK_RIGHT:
-				{
-					l.jump(1);
-				};break;
-			case KeyEvent.VK_LEFT:
-			{
-				l.jump(-1);
-
-			};break;
-			case KeyEvent.VK_SPACE:
-			{
-				ani.cancel();
-			}
-		}
-		
-	}
-
-	public void keyReleased(KeyEvent e) {
+
+	public void backward() {
+		if(l!=null)l.prev();
+		Main.map.mapView.repaint();
+	}
+	
+	public void forward() {
+		if(l!=null)l.next();
+		Main.map.mapView.repaint();
+	}
+
+
+	public void loop() {
 		// TODO Auto-generated method stub
 		
 	}
 
-	public void keyTyped(KeyEvent e) {
-		// TODO Auto-generated method stub
-		
-	}
-
 }
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 21583)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 21584)
@@ -4,4 +4,8 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.io.File;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
 
 import javax.swing.JMenu;
@@ -11,9 +15,12 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.plugins.*;
-import org.openstreetmap.josm.plugins.videomapping.actions.StartStopAction;
-import org.openstreetmap.josm.plugins.videomapping.actions.VideoAddAction;
+import org.openstreetmap.josm.plugins.videomapping.video.GPSVideoPlayer;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.gpx.GpxData;
+import org.openstreetmap.josm.data.gpx.GpxTrack;
+import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
+import org.openstreetmap.josm.data.gpx.WayPoint;
 import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.gui.MapFrame;
@@ -33,6 +40,8 @@
 	  private JMenu VMenu;
 	  private GpxData GPSTrack;
-	  private VideoAddAction VAdd;
-	  private StartStopAction VStart;
+	  private List<WayPoint> ls;
+	  private JosmAction VAdd,VStart,Vbackward,Vforward,Vloop;
+	  private GPSVideoPlayer video;
+	private PositionLayer layer;
 	  
 
@@ -53,5 +62,4 @@
 			VAdd.setEnabled(true);
 			GPSTrack=((GpxLayer) newLayer).data;			
-			VAdd.setGps(GPSTrack);
 			//TODO append to GPS Layer menu
 		}
@@ -78,21 +86,84 @@
 	} //well ok we have a local copy of the GPS track....
 
+	//register main controls
 	private void addMenuItems() {
-		VAdd= new VideoAddAction(this);
-		VStart = new StartStopAction();
+		VAdd= new JosmAction("Sync Video","videomapping","Sync a video against this GPS track",null,false) {
+
+			/**
+			 * 
+			 */
+			private static final long serialVersionUID = 1L;
+
+			public void actionPerformed(ActionEvent arg0) {
+				copyGPSLayer();
+				layer = new PositionLayer("test",ls);
+				Main.main.addLayer(layer);
+				enableControlMenus(true);
+				video = new GPSVideoPlayer(new File("C:\\temp\\test.mpg"), layer.l);
+			}
+		};
+		VStart = new JosmAction("play/pause", "audio-playpause", "starts/pauses video playback",
+				Shortcut.registerShortcut("videomapping:startstop","",KeyEvent.VK_SPACE, Shortcut.GROUP_MENU), false) {
+			
+			public void actionPerformed(ActionEvent e) {								
+				video.play();				
+				video.jump(605000);
+				layer.l.jump(9*60+20);
+				layer.pause();
+			}
+		};
+		Vbackward = new JosmAction("backward", "audio-prev", "jumps n sec back",
+				Shortcut.registerShortcut("videomapping:backward","",KeyEvent.VK_NUMPAD4, Shortcut.GROUP_MENU), false) {
+			
+			public void actionPerformed(ActionEvent e) {
+				layer.backward();
+							
+			}
+		};
+		Vforward= new JosmAction("forward", "audio-next", "jumps n sec forward",
+				Shortcut.registerShortcut("videomapping:forward","",KeyEvent.VK_NUMPAD6, Shortcut.GROUP_MENU), false) {
+			
+			public void actionPerformed(ActionEvent e) {
+				layer.forward();
+							
+			}
+		};
+		Vloop= new JosmAction("loop", "clock", "loops n sec around current position",
+				Shortcut.registerShortcut("videomapping:loop","",KeyEvent.VK_NUMPAD5, Shortcut.GROUP_MENU), false) {
+			
+			public void actionPerformed(ActionEvent e) {
+				layer.loop();
+							
+			}
+		};
 		VMenu.add(VAdd);
 		enableControlMenus(false);
 		VMenu.add(VStart);
+		VMenu.add(Vbackward);
+		VMenu.add(Vforward);
+		VMenu.add(Vloop);
 	}
 	
-	public void setMyLayer(PositionLayer layer)
-	{		
-		VStart.setLayer(layer);
-		enableControlMenus(true);
-	}
 	
+	
+	//we can only move on our layer
 	private void enableControlMenus(boolean enabled)
 	{
 		VStart.setEnabled(enabled);
+		Vbackward.setEnabled(enabled);
+		Vforward.setEnabled(enabled);
+		Vloop.setEnabled(enabled);
+	}
+	
+	//make a flat copy
+	private void copyGPSLayer()
+	{ 
+		ls = new LinkedList<WayPoint>();
+        for (GpxTrack trk : GPSTrack.tracks) {
+            for (GpxTrackSegment segment : trk.getSegments()) {
+                ls.addAll(segment.getWayPoints());
+            }
+        }
+        Collections.sort(ls); //sort basing upon time
 	}
   }
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java	(revision 21584)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java	(revision 21584)
@@ -0,0 +1,13 @@
+package org.openstreetmap.josm.plugins.videomapping.video;
+import java.io.File;
+
+// a specific synced video
+public class GPSVideoFile extends File{
+	public long offset;
+	
+	public GPSVideoFile(File f, long offset) {
+		super(f.getAbsoluteFile().toString());
+		this.offset=offset;
+	}
+
+}
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 21584)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 21584)
@@ -0,0 +1,32 @@
+package org.openstreetmap.josm.plugins.videomapping.video;
+import java.io.File;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.openstreetmap.josm.plugins.videomapping.GpsPlayer;
+
+
+public class GPSVideoPlayer extends SimpleVideoPlayer{
+	Timer t;
+	TimerTask syncGPSTrack;
+	private GpsPlayer pl;
+	private GPSVideoFile file;
+
+	public GPSVideoPlayer(File f, final GpsPlayer pl) {
+		super();
+		this.pl = pl;
+		this.file = new GPSVideoFile(f, (long)0);//10,05
+		setFile(file.getAbsoluteFile());
+		t = new Timer();
+		syncGPSTrack= new TimerTask() {
+			
+			@Override
+			public void run() {
+				pl.next();
+				//pl.jump(file.offset+)
+				
+			}
+		};
+		//t.schedule(syncGPSTrack, 1000, 1000);
+	}
+}
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java	(revision 21584)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java	(revision 21584)
@@ -0,0 +1,333 @@
+package org.openstreetmap.josm.plugins.videomapping.video;
+import java.awt.Adjustable;
+import org.apache.log4j.Logger;
+
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+
+import javax.swing.Action;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+import javax.swing.JToggleButton;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.openstreetmap.josm.Main;
+
+import uk.co.caprica.vlcj.binding.LibVlc;
+import uk.co.caprica.vlcj.check.EnvironmentCheckerFactory;
+import uk.co.caprica.vlcj.player.DefaultFullScreenStrategy;
+import uk.co.caprica.vlcj.player.FullScreenStrategy;
+import uk.co.caprica.vlcj.player.MediaPlayer;
+import uk.co.caprica.vlcj.player.MediaPlayerEventAdapter;
+import uk.co.caprica.vlcj.player.MediaPlayerEventListener;
+import uk.co.caprica.vlcj.player.MediaPlayerFactory;
+import uk.co.caprica.vlcj.player.VideoMetaData;
+
+//basic class of a videoplayer for one video
+public class SimpleVideoPlayer extends JFrame implements MediaPlayerEventListener, WindowListener{
+	private MediaPlayer mp;
+	private Timer t;
+	private JPanel screenPanel,controlsPanel;
+	private JSlider timeline;
+	private JButton play,back,forward;
+	private JToggleButton loop;
+	private JSlider speed;
+	private Canvas scr;
+	private final String[] mediaOptions = {""};
+	private boolean syncTimeline=false;
+	private SimpleDateFormat df;
+	private static final Logger LOG = Logger.getLogger(SimpleVideoPlayer.class);
+	
+	public SimpleVideoPlayer() {
+		super();
+		/*TODO new EnvironmentCheckerFactory().newEnvironmentChecker().checkEnvironment();
+		 * if(RuntimeUtil.isWindows()) {
+	  			vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
+			}
+		 */
+		try
+		{			
+			String[] libvlcArgs = {""};
+			String[] standardMediaOptions = {""}; 
+			
+			System.out.println("libvlc version: " + LibVlc.INSTANCE.libvlc_get_version());
+			//setup Media Player
+			//TODO we have to deal with unloading things....
+			MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs);
+		    FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(this);
+		    mp = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
+		    mp.setStandardMediaOptions(standardMediaOptions);
+		    //setup GUI
+		    setSize(400, 300);
+		    df = new SimpleDateFormat("hh:mm:ss:S");
+		    scr=new Canvas();
+		    timeline = new JSlider(0,100,0);
+		    play= new JButton("play");
+		    back= new JButton("<");
+		    forward= new JButton(">");
+		    loop= new JToggleButton("loop");
+		    speed = new JSlider(0,2,1);
+			speed.setPaintTicks(true);
+			speed.setMajorTickSpacing(5);
+			speed.setOrientation(Adjustable.VERTICAL);
+		    setLayout();
+			addListeners();
+		    //embed vlc player
+			scr.setVisible(true);
+			setVisible(true);
+			mp.setVideoSurface(scr);
+			mp.addMediaPlayerEventListener(this);
+			mp.pause();
+			jump(0);
+			//set updater
+			ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
+			executorService.scheduleAtFixedRate(new Syncer(this), 0L, 500L, TimeUnit.MILLISECONDS);
+		    //setDefaultCloseOperation(EXIT_ON_CLOSE);
+			addWindowListener(this);
+		}
+		catch (NoClassDefFoundError e)
+		{
+			System.err.println("Unable to find JNA Java library!");
+		}
+		catch (UnsatisfiedLinkError e)
+		{
+			System.err.println("Unable to find native libvlc library!");
+		}
+		
+	}
+	
+	//creates a layout like the most mediaplayers are...
+	private void setLayout() {
+		this.setLayout(new BorderLayout());
+		screenPanel=new JPanel();
+		screenPanel.setLayout(new BorderLayout());
+		controlsPanel=new JPanel();
+		controlsPanel.setLayout(new FlowLayout());
+		add(screenPanel,BorderLayout.CENTER);
+		add(controlsPanel,BorderLayout.SOUTH);
+		//fill screen panel
+		screenPanel.add(scr,BorderLayout.CENTER);
+		screenPanel.add(timeline,BorderLayout.SOUTH);
+		screenPanel.add(speed,BorderLayout.EAST);
+		controlsPanel.add(play);
+		controlsPanel.add(back);
+		controlsPanel.add(forward);
+		controlsPanel.add(loop);
+		loop.setSelected(false);
+	}
+
+	//add UI functionality
+	private void addListeners() {
+		final float JUMP_LENGTH=1000;
+		final int  LOOP_LENGTH=6000;
+		timeline.addChangeListener(new ChangeListener() {
+			public void stateChanged(ChangeEvent e) {
+				if(!syncTimeline) //only if user moves the slider by hand
+				{
+					if(!timeline.getValueIsAdjusting()) //and the slider is fixed
+					{
+						//recalc to 0.x percent value
+						mp.setPosition((float)timeline.getValue()/100.0f);
+					}					
+				}
+			}
+		    });
+		
+		play.addActionListener(new ActionListener() {
+			
+			public void actionPerformed(ActionEvent arg0) {
+				if(mp.isPlaying()) mp.stop(); else mp.play();				
+			}
+		});
+		
+		back.addActionListener(new ActionListener() {
+			
+			public void actionPerformed(ActionEvent arg0) {
+				mp.setTime((long) (mp.getTime()-JUMP_LENGTH));
+				//jump(600000); //10,05
+				
+			}
+		});
+		
+		forward.addActionListener(new ActionListener() {
+			
+			public void actionPerformed(ActionEvent arg0) {
+				mp.setTime((long) (mp.getTime()+JUMP_LENGTH));
+				
+			}
+		});
+		
+		loop.addActionListener(new ActionListener() {
+
+			public void actionPerformed(ActionEvent arg0) {
+			if(!loop.isSelected())
+			{
+				t.cancel();
+			}
+			else			
+			{
+				final long resetpoint=(long) mp.getTime()-LOOP_LENGTH/2;
+				TimerTask ani=new TimerTask() {
+					
+					@Override
+					public void run() {
+						mp.setTime(resetpoint);
+					}
+				};
+				t= new Timer();
+				t.schedule(ani,LOOP_LENGTH/2,LOOP_LENGTH); //first run a half looptime till reset	
+				}
+			}
+		});
+		
+		speed.addChangeListener(new ChangeListener() {
+			
+			public void stateChanged(ChangeEvent arg0) {
+				// TODO change playback speed
+				
+			}
+		});
+		
+	}
+
+	public void finished(MediaPlayer arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void lengthChanged(MediaPlayer arg0, long arg1) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void metaDataAvailable(MediaPlayer arg0, VideoMetaData arg1) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void paused(MediaPlayer arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void playing(MediaPlayer arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void positionChanged(MediaPlayer arg0, float arg1) {
+		
+	}
+
+	public void stopped(MediaPlayer arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void timeChanged(MediaPlayer arg0, long arg1) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+
+	public void windowActivated(WindowEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void windowClosed(WindowEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	//we have to unload and disconnect to the VLC engine
+	public void windowClosing(WindowEvent evt) {
+        if(LOG.isDebugEnabled()) {LOG.debug("windowClosing(evt=" + evt + ")");}
+        mp.release();
+        mp = null;
+        System.exit(0);
+      }
+
+	public void windowDeactivated(WindowEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void windowDeiconified(WindowEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void windowIconified(WindowEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void windowOpened(WindowEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}	
+	
+	public void setFile(File f)
+	{
+		String mediaPath = f.getAbsoluteFile().toString();
+		mp.playMedia(mediaPath, mediaOptions);
+		jump(8000);
+		jump(0);
+		mp.stop();
+		pack();
+	}
+	
+	public void play()
+	{
+		mp.play();
+	}
+	
+	public void jump(long time)
+	{
+		/*float pos = (float)mp.getLength()/(float)time;
+		mp.setPosition(pos);*/
+		mp.setTime(time);
+	}
+	
+	public long getTime()
+	{
+		return mp.getTime();
+	}
+	
+	public float getPosition()
+	{
+		return mp.getPosition();
+	}
+	
+	//gets called by the Syncer to update all components
+	public void updateTime ()
+	{
+		if(mp.isPlaying())
+		{
+			setTitle(df.format(new Date(mp.getTime()))+" "+mp.getTime());
+			syncTimeline=true;
+			timeline.setValue(Math.round(mp.getPosition()*100));
+			syncTimeline=false;
+		}
+	}
+	
+
+}
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java	(revision 21584)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java	(revision 21584)
@@ -0,0 +1,26 @@
+package org.openstreetmap.josm.plugins.videomapping.video;
+
+import javax.swing.SwingUtilities;
+
+import uk.co.caprica.vlcj.player.MediaPlayer;
+
+//Syncs all UI components to the playback using the SWING thread
+final class Syncer implements Runnable {
+
+    private final SimpleVideoPlayer pl;
+    
+    Syncer(SimpleVideoPlayer pl) {
+      this.pl = pl;
+    }
+    
+
+    public void run() {
+      SwingUtilities.invokeLater(new Runnable() {
+    	  //here we update
+        public void run() {
+        	pl.updateTime();
+
+        }
+      });
+    }
+  }
