Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/OpenMediaPlayer.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/OpenMediaPlayer.java	(revision 3205)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/OpenMediaPlayer.java	(revision 3206)
@@ -36,6 +36,8 @@
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
@@ -79,7 +81,8 @@
 		if (o instanceof IStructuredSelection) {
 			selection = (IStructuredSelection) o;
 			Object s = selection.getFirstElement();
-			if (s instanceof File) {
+			if (s instanceof File && !((File)s).isDirectory() && !((File)s).getName().endsWith(".groovy")) {
+				
 				File f = (File) s;
 				
 				try {
@@ -138,46 +141,30 @@
 	}
 	
 	public static MediaPlayerEditor openEditor(String mrl, int time) {
-		IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
-		MediaPlayerEditorInput editorInput = new MediaPlayerEditorInput();
-		StatusLine.setMessage(MessagesMP.opening_media);
-		try {
-			MediaPlayerEditor player = (MediaPlayerEditor) page.openEditor(editorInput, MediaPlayerEditor.ID);
-			if (player != null) {
-				player.getPlayer().play(mrl, time);
-				StatusLine.setMessage("");
-				if (mrl != null) {
-					player.setPartName(new File(mrl).getName());
-				}
-				
-				return player;
-			}
-			else {
-				System.out.println(MessagesMP.error_open_media);
-			}
-		}
-		catch (PartInitException e) {
-			e.printStackTrace();
-		}
-		return null;
+
+		return openEditor(mrl, time, -1, false, null, null);
 	}
 	
 	public static MediaPlayerEditor openEditor(String mrl, int time, int endtime) {
+		
+		return openEditor(mrl, time, endtime, false, null, null);
+	}
+	
+	public static MediaPlayerEditor openEditor(String path, int startTime, int endTime, boolean loop, String user, String mdp) {
+		return openEditor(path, startTime, endTime, loop, user, mdp, false);
+	}
+	
+	public static MediaPlayerEditor openEditor(String mrl, int time, int endtime, boolean loop, String user, String mdp, boolean lightInterface) {
+		
 		IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
-		MediaPlayerEditorInput editorInput = new MediaPlayerEditorInput();
+		MediaPlayerEditorInput editorInput = new MediaPlayerEditorInput(mrl, time, endtime);
+		editorInput.setLoop(loop);
+		editorInput.setLightWeightInterface(lightInterface);
+		editorInput.setCrendentials(user, mdp);
+		
 		StatusLine.setMessage(MessagesMP.opening_media);
 		try {
 			MediaPlayerEditor player = (MediaPlayerEditor) page.openEditor(editorInput, MediaPlayerEditor.ID);
-			
-			// boolean isAudio = mrl.matches(".+\\.(mp3|ogg|wav|wpa)"); //$NON-NLS-1$
-			if (player != null) {
-				player.getPlayer().play(mrl, time, endtime);
-				StatusLine.setMessage("");
-			}
-			else {
-				System.out.println(MessagesMP.error_open_media);
-				return null;
-			}
 			return player;
 		}
 		catch (PartInitException e) {
@@ -187,10 +174,22 @@
 		return null;
 	}
 	
-	public static MediaPlayerEditor openEditor(String path, String sStartTime,
-			String sEndTime) {
+	public static MediaPlayerEditor openEditor(String path, String sStartTime, String sEndTime) {
+		return  openEditor(path, sStartTime, sEndTime, false, null, null);
+	}
+	
+	public static MediaPlayerEditor openEditor(String path, String sStartTime, String sEndTime, boolean loop, String user, String mdp) {
+		return openEditor(path, sStartTime, sEndTime, loop, user, mdp, false);
+	}
+
+	public static MediaPlayerEditor openEditor(String path, String sStartTime, String sEndTime, boolean loop, String user, String mdp, boolean lightInterface) {
+		
 		IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
-		MediaPlayerEditorInput editorInput = new MediaPlayerEditorInput();
+		MediaPlayerEditorInput editorInput = new MediaPlayerEditorInput(path, sStartTime, sEndTime);
+		editorInput.setLoop(loop);
+		editorInput.setLightWeightInterface(lightInterface);
+		editorInput.setCrendentials(user, mdp);
+		
 		StatusLine.setMessage(MessagesMP.opening_media);
 		try {
 			IEditorPart editor = page.openEditor(editorInput, MediaPlayerEditor.ID);
@@ -198,13 +197,7 @@
 				return null;
 			}
 			
-			MediaPlayerEditor player = (MediaPlayerEditor) editor;
-			// boolean isAudio = mrl.matches(".+\\.(mp3|ogg|wav|wpa)");
-			if (player != null) {
-				player.getPlayer().play(path, sStartTime, sEndTime);
-				StatusLine.setMessage("");
-			}
-			return player;
+			return (MediaPlayerEditor)editor;
 		}
 		catch (PartInitException e) {
 			e.printStackTrace();
Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/BackToMedia.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/BackToMedia.java	(revision 3205)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/BackToMedia.java	(revision 3206)
@@ -511,17 +511,25 @@
 			Log.fine(MessagesMP.BackToMedia_25 + path);
 			
 			// System.out.println("Linked editors: "+associatedEditors);
-			MediaPlayerEditor vlcEditor = null;
-			if (editor != null) {
-				vlcEditor = associatedEditors.get(editor);
+			boolean alreadyOpened = false;
+			MediaPlayerEditor mediaPlayerEditor = null;
+			if (editor != null && associatedEditors.get(editor) != null && associatedEditors.get(editor).getPlayer() != null && !associatedEditors.get(editor).getPlayer().isDisposed()) {
+				mediaPlayerEditor = associatedEditors.get(editor);
+				alreadyOpened = true;
 			}
 			
-			if (vlcEditor == null || vlcEditor.getPlayer().isDisposed()) {
+			if (!alreadyOpened) {
 				// System.out.println("new editor linked to "+ce);
-				vlcEditor = OpenMediaPlayer.openEditor();
+				String user = null, mdp = null;
+				if (media_auth) {
+					// path_prefix = NLS.bind(media_directory, secured_media_login, secured_media_password);
+					user = System.getProperty(BackToMediaPreferences.MEDIA_AUTH_LOGIN);
+					mdp = System.getProperty(BackToMediaPreferences.MEDIA_AUTH_PASSWORD);
+				}
+				mediaPlayerEditor = OpenMediaPlayer.openEditor(path, sStartTime, sEndTime, true, user, mdp, true);
 				
 				// editor.getPlayer().setRepeat(true);
-				if (vlcEditor == null) {
+				if (mediaPlayerEditor == null) {
 					Log.warning("Error: could not open the MediaPlayer.");
 					return null;
 				}
@@ -529,40 +537,20 @@
 				// move the editor in the window
 				int position = BackToMediaPreferences.getInstance().getInt(BackToMediaPreferences.BACKTOMEDIA_POSITION);
 				if (editor != null) {
-					SWTEditorsUtils.addEditor((EditorPart) editor, vlcEditor, position);
+					SWTEditorsUtils.addEditor((EditorPart) editor, mediaPlayerEditor, position);
 				}
 				
-				Object player = vlcEditor.getPlayer();
-				if (player != null) {
-					// player.hideStopButton();
-					associatedEditors.put(editor, vlcEditor);
+				if (mediaPlayerEditor != null) {
+					associatedEditors.put(editor, mediaPlayerEditor);
 				}
+			} else {
+				mediaPlayerEditor.getPlayer().play(path, sStartTime, sEndTime);
 			}
 			
-			if (media_auth) {
-				// path_prefix = NLS.bind(media_directory, secured_media_login, secured_media_password);
-				vlcEditor.getPlayer().setCredentials(System.getProperty(BackToMediaPreferences.MEDIA_AUTH_LOGIN), System.getProperty(BackToMediaPreferences.MEDIA_AUTH_PASSWORD));
-			}
-			vlcEditor.getPlayer().play(path, sStartTime, sEndTime);
-			vlcEditor.getPlayer().setRepeat(true);
-			
-			// if (!vlcEditor.isMediaLoaded()) {
-			//
-			// vlcEditor.getSite().getPage().closeEditor(vlcEditor, false);
-			// if (media_auth) {
-			// Log.warning("The MediaPlayer could not open the media: " + media_directory); // don't show credentials
-			// System.clearProperty(BackToMediaPreferences.MEDIA_AUTH_PASSWORD);
-			// System.clearProperty(BackToMediaPreferences.MEDIA_AUTH_LOGIN);
-			// }
-			// else {
-			// Log.warning("The MediaPlayer could not open the media: " + path);
-			// }
-			// }
-			
 			if (path != null) {
-				vlcEditor.setPartName(textid);
+				mediaPlayerEditor.setPartName(textid);
 			}
-			return vlcEditor;
+			return mediaPlayerEditor;
 			
 		}
 		catch (Exception e2) {
Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/MediaPlayerComposite.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/MediaPlayerComposite.java	(revision 3205)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/MediaPlayerComposite.java	(revision 3206)
@@ -1,305 +0,0 @@
-package org.txm.backtomedia.editors.player;
-
-import java.io.File;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Scale;
-import org.txm.backtomedia.commands.function.TripleRangeSlider;
-import org.txm.backtomedia.preferences.BackToMediaPreferences;
-import org.txm.utils.logger.Log;
-
-import javafx.util.Duration;
-import vlcplayerrcp.MessagesMP;
-
-public class MediaPlayerComposite extends Composite {
-	
-	IPlayer player;
-	private Scale rateField;
-	private Label rateValueLabel;
-	private Scale volumeField;
-	private Label volumeValueLabel;
-	private Button playButton;
-	private Button stopButton;
-	private Button repeatButton;
-	Label timeLabel;
-	TripleRangeSlider timeRange;
-	
-	protected boolean userStopped;
-	protected String currentlyPlayed = ""; //$NON-NLS-1$
-	protected int start, end;
-	protected boolean hasEnded = false;
-	protected String previouslyPlayed = ""; //$NON-NLS-1$
-	protected boolean repeat = false;
-	protected int volume = 100;
-	protected int time;
-	private int mins;
-	private int secs;
-	
-	public MediaPlayerComposite(Composite parent, int style) {
-		
-		super(parent, style);
-		
-		if ("HTML".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
-			player = new HTMLPlayer(parent, SWT.NONE);
-//		} else if ("JFX".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
-//			player = new JFXPlayer(parent, SWT.NONE);
-		}
-		else if ("VLC".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
-			player = new VLCPlayer(parent, SWT.NONE);
-		}
-		else {
-			player = new HTMLPlayer(parent, SWT.NONE);
-		}
-		
-		
-		// THE CONTROL BUTTONS
-		playButton = new Button(this, SWT.PUSH);
-		GridData playLayoutData = new GridData(SWT.FILL, SWT.CENTER, false, false);
-		playButton.setLayoutData(playLayoutData);
-		playButton.setText(MessagesMP.play);
-		playButton.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				userStopped = false;
-				if (currentlyPlayed.length() == 0) {
-					selectMedia();
-					playButton.setText(MessagesMP.pause);
-					playButton.getParent().layout();
-				}
-				else if (player != null && player.isPlaying()) {
-					player.pause();
-				}
-				else if (player != null && hasEnded) {
-					if (player == null) return;
-					player.replay();
-				}
-				else {
-					player.resume();
-				}
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-		});
-		
-		// Button browseButton = new Button(this,SWT.PUSH);
-		// browseButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
-		// browseButton.setText("Open...");
-		// browseButton.addSelectionListener(new SelectionListener() {
-		// @Override
-		// public void widgetSelected(SelectionEvent e) {
-		// selectMedia();
-		// }
-		//
-		// @Override
-		// public void widgetDefaultSelected(SelectionEvent e) {}
-		// });
-		
-		stopButton = new Button(this, SWT.PUSH);
-		stopButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
-		stopButton.setText(MessagesMP.stop);
-		stopButton.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				if (player != null) {
-					userStopped = true;
-					player.stop();
-				}
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-		});
-		
-		timeLabel = new Label(this, SWT.NONE);
-		timeLabel.setText("00:00"); //$NON-NLS-1$
-		
-		timeRange = new TripleRangeSlider(this, SWT.None);
-		timeRange.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-		timeRange.setToolTipText(MessagesMP.time_range);
-		timeRange.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				TripleRangeSlider.SELECTED_KNOB sk = timeRange.getLastSelectedKnob();
-				switch (sk) {
-					case UPPER:
-						end = timeRange.getUpperValue();
-						
-						player.setStopTime(end); //Duration.seconds(end));
-						if (end < time) {
-							// System.out.println("Upper changed: fix time");
-							time = end;
-							player.seek(time);//Duration.seconds(time));
-						}
-						break;
-					case LOWER:
-						start = timeRange.getLowerValue();
-						player.setStartTime(start);//Duration.seconds(start));
-						if (start > time) {
-							// System.out.println("Lower changed: fix time");
-							time = start;
-							player.seek(time);//Duration.seconds(time));
-						}
-						break;
-					case MIDDLE:
-						
-						time = timeRange.getMiddleValue();
-						// System.out.println("Middle changed: fix time: " + time);
-						
-						player.seek(time);//Duration.seconds(time));
-						
-						break;
-					default:
-						// nothing
-				}
-				// System.out.println("time range: "+start+" -> "+end+" time="+time);
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-		});
-		
-		repeatButton = new Button(this, SWT.CHECK);
-		repeatButton.setText(MessagesMP.repeat);
-		repeat = BackToMediaPreferences.getInstance().getBoolean(BackToMediaPreferences.REPEAT);
-		repeatButton.setSelection(repeat);
-		repeatButton.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				repeat = repeatButton.getSelection();
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-		});
-		
-		Label l = new Label(this, SWT.NONE);
-		l.setText(MessagesMP.rate);
-		
-		rateField = new Scale(this, SWT.BORDER);
-		GridData gdata4 = new GridData(SWT.FILL, SWT.CENTER, false, false);
-		gdata4.widthHint = 100;
-		rateField.setLayoutData(gdata4);
-		rateField.setMaximum(140);
-		rateField.setMinimum(70);
-		rateField.setSelection(100);
-		rateField.setPageIncrement(5);
-		
-		rateField.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				float rate = rateField.getSelection() / 100.0f;
-				player.setRate(rate);
-				rateValueLabel.setText("" + rateField.getSelection() + "%");
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-		});
-		
-		rateValueLabel = new Label(this, SWT.NONE);
-		rateValueLabel.setText("100%");//$NON-NLS-1$
-		
-		l = new Label(this, SWT.NONE);
-		l.setText(MessagesMP.volume);
-		
-		volumeField = new Scale(this, SWT.BORDER);
-		gdata4 = new GridData(SWT.FILL, SWT.CENTER, false, false);
-		gdata4.widthHint = 100;
-		volumeField.setLayoutData(gdata4);
-		volumeField.setMinimum(0);
-		volumeField.setMaximum(100);
-		volumeField.setSelection(volume);
-		volumeField.setPageIncrement(5);
-		volumeField.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				player.setVolume(volumeField.getSelection());
-				volume = volumeField.getSelection();
-				volumeValueLabel.setText("" + volume + "%");
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-		});
-		
-		volumeValueLabel = new Label(this, SWT.NONE);
-		volumeValueLabel.setText("100%");
-		
-		
-	}
-	
-	public void hideStopButton() {
-		if (this.stopButton != null && !this.stopButton.isDisposed()) {
-			this.stopButton.dispose();
-		}
-	}
-	
-	public void resume() {
-		if (player != null) {
-			//player.play();
-			playButton.setText(MessagesMP.pause);
-			playButton.getParent().layout();
-		}
-	}
-	
-	public void pause() {
-		if (player != null) {
-			player.pause();
-			playButton.setText(MessagesMP.resume);
-			playButton.getParent().layout();
-		}
-	}
-	
-	private void updateTimeLabel() {
-		mins = time / 60;
-		secs = (time) % 60;
-		timeLabel.setText(String.format("%02d:%02d", mins, secs)); //$NON-NLS-1$
-		timeLabel.update();
-	}
-	
-	public void replay() {
-		if (currentlyPlayed.length() > 0) {
-			//player.seek(Duration.seconds(start));
-			playButton.setText(MessagesMP.pause);
-			playButton.getParent().layout();
-		}
-	}
-	
-	protected void selectMedia() {
-		Log.fine(MessagesMP.select_file);
-		
-		FileDialog fd = new FileDialog(MediaPlayerComposite.this.getShell(), SWT.OPEN);
-		fd.setText(MessagesMP.select_file_title);
-		File f = new File(previouslyPlayed);
-		if (f.isDirectory()) fd.setFilterPath(f.getPath());
-		else fd.setFilterPath(f.getParent());
-		
-		String[] filterExt = { "*.*", "*.mp3", "*.mp4", "*.avi", "*.ogg", "*.ogv" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		fd.setFilterExtensions(filterExt);
-		String selected = fd.open();
-		if (selected == null) {
-			System.out.println(MessagesMP.cancel);
-			return;
-		}
-		
-		currentlyPlayed = selected;
-		previouslyPlayed = selected;
-		Log.fine(MessagesMP.opening + currentlyPlayed);
-		player.play(new File(currentlyPlayed).toURI().toString(), 0, 0);
-	}
-	
-}
Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/MediaPlayerEditor.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/MediaPlayerEditor.java	(revision 3205)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/MediaPlayerEditor.java	(revision 3206)
@@ -5,8 +5,11 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.ISaveablePart;
+import org.eclipse.ui.ISaveablePart2;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.EditorPart;
+import org.txm.backtomedia.editors.input.MediaPlayerEditorInput;
 import org.txm.backtomedia.preferences.BackToMediaPreferences;
 
 public class MediaPlayerEditor extends EditorPart {
@@ -18,46 +21,55 @@
 	
 	@Override
 	public void createPartControl(Composite parent) {
-		if ("HTML".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
-			player = new HTMLPlayer(parent, SWT.BORDER);
+		if ("VLC".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
+			player = new VLCPlayer(parent, SWT.BORDER);
+		} else { //if ("HTML".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
+			HTMLPlayer hplayer = new HTMLPlayer(parent, SWT.BORDER, this.getEditorInput().getLightWeightInterface());
+			
+			hplayer.setInitialMedia(this.getEditorInput().getURL(), this.getEditorInput().getStartTime(), this.getEditorInput().getEndTime());
+			hplayer.setInitialMedia(this.getEditorInput().getURL(), this.getEditorInput().getStringStartTime(), this.getEditorInput().getStringEndTime());
+			hplayer.setCredentials(this.getEditorInput().getCredentialUser(), this.getEditorInput().getCredentialPassword());
+			hplayer.setInitialRepeat(this.getEditorInput().getLoop());
+			
+			player = hplayer;
+			
 //		} else if ("JFX".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
 //			player = new JFXPlayer(parent, SWT.NONE);
 		}
-		else if ("VLC".equals(BackToMediaPreferences.getInstance().getString(BackToMediaPreferences.PLAYER))) {
-			player = new VLCPlayer(parent, SWT.BORDER);
-		}
-		else {
-			player = new HTMLPlayer(parent, SWT.BORDER);
-		}
 	}
 	
+	public MediaPlayerEditorInput getEditorInput() {
+		return (MediaPlayerEditorInput)super.getEditorInput();
+	}
+	
 	public void init() {
 		
 	}
 	
+    /* Returns whether the contents of this editor should be saved when the editor
+     * is closed.
+     * <p>
+     * This method returns <code>true</code> if and only if the editor is dirty
+     * (<code>isDirty</code>).
+     * </p>
+     */
+    @Override
+	public boolean isSaveOnCloseNeeded() {
+    	player.stop();
+        return false;
+    }
+	
 	@Override
 	public void setFocus() {
 		
 	}
 	
-	@Override
-	public void dispose() {
-		try {
-			if (player != null) player.stop();
-		}
-		catch (Exception e) {
-			e.printStackTrace();
-		}
-		
-		super.dispose();
-	}
-	
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	@Override
-	public void doSave(IProgressMonitor monitor) {}
+	public void doSave(IProgressMonitor monitor) {player.stop();}
 	
 	/*
 	 * (non-Javadoc)
@@ -75,6 +87,7 @@
 			throws PartInitException {
 		setSite(site);
 		setInput(input);
+		
 		// VLCPlayerEditorInput ii = (VLCPlayerEditorInput) input;
 	}
 	
@@ -84,9 +97,13 @@
 	 */
 	@Override
 	public boolean isSaveAsAllowed() {
-		return false;
+		return true;
 	}
 	
+	/**
+	 * ensure the player is displayed and ready
+	 * @return
+	 */
 	public IPlayer getPlayer() {
 		return player;
 	}
@@ -98,7 +115,7 @@
 	
 	@Override
 	public boolean isDirty() {
-		return false;
+		return true;// player.isMediaLoaded();
 	}
 	
 	/**
Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/HTMLPlayer.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/HTMLPlayer.java	(revision 3205)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/HTMLPlayer.java	(revision 3206)
@@ -6,12 +6,15 @@
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Scale;
 import org.txm.backtomedia.commands.function.OpenMediaPlayer;
 import org.txm.backtomedia.commands.function.SimpleFileDialog;
@@ -19,124 +22,174 @@
 import org.txm.rcp.swt.GLComposite;
 
 public class HTMLPlayer extends Composite implements IPlayer {
-
+	
 	Browser browser;
 	String mrl = null;
 	private String login;
 	private String mdp;
 	private Button stopButton;
 	
-	public HTMLPlayer(Composite parent, int style) {
+	String initMrl;
+	int initStartTime = 0;
+	int initEndTime = -1;
+	String initStringStartTime = null;
+	String initStringEndTime = null;
+	boolean initRepeat = false;
+	private Label volumeLabel;
+	private Label rateLabel;
+	
+	public HTMLPlayer(Composite parent, int style, boolean lightweight) {
 		
 		super(parent, style);
 		
 		this.setLayout(new GridLayout(1, true));
 		
-		GLComposite controls = new GLComposite(this, SWT.BORDER, "controls");
-		controls.getLayout().numColumns = 20;
+		browser = new Browser(this, SWT.NONE);
+		browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+		browser.setText("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"></head><body><video id=\"video\" width=\"100%\" height=\"100%\" controls></video></body></html>");
+		//browser.setText("<video id=\"video\" width=\"100%\" height=\"100%\" controls><source id=\"source\" src=\"\"></source></video>");
 		
-		Button openButton = new Button(controls, SWT.PUSH);
-		openButton.setText("Open...");
-		openButton.addSelectionListener(new SelectionListener() {
+		browser.addProgressListener(new ProgressListener() {
 			
 			@Override
-			public void widgetSelected(SelectionEvent event) {
-				
-				SimpleFileDialog fd = new SimpleFileDialog(HTMLPlayer.this.getDisplay().getActiveShell(), "Opening media file...", "Enter file path or URL", BackToMediaPreferences.getInstance().getString(OpenMediaPlayer.ID), null);
-				if (fd.open() == SimpleFileDialog.OK) {
-					String mrl = fd.getValue();
-					
-					if (mrl != null) {
-						File f = new File(mrl);
-						if (f.exists()) {
-							mrl = new File(mrl).toURI().toString();
-						}
-						else {
-							
-						}
-						BackToMediaPreferences.getInstance().put(OpenMediaPlayer.ID, mrl);
-						play(mrl, 0);
+			public void completed(ProgressEvent event) {
+				//System.out.println("LOADED");
+				HTMLPlayer.this.loaded = true;
+				if (initMrl != null) {
+					if (initStringStartTime != null) {
+						HTMLPlayer.this.play(initMrl, initStringStartTime, initStringEndTime);
+					} else {
+						HTMLPlayer.this.play(initMrl, initStartTime, initEndTime);
 					}
 				}
+				setRepeat(initRepeat);
 			}
 			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void changed(ProgressEvent event) { }
 		});
-
-		stopButton = new Button(controls, SWT.PUSH);
-		stopButton.setText("Stop");
-		stopButton.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent event) {
-				stop();
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
-		});
 		
-		Button playpauseButton = new Button(controls, SWT.TOGGLE);
-		playpauseButton.setText("Pause");
-		playpauseButton.setSelection(true);
-		playpauseButton.addSelectionListener(new SelectionListener() {
+		GLComposite controls = new GLComposite(this, SWT.NONE, "controls");
+		controls.getLayout().numColumns = 20;
+		controls.getLayout().horizontalSpacing = 2;
+		
+		if (!lightweight) {
+			Button openButton = new Button(controls, SWT.PUSH);
+			openButton.setText("Open...");
+			openButton.addSelectionListener(new SelectionListener() {
+				
+				@Override
+				public void widgetSelected(SelectionEvent event) {
+					
+					SimpleFileDialog fd = new SimpleFileDialog(HTMLPlayer.this.getDisplay().getActiveShell(), "Opening media file...", "Enter file path or URL", BackToMediaPreferences.getInstance().getString(OpenMediaPlayer.ID), null);
+					if (fd.open() == SimpleFileDialog.OK) {
+						String mrl = fd.getValue();
+						
+						if (mrl != null) {
+							File f = new File(mrl);
+							if (f.exists()) {
+								mrl = new File(mrl).toURI().toString();
+							}
+							else {
+								
+							}
+							BackToMediaPreferences.getInstance().put(OpenMediaPlayer.ID, mrl);
+							play(mrl, 0);
+						}
+					}
+				}
+				
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) { }
+			});
 			
-			@Override
-			public void widgetSelected(SelectionEvent event) {
-				if (playpauseButton.getSelection()) {
-					resume();
-					playpauseButton.setText("Pause");
-				} else {
-					pause();
-					playpauseButton.setText("Play");
+			stopButton = new Button(controls, SWT.PUSH);
+			stopButton.setText("Stop");
+			stopButton.addSelectionListener(new SelectionListener() {
+				
+				@Override
+				public void widgetSelected(SelectionEvent event) {
+					stop();
 				}
-			}
+				
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) { }
+			});
 			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
-		});
-		
-		Button replayButton = new Button(controls, SWT.PUSH);
-		replayButton.setText("Re-play");
-		replayButton.addSelectionListener(new SelectionListener() {
+//			Button playpauseButton = new Button(controls, SWT.TOGGLE);
+//			playpauseButton.setText("Pause");
+//			playpauseButton.setSelection(true);
+//			playpauseButton.addSelectionListener(new SelectionListener() {
+//				
+//				@Override
+//				public void widgetSelected(SelectionEvent event) {
+//					if (playpauseButton.getSelection()) {
+//						resume();
+//						playpauseButton.setText("Pause");
+//					} else {
+//						pause();
+//						playpauseButton.setText("Play");
+//					}
+//				}
+//				
+//				@Override
+//				public void widgetDefaultSelected(SelectionEvent e) { }
+//			});
+//			
+//			Button replayButton = new Button(controls, SWT.PUSH);
+//			replayButton.setText("Re-play");
+//			replayButton.addSelectionListener(new SelectionListener() {
+//				
+//				@Override
+//				public void widgetSelected(SelectionEvent event) {
+//					replay();
+//				}
+//				
+//				@Override
+//				public void widgetDefaultSelected(SelectionEvent e) { }
+//			});
+//			
+//			Button loopButton = new Button(controls, SWT.TOGGLE);
+//			loopButton.setText("Loop");
+//			loopButton.setSelection(initRepeat);
+//			loopButton.addSelectionListener(new SelectionListener() {
+//				
+//				@Override
+//				public void widgetSelected(SelectionEvent event) {
+//					setRepeat(loopButton.getSelection());
+//				}
+//				
+//				@Override
+//				public void widgetDefaultSelected(SelectionEvent e) { }
+//			});
+//			
+//			volumeLabel = new Label(controls, SWT.NONE);
+//			volumeLabel.setText("Volume (100%)");
+//			
+//			Scale volumneSpinner = new Scale(controls, SWT.NONE);
+//			volumneSpinner.setMinimum(0);
+//			volumneSpinner.setMaximum(100);
+//			volumneSpinner.setSelection(100);
+//			volumneSpinner.addSelectionListener(new SelectionListener() {
+//				
+//				@Override
+//				public void widgetSelected(SelectionEvent e) {
+//					setVolume(volumneSpinner.getSelection());
+//				}
+//				
+//				@Override
+//				public void widgetDefaultSelected(SelectionEvent e) { }
+//			});
 			
-			@Override
-			public void widgetSelected(SelectionEvent event) {
-				replay();
-			}
+//			GridData gdata = new GridData(GridData.CENTER, GridData.CENTER, false, false);
+//			gdata.minimumWidth = gdata.widthHint = 150;
+//			volumneSpinner.setLayoutData(gdata);
 			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
-		});
-		
-		Button loopButton = new Button(controls, SWT.TOGGLE);
-		loopButton.setText("Loop");
-		loopButton.addSelectionListener(new SelectionListener() {
 			
-			@Override
-			public void widgetSelected(SelectionEvent event) {
-				setRepeat(loopButton.getSelection());
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
-		});
+		}
 		
-		Scale volumneSpinner = new Scale(controls, SWT.NONE);
-		volumneSpinner.setMinimum(0);
-		volumneSpinner.setMaximum(100);
-		volumneSpinner.setSelection(100);
-		volumneSpinner.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				setVolume(volumneSpinner.getSelection());
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
-		});
+		rateLabel = new Label(controls, SWT.NONE);
+		rateLabel.setText("Rate (1.0)");
 		
 		Scale rateSpinner = new Scale(controls, SWT.NONE);
 		rateSpinner.setMinimum(10);
@@ -152,30 +205,76 @@
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) { }
 		});
+		GridData gdata2 = new GridData(GridData.CENTER, GridData.CENTER, false, false);
+		gdata2.minimumWidth = gdata2.widthHint = 150;
+		rateSpinner.setLayoutData(gdata2);
 		
-		browser = new Browser(this, SWT.NONE);
-		browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
-		browser.setText("<video id=\"video\" width=\"100%\" height=\"100%\" controls></video>");
-		//browser.setText("<video id=\"video\" width=\"100%\" height=\"100%\" controls><source id=\"source\" src=\"\"></source></video>");
+		//		new Label(controls, SWT.NONE).setText("Progression");
+		//		
+		//		Scale progressionSpinner = new Scale(controls, SWT.NONE);
+		//		progressionSpinner.setMinimum(0);
+		//		progressionSpinner.setMaximum(300);
+		//		progressionSpinner.setSelection(0);
+		//		progressionSpinner.addSelectionListener(new SelectionListener() {
+		//			
+		//			@Override
+		//			public void widgetSelected(SelectionEvent e) {
+		//				seek(((float)progressionSpinner.getSelection()));
+		//			}
+		//			
+		//			@Override
+		//			public void widgetDefaultSelected(SelectionEvent e) { }
+		//		});
+		//		GridData gdata3 = new GridData(GridData.FILL, GridData.CENTER, true, false);
+		//		progressionSpinner.setLayoutData(gdata3);
+		
+		
+		
 	}
-
+	
+	//	@Override
+	//	public void dispose() {
+	//		if (!browser.isDisposed()) {
+	//			browser.evaluate("document.getElementById('video').pause();");
+	//			browser.evaluate("document.getElementById('video').removeAttribute('src');");
+	//		}
+	//		super.dispose();
+	
 	@Override
 	public void setCredentials(String login, String mdp) {
 		
-		//browser.evaluate(TXMCoreMessages.bind("video.;", login, mdp));
+		//browser.evaluate(TXMCoreMessages.bind("document.getElementById('video').;", login, mdp));
 		this.login = login;
 		this.mdp = mdp;
-		
 	}
 	
+	public void setInitialMedia(String mrl, int start, int end) {
+		this.initMrl = mrl;
+		this.initStartTime = start;
+		this.initEndTime = end;
+	}
 	
+	public void setInitialMedia(String mrl, String start, String end) {
+		this.initMrl = mrl;
+		this.initStringStartTime = start;
+		this.initStringEndTime = end;
+	}
+	
 	public void hideStopButton() {
 		if (this.stopButton != null && !this.stopButton.isDisposed()) {
 			this.stopButton.dispose();
 		}
 	}
-
+	
+	@Override
+	public void dispose() {
+		stop();
+		super.dispose();
+	}
+	
 	DateTimeFormatter hhmmssFormatter = DateTimeFormatter.ISO_LOCAL_TIME;
+	protected boolean loaded;
+	
 	@Override
 	public boolean play(String mrl, String startTime, String endTime) {
 		
@@ -203,116 +302,127 @@
 		return play(mrl, start, end);
 		
 	}
-
+	
 	@Override
-	public boolean play(String mrl, int start, int end) {
+	public boolean play(String mrl2, int start, int end) {
 		
-		browser.evaluate("document;");
-		browser.evaluate("document.getElementById(\"video\");");
-		browser.evaluate("document.getElementById(\"source\");");
+		//		browser.evaluate("document;");
+		//		browser.evaluate("document.getElementById('video');");
+		//		
+		if (login != null && mdp != null) {
+			mrl2 = mrl2.replace("{0}", login).replace("{1}", mdp);
+		} 
+		//System.out.println("MEDIA URL: "+mrl2);
+		String script = "";
 		
-		if (login != null && mdp != null) {
-			mrl = mrl.replace("{0}", login).replace("{1}", mdp);
+		if (HTMLPlayer.this.mrl == null || !HTMLPlayer.this.mrl.equals(mrl2)) {
+			script += "document.getElementById('video').setAttribute('src', '"+mrl2+"');\n"; 
+			
+			script += "document.getElementById('video').play();\n" +
+					"document.getElementById('video').onloadedmetadata = function() {document.getElementById('video').currentTime = "+start+";};\n";
+		} else {
+			script += "document.getElementById('video').play();\n" +
+					"document.getElementById('video').currentTime="+start+";\n";
 		}
 		
-		String script = "document;\n"
-				+ "video = document.getElementById('video');\n";
-		
-		if (this.mrl == null || !this.mrl.equals(mrl)) {
-			script += "video.setAttribute('src', '"+mrl+"');\n"; 
-		}
-		script += "video.play();\n" +
-				"video.currentTime="+start+";\n";
 		//System.out.println("EVAL: "+script);
 		browser.evaluate(script);
 		
-		this.mrl = mrl;
+		this.mrl = mrl2;
 		return true;
 	}
-
+	
 	@Override
 	public boolean play(String mrl, int start) {
 		
 		return play(mrl, start, -1);
 		
 	}
-
+	
 	@Override
 	public void stop() {
 		
 		if (browser.isDisposed()) return;
 		
-		browser.evaluate("video.pause();");
-		browser.evaluate("video.setAttribute('src', '');");
+		mrl = null;
+		browser.evaluate("document.getElementById('video').pause();");
+		browser.evaluate("document.getElementById('video').removeAttribute('src');");
 		
 	}
-
+	
 	@Override
 	public boolean isMediaLoaded() {
 		
 		return mrl != null && mrl.length() > 0;
 		
 	}
-
-	@Override
-	public void setRepeat(boolean b) {
+	
+	public void setInitialRepeat(boolean b) {
 		
-		browser.evaluate("video.loop="+b+";");
+		initRepeat = b;
 		
 	}
-
+	
 	@Override
-	public boolean isDisposed() {
+	public void setRepeat(boolean b) {
 		
-		return browser.isDisposed();
+		browser.evaluate("document.getElementById('video').loop="+b+";");
 		
 	}
-
+	//
+	//	@Override
+	//	public boolean isDisposed() {
+	//		
+	//		return browser == null || browser.isDisposed();
+	//		
+	//	}
+	
 	@Override
 	public void seek(float time) {
 		
-		browser.evaluate("video.currentTime="+time+";");
+		browser.evaluate("document.getElementById('video').currentTime="+time+";");
 		
 	}
-
+	
 	@Override
 	public void pause() {
 		
-		browser.evaluate("video.pause();");
+		browser.evaluate("document.getElementById('video').pause();");
 		
 	}
-
+	
 	@Override
 	public void replay() {
 		
-		browser.evaluate("video.currentTime=0;");
+		browser.evaluate("document.getElementById('video').currentTime=0;");
 		
 	}
-
+	
 	@Override
 	public void resume() {
 		
-		browser.evaluate("video.play();");
+		browser.evaluate("document.getElementById('video').play();");
 		
 	}
-
+	
 	@Override
 	public void setVolume(double volume) {
 		
-		browser.evaluate("video.volume="+volume/100.0d+";");
-		
+		browser.evaluate("document.getElementById('video').volume="+volume/100.0d+";");
+		if (volumeLabel != null && !volumeLabel.isDisposed()) volumeLabel.setText("Volume ("+(int)volume+"%)");
 	}
-
+	
 	@Override
 	public void setRate(float rate) {
 		
-		browser.evaluate("video.playbackRate="+rate+";");
+		browser.evaluate("document.getElementById('video').playbackRate="+rate+";");
+		if (rateLabel != null && !rateLabel.isDisposed()) rateLabel.setText(String.format("Rate (%.1f)", rate));
 		
 	}
-
+	
 	@Override
 	public boolean isPlaying() {
-		Object o = browser.evaluate("return !video.played;");
+		Object o = browser.evaluate("return !document.getElementById('video').played;");
 		if (o == null) return false;
 		if (o instanceof Boolean) {
 			return (Boolean)o;
@@ -320,14 +430,14 @@
 		return  false;
 		
 	}
-
+	
 	@Override
 	public void setStartTime(float seconds) {
 		
 		//browser.evaluate(TXMCoreMessages.bind("alert(''set start time {0}'');", seconds));
 		
 	}
-
+	
 	@Override
 	public void setStopTime(float seconds) {
 		
Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/input/MediaPlayerEditorInput.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/input/MediaPlayerEditorInput.java	(revision 3205)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/input/MediaPlayerEditorInput.java	(revision 3206)
@@ -35,12 +35,21 @@
 import org.txm.rcp.IImageKeys;
 
 /**
- * MEdia player editor input
+ * Media player editor input
  *
  * @author mdecorde
  */
 public class MediaPlayerEditorInput implements IEditorInput {
 	
+	String mrl;
+	int startTime = 0, endTime = -1;
+	private String sStartTime;
+	private String sEndTime;
+	private boolean loop;
+	private String mdp;
+	private String user;
+	private boolean lightweight = false;
+	
 	/**
 	 * Instantiates a new Media player editor input.
 	 *
@@ -50,6 +59,46 @@
 		super();
 	}
 	
+	public MediaPlayerEditorInput(String mrl, int startTime) {
+		
+		this.mrl = mrl;
+		this.startTime = startTime;
+	}
+	
+	public MediaPlayerEditorInput(String mrl, int startTime, int endTime) {
+		
+		this.mrl = mrl;
+		this.startTime = startTime;
+		this.endTime = endTime;
+	}
+
+	public MediaPlayerEditorInput(String mrl, String sStartTime, String sEndTime) {
+		
+		this.mrl = mrl;
+		this.sStartTime = sStartTime;
+		this.sEndTime = sEndTime;
+	}
+
+	public String getURL() {
+		return mrl;
+	}
+	
+	public int getStartTime() {
+		return startTime;
+	}
+	
+	public int getEndTime() {
+		return endTime;
+	}
+	
+	public String getStringStartTime() {
+		return sStartTime;
+	}
+	
+	public String getStringEndTime() {
+		return sEndTime;
+	}
+
 	/**
 	 * Exists.
 	 *
@@ -118,13 +167,40 @@
 	public Object getAdapter(@SuppressWarnings("rawtypes") Class arg0) {
 		return null;
 	}
+
+	public void setLoop(boolean loop) {
+		
+		this.loop = loop;
+	}
 	
-	/**
-	 * Gets the source.
-	 *
-	 * @return the Correspondance analysis underlying object
-	 */
-	public Object getSource() {
-		return ""; //$NON-NLS-1$
+	public boolean getLoop() {
+		
+		return loop;
 	}
+
+	public void setCrendentials(String user, String mdp) {
+		
+		this.user = user;
+		this.mdp = mdp;
+	}
+	
+	public String getCredentialUser() {
+		
+		return user;
+	}
+	
+	public String getCredentialPassword() {
+		
+		return mdp;
+	}
+
+	public void setLightWeightInterface(boolean lightweight) {
+		
+		this.lightweight = lightweight;
+	}
+	
+	public boolean getLightWeightInterface() {
+		
+		return lightweight ;
+	}
 }
