server/src/remieplt/templates/ldt/ldt_utils/embed/v2/iframe.html
changeset 17 18ba1a921633
equal deleted inserted replaced
16:ad85999dd05c 17:18ba1a921633
       
     1 {% extends "ldt/ldt_utils/embed/iframe_base.html" %}
       
     2 {% load i18n %}
       
     3 {% load thumbnail %}
       
     4 {% load static %}
       
     5 {% load absurl %}
       
     6 {% load analytics %}
       
     7 {% block mdplayer_config %}
       
     8     var _config = {
       
     9         width: '{{ player_width }}',
       
    10         container: '{{ player_id }}_embed',
       
    11         css: '{% static "ldt/metadataplayer/LdtPlayer-core.css" %}',
       
    12         default_options: {
       
    13             metadata: _metadata
       
    14         },
       
    15         widgets: [
       
    16             {
       
    17                 type: "AutoPlayer",
       
    18                 {% if external_url %}
       
    19                         video: "{{ external_url }}",
       
    20                 {% else %}
       
    21                         streamer: function(_url) {
       
    22                             var _matches = _url.match(/^[^\/]+\/\/[^\/]+\/[^\/]+\//);
       
    23                             if (_matches) {
       
    24                                 return _matches[0];
       
    25                             } else {
       
    26                                 return _url;
       
    27                             }
       
    28                         },
       
    29                 {% endif %}
       
    30                 height: '{{ player_height }}',
       
    31                 url_transform: function(url) {
       
    32                     // Adaptation to jwplayer 6
       
    33                     if(url.substr(url.length - 4).toLowerCase()=='.flv'){
       
    34                         return url.replace('/ddc_player/video/','/ddc_player/flv:video/');
       
    35                     }
       
    36                     return url.replace('/ddc_player/video/','/ddc_player/mp4:video/');
       
    37                 },
       
    38                 autostart: {% if autostart %} true {% else %} false {% endif %},
       
    39                 default_type: 'AdaptivePlayer'
       
    40             }
       
    41           {% if polemic %}
       
    42             ,{
       
    43                 type: "Polemic",
       
    44               {% if polemic == 'all' %}
       
    45                 annotation_type: false,
       
    46               {% else %}
       
    47                      annotation_type: [
       
    48                      {% for type in polemic_annotation_types %}
       
    49                          {% if type == polemic_annotation_types|last %}
       
    50                              "{{type}}"
       
    51                          {% else %}
       
    52                              "{{type}}",
       
    53                          {% endif %}
       
    54                      {% endfor %}],
       
    55               {% endif %}
       
    56                 max_elements: {{ polemic__max_elements }},
       
    57                 defaultcolor: "#{{ polemic_defaultColor }}",
       
    58                 foundcolor: "#{{ polemic_foundColor }}",
       
    59               {% if polemics_list %}
       
    60                 polemics : {{ polemics_list|safe }}
       
    61               {% else %}
       
    62                 polemics : [
       
    63                                 {
       
    64                                     "name" : "OK",
       
    65                                     "keywords" : [ "++" ],
       
    66                                     "color" : "#{{ polemic_okColor }}"
       
    67                                 },
       
    68                                 {
       
    69                                     "name" : "KO",
       
    70                                     "keywords" : [ "--" ],
       
    71                                     "color" : "#{{ polemic_koColor }}"
       
    72                                 },
       
    73                                 {
       
    74                                     "name" : "REF",
       
    75                                     "keywords" : [ "==", "http://" ],
       
    76                                     "color" : "#{{ polemic_refColor }}"  
       
    77                                 },
       
    78                                 {
       
    79                                     "name" : "Q",
       
    80                                     "keywords" : [ "?" ],
       
    81                                     "color" : "#{{ polemic_qColor }}"
       
    82                                 }
       
    83                             ]
       
    84                        {% endif %}
       
    85             }
       
    86         {% endif %}
       
    87         {% if sparkline %}
       
    88             ,{
       
    89                 type: "Sparkline",
       
    90                 lineColor: "#{{ sparkline_lineColor }}",
       
    91                 fillColor: "#{{ sparkline_fillColor }}",
       
    92             }
       
    93         {% endif %}
       
    94             ,{
       
    95                 type: "Slider"
       
    96             }
       
    97             
       
    98             {% if annotations_list %},{
       
    99                 type: "AnnotationsList",
       
   100                 container: "AnnotationsList_ext",
       
   101                 ajax_url: "{% absurl 'segment_api_empty' resource_name='segments' api_name='1.0' %}{% templatetag openvariable %}media{% templatetag closevariable %}/{% templatetag openvariable %}begin{% templatetag closevariable %}/{% templatetag openvariable %}end{% templatetag closevariable %}",
       
   102                 ajax_granularity : 300000,
       
   103                 default_thumbnail : '{% static "ldt/css/imgs/video_sequence.png" %}',
       
   104                 show_audio: true,
       
   105                 rtmp_streamer: "rtmp://media.iri.centrepompidou.fr/ddc_micro_record/"
       
   106             }{% endif %},{
       
   107                 type: "Controller"
       
   108             }
       
   109             {% if segments %},{
       
   110                 type: "Segments",
       
   111                 annotation_type: [
       
   112                      {% for type in segments_annotation_types %}
       
   113                          {% if type == segments_annotation_types|last %}
       
   114                              "{{type}}"
       
   115                          {% else %}
       
   116                              "{{type}}",
       
   117                          {% endif %}
       
   118                      {% endfor %}]
       
   119             }
       
   120             {% endif %}
       
   121             {% if multisegments %},{
       
   122                 type: "MultiSegments"
       
   123             }
       
   124             {% endif %}
       
   125             {% if annotation %},{
       
   126                 type: "Annotation",
       
   127                 start_minimized: true,
       
   128                 site_name : "Lignes de Temps",
       
   129                 annotation_type: ["chap","découpage"]
       
   130             }
       
   131             {% endif %}
       
   132             {% if tweet %},{
       
   133                 type: "Tweet",
       
   134                 hide_timeout: 5000
       
   135             }
       
   136             {% endif %}
       
   137             {% if createannotation %},{
       
   138                 type: "CreateAnnotation",
       
   139                 api_endpoint_template: "{% absurl 'api_dispatch_list' resource_name='annotations' api_name='1.0' %}",
       
   140                 after_send_timeout: 8000,
       
   141                 {% if tag_titles or tag_titles == "" %}
       
   142                        tag_titles : tag_titles_array,
       
   143                    {% else %}
       
   144                     tag_titles : false,
       
   145                    {% endif %}
       
   146                 show_mic_record: {% if show_mic_record %}true{% else %}false{% endif %},
       
   147                 close_after_send: false,
       
   148                 slice_annotation_type: {% if createannotation_annotation_types %}
       
   149                     [{% for type in createannotation_annotation_types %}
       
   150                          {% if forloop.last %} "{{type}}"
       
   151                          {% else %} "{{type}}",
       
   152                          {% endif %}
       
   153                      {% endfor %}]
       
   154                    {% else %}
       
   155                    ["chap","découpage"]
       
   156                    {% endif %},
       
   157                 creator_name: '{{request.user.username}}',
       
   158                 creator_avatar: '{% thumbnail request.user.image "48x48" format="PNG" crop="center" as im %}{{ im.url }}{% endthumbnail %}' || "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
       
   159                 {% if not createannotation_polemics %}polemics: []{% endif %}
       
   160             }{% endif %}
       
   161             {% if slideshare %},{
       
   162                 type: "Slideshare",
       
   163                 container: "Slideshare_ext",
       
   164                 embed_width: 400,
       
   165                 embed_height: 334,
       
   166                 annotation_type: "slide"
       
   167             }
       
   168             {% endif %},{
       
   169                 type: "Mediafragment"
       
   170             }
       
   171             {% if social %},{
       
   172                 type: "Social",
       
   173                 container: "Social_ext",
       
   174                 show_url: {% if show_url %}true{% else %}false{% endif %},
       
   175                 show_twitter: {% if show_twitter %}true{% else %}false{% endif %},
       
   176                 show_fb: {% if show_fb %}true{% else %}false{% endif %},
       
   177                 show_gplus: {% if show_gplus %}true{% else %}false{% endif %},
       
   178                 show_mail: {% if show_mail %}true{% else %}false{% endif %},
       
   179                 url: document.location.href.replace(/#.*$/,""),
       
   180                 text: document.title
       
   181             }
       
   182            {% endif %}
       
   183            
       
   184            {% if tagcloud %},{
       
   185                 type: "Tagcloud"
       
   186             }
       
   187            {% endif %}
       
   188         ]
       
   189     };
       
   190 {% endblock mdplayer_config %}
       
   191 {% analytics %}