{% load i18n %}
{% load thumbnail %}
{% load static %}
{% load absurl %}
{% load analytics %}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{LANGUAGE_CODE}}" lang="{{LANGUAGE_CODE}}">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Cache" content="no store" />
        <meta http-equiv="Expires" content="-1" />
        <title>Ligne de Temps - IRI - Metadata Player</title>
        <link rel="stylesheet" href='{% static "ldt/metadataplayer/LdtPlayer-core.css" %}' type="text/css"/>
        <script type="text/javascript">
            {% if tag_titles or tag_titles == "" %}
            var tag_string= '{{ tag_titles }}';
            var tag_titles_array=tag_string.split(",");
            {% endif %}

            // Public function to set location's hash. Usefull because browser's security does not allow to get/set document.getElementById("my-iframe").contentWindow.location.hash
            var setHash = function(e) {
                // e.data is the string sent by the origin with postMessage.
                if(e.data.substr(0,1) == '#') {
                    window.location.hash = e.data.substr(1);
                }
            }
            // we have to listen for 'message'
            window.addEventListener('message', setHash, false);
        </script>
    </head>
    <body id="init_embed_popup">
        <div style="float:left; width:550px;" id="wrapper_{{player_id}}">
        
        <div>
            <div id="{{ player_id }}_embed" class="iri_player_embed"></div>
            <script type="text/javascript" src='{% static "ldt/metadataplayer/LdtPlayer-core.js" %}'></script>
            <script type="text/javascript">
            
            if (typeof jQuery == "undefined") {
                jQuery = IriSP.jQuery;
            }
            var metadatas = {metadata: {url: "{{json_url}}"}};
            var metadata_key = "metadata";
            
            IriSP.libFiles.defaultDir = '{% static "ldt/js/" %}';
            IriSP.libFiles.locations.jwPlayerSWF = '{% static "ldt/swf/player.swf" %}';
            IriSP.libFiles.locations.recordMicSwf = '{% static "ldt/swf/record_mic.swf" %}';
            IriSP.libFiles.locations.zeroClipboardSwf = '{% static "ldt/swf/ZeroClipboard10.swf" %}';
            IriSP.libFiles.locations.cssjQueryUI = '{% static "ldt/css/jq-css/themes/base/jquery-ui.css" %}';
            IriSP.language = '{{LANGUAGE_CODE}}';
            
            IriSP.widgetsDir = '{% static "ldt/metadataplayer" %}';
            var _metadata = {
                url: metadatas[metadata_key].url,
                format: 'ldt'
            };
            
            {% block mdplayer_config %}
            {% endblock mdplayer_config %}
            
            _myPlayer = new IriSP.Metadataplayer(_config);
            </script>
            </div>
        </div>
        {% if social %}
        <div id="Social_ext" class="Ldt-TraceMe Ldt-Widget" style="float:right; width:400px; height:24px;" widget-type="Social">
        </div>
        {% endif %}
        {% if slideshare %}
        <div id="Slideshare_ext" class="ext_widget Ldt-TraceMe Ldt-Widget" style="float:left; width:400px;" widget-type="Slideshare">
            </div>
        {% endif %}
        {% if annotations_list %}
        <div style="float:left; width:400px;" id="AnnotationsList_ext"></div>
        {% endif %}
        
{% analytics %}
    </body>
</html>

