/*
 * Copyright (c) 2012-2014 Kaarle Ritvanen
 * See LICENSE file for license details
 */

define(
    ["aconf/dom", "aconf/widget/abstract/inline", "jquery", "underscore"],
    function(dom, Base, $, _) {
	return Base.extend({
	    render: function(value, meta) {
		if (!value) return;
		
		var self = this;

		this.el.html(_.isObject(value) ? $("<audio>").attr(
		    {src: value.data, autoplay: true, controls: true}
		) : dom.href().text("Play").click(function() {
		    self.refresh();
		}));
	    }
	});
    }
);
