{% spaceless %}
{% load i18n %}
{% load thumbnail %}
{% load staticfiles %}

<div id="LdtPlayer" 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 = "{{LDT_STATIC_URL}}ldt/js";
    IriSP.libFiles.locations.jwPlayerSWF = "{{LDT_STATIC_URL}}ldt/swf/player.swf";
    IriSP.libFiles.locations.zeroClipboardSwf = "{{LDT_STATIC_URL}}ldt/swf/ZeroClipboard10.swf";
    IriSP.libFiles.locations.cssjQueryUI = "{{LDT_STATIC_URL}}ldt/css/jq-css/themes/base/jquery-ui.css"
	IriSP.language = '{{LANGUAGE_CODE}}';
	IriSP.widgetsDir = "{{LDT_STATIC_URL}}ldt/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: "AutoPlayer",
	            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: "MultiSegments" },
	        { type: "Tweet" },
	        {
	            type: "KnowledgeConcierge",
	            container: "KcContainer",
	            kc_api_root: "{% url kc_proxy '' %}",
	            width: 480,
	            height: 420,
	            sketch_path: '{% static "hp/tmgraph" %}',
	            project_id: "{{kc_id}}",
	            topic_id: "{{topic_id}}",
	            related_api_endpoint: '{% url videos_recommended %}',
	            related_count: 8,
	            related_data_type: 'json',
	            video_url_base: '{% url hp.views.show_video_details "" %}'
	        }
	    ]
	};
	var _myPlayer = new IriSP.Metadataplayer(_config);
</script>
{% endspaceless %}

