package com.vaadin.addon.audio.client;

import java.util.Stack;

import com.vaadin.addon.audio.client.util.Log;
import com.vaadin.addon.audio.shared.ChunkDescriptor;

public class AudioStreamPlayer {

	private StreamReceiver stream;
	
	private Stack<BufferPlayer> prevPlayers = new Stack<>();
	private Stack<BufferPlayer> nextPlayers = new Stack<>();
	private BufferPlayer currentPlayer = null;
	
	private int duration = 0;
	private int position = 0;
	
	public AudioStreamPlayer(StreamReceiver stream) {
		Log.message(this, "create");
	}
	
	public int getDuration() {
		return duration;
	}
	
	public void setPosition(int millis) {
		Log.message(this, "set position to " + millis);
	}
	
	public int getPosition() {
		return position;
	}
	
	public void play() {
		Log.message(this, "play");
	}
	
	public void pause() {
		Log.message(this, "pause");		
	}
	
	public void resume() {
		Log.message(this, "resume");
	}
	
	public void stop() {
		Log.message(this, "stop");
	}
	
}

@@ -671,25 +671,261 @@
 + millis);%0A%09
-%7D
+%09// Are we going to use native JS functions here to handle these?%0A%09%09// Such as the method below?%0A%09%7D%0A%09%0A%09// Like this for example?  %0A%09//private native void setPositionJsExample(int millis) /*-%7B%0A%09//%09$wnd.player.setPosition(millis);%0A%09//%7D-*/;
 %0A%09%0A%09public i

adding question about js impl