src/hp/templates/hp/partial/embed_player.html
changeset 38 0fe2f3f5466f
child 41 b6010b3d6ea8
equal deleted inserted replaced
37:b4ed8cdc654c 38:0fe2f3f5466f
       
     1 {% spaceless %}
       
     2 {% load i18n %}
       
     3 {% load thumbnail %}
       
     4 {% load staticfiles %}
       
     5 <div>
       
     6 <div id="{{ player_id }}_embed" class="iri_player_embed">
       
     7 </div>
       
     8 <script type="text/javascript" src="{{WEB_URL}}{{LDT_MEDIA_PREFIX}}metadataplayer/LdtPlayer-core.js"></script>
       
     9 <script type="text/javascript">
       
    10 
       
    11 if (typeof jQuery == "undefined") {
       
    12 	jQuery = IriSP.jQuery;
       
    13 }
       
    14 	var metadatas = {metadata: {url: '{{json_url}}'}};
       
    15 	var metadata_key = "metadata";
       
    16 
       
    17 IriSP.libFiles.defaultDir = "{% static "hp/js/" %}";
       
    18 IriSP.libFiles.locations.jwPlayerSWF = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}swf/player.swf";
       
    19 IriSP.libFiles.locations.recordMicSwf = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}swf/record_mic.swf";
       
    20 IriSP.libFiles.locations.zeroClipboardSwf = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}swf/ZeroClipboard10.swf";
       
    21 IriSP.libFiles.locations.cssjQueryUI = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}css/jq-css/themes/base/jquery-ui.css"
       
    22 IriSP.language = '{{LANGUAGE_CODE}}';
       
    23 
       
    24 IriSP.widgetsDir = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}metadataplayer";
       
    25 var _metadata = {
       
    26     url: metadatas[metadata_key].url + '?callback=?',
       
    27     format: 'ldt'
       
    28 };
       
    29 var _config = {
       
    30     width: '{{ player_width }}',
       
    31     container: '{{ player_id }}_embed',
       
    32     css: '{{WEB_URL}}{{LDT_MEDIA_PREFIX}}metadataplayer/LdtPlayer-core.css',
       
    33     default_options: {
       
    34         metadata: _metadata
       
    35     },
       
    36     widgets: [
       
    37         {
       
    38             type: "AutoPlayer",
       
    39     {% if external_url %}
       
    40             video: "{{ external_url }}",
       
    41     {% else %}
       
    42             streamer: function(_url) {
       
    43                 var _matches = _url.match(/^[^\/]+\/\/[^\/]+\/[^\/]+\//);
       
    44                 if (_matches) {
       
    45                     return _matches[0];
       
    46                 } else {
       
    47                     return _url;
       
    48                 }
       
    49             },
       
    50     {% endif %}
       
    51             height: 300,
       
    52             autostart: true
       
    53         },
       
    54         {
       
    55             type: "Polemic"
       
    56     {% if polemic == 'all' %}
       
    57             ,annotation_type: false
       
    58     {% endif %}
       
    59         },
       
    60     {% if polemic != 'all' %}
       
    61         {
       
    62             type: "Sparkline"
       
    63         },
       
    64     {% endif %}
       
    65         {
       
    66             type: "Slider"
       
    67         },{
       
    68             type: "AnnotationsList",
       
    69             container: "AnnotationsList_ext",
       
    70             ajax_url: "",
       
    71             ajax_granularity : 300000,
       
    72             default_thumbnail : "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}/imgs/video_sequence.png",
       
    73             show_audio: true,
       
    74             rtmp_streamer: "rtmp://media.iri.centrepompidou.fr/ddc_micro_record/"
       
    75         },{
       
    76             type: "Controller"
       
    77         },{
       
    78             type: "Segments",
       
    79             annotation_type: ["chap","découpage"]
       
    80         },{
       
    81             type: "Annotation",
       
    82             start_minimized: true,
       
    83             site_name : "Lignes de Temps",
       
    84             annotation_type: ["chap","découpage"]
       
    85         },{
       
    86             type: "Tweet",
       
    87             hide_timeout: 5000
       
    88         },{
       
    89             type: "Slideshare",
       
    90             container: "Slideshare_ext",
       
    91             embed_width: 400,
       
    92             embed_height: 334,
       
    93             annotation_type: "slide"
       
    94         },{
       
    95             type: "Mediafragment"
       
    96         },{
       
    97             type: "Social",
       
    98             container: "Social_ext",
       
    99             url: document.location.href.replace(/#.*$/,""),
       
   100             text: document.title
       
   101         }
       
   102     ]
       
   103 };
       
   104 
       
   105 _myPlayer = new IriSP.Metadataplayer(_config);
       
   106 </script>
       
   107 </div>
       
   108 {% endspaceless %}