function PlayList(opts) {
	var that = this;
	this.current = null;
	
	var playerEls = opts.players;
	
	
	this.players = {};

	for (var playerSel in playerEls) {
		(function(playerSel) {
		
		var player = that.players[playerSel] = new Player({
			file: playerEls[playerSel],
			onplay: function() {
				if (that.current) that.current.stop();
				that.current = this;
				opts.onstart(jQuery(playerSel));
			},
			onstop: function() {
				opts.onstop(jQuery(playerSel));
				if (that.current == this) that.current = null;
			}
		});
		jQuery(playerSel).click(function() {
			player.toggle();
		});
		
		})(playerSel);
	}
}

