{% spaceless %}
{% load i18n %}
{% load thumbnail %}
{% load staticfiles %}
<div>
<div id="{{ player_id }}_embed" class="iri_player_embed">
</div>
<script type="text/javascript" src="{{LDT_STATIC_URL}}ldt/metadataplayer/LdtPlayer-core.js"></script>
<script type="text/javascript">

	IriSP.libFiles.defaultDir = "libs/";
	IriSP.language = '{{LANGUAGE_CODE}}';
	IriSP.widgetsDir = "metadataplayer";
	var _metadata = {
	    url: '{{LDT_URL}}ldt/cljson/id/{{project_id}}?callback=?',
	    format: 'ldt'
	};
	var _config = {
	    width : 480,
	    container : 'LdtPlayer',
	    default_options: {
	        metadata: _metadata
	    },
	    css : '{{LDT_STATIC_URL}}ldt/metadataplayer/LdtPlayer-core.css',
	    widgets: [
	        {
	            type: "JwpPlayer",
	            live: true, 
	            height: 310,
	            width: 480,
	            provider: "rtmp",
	            streamer: function(_url) {
	                var _matches = _url.match(/^[^\/]+\/\/[^\/]+\/[^\/]+\//);
	                if (_matches) {
	                    return _matches[0];
	                } else {
	                    return _url;
	                }
	            }
	        },
	        { type: "Slider" },
	        { type: "Controller" },
	        { type: "Polemic" },
	        { type: "Segments" },
	        { type: "Arrow" },
	        {
	            type: "Annotation",
	            search_on_tag_click: false,
	            start_minimized: false
	        },
	        { type: "Tweet" },
	        {
	            type: "KnowledgeConcierge",
	            container: "KcContainer",
	            proxy: "{% url kc_proxy '' %}",
	            width: 480,
	            height: 420,
	            project_id: "{{kc_id}}",
	            topic_id: "{{topic_id}}"
	        }
	    ]
	};
	var _myPlayer = new IriSP.Metadataplayer(_config);
</script>
</div>
{% endspaceless %}

