templates/module/Video/__video.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.     {{ include('includes/backend-kopf.html.twig') }}
  3.     {% set tabContentArray = {1: 'Optional', 2: 'Video'} %}
  4.     {% set tab = 1 %}
  5.     <div id="content">        
  6.             {% if tabContentArray is defined and tab in tabContentArray|keys %}
  7.                 {{ admin_tabs(tab, tabContentArray) | raw }}
  8.             {% endif %} 
  9.             <section class="tabContent">
  10.                 <p class="hl">Optionale Einstellung:</p>
  11.                 {% set element = 'artikel' %}
  12.                 <div id="{{ element }} ">
  13.                     {{ pimcore_multiselect(element, {
  14.                             'width': 200,
  15.                             'height': 100,
  16.                             'store': [
  17.                                 ['abstand-top', 'Abstand nach oben'],
  18.                                 ['abstand-bottom', 'Abstand nach unten']
  19.                             ]
  20.                         }) }}
  21.                 </div>
  22.             </section>
  23.             {% if tabContentArray is defined and 2 in tabContentArray|keys %}
  24.                 {{ admin_tabs(2, tabContentArray) | raw }}
  25.                 <section class="tabContent">
  26.                     <table border="0" cellspacing="0" cellpadding="0"><tr><td>
  27.                             <div style="padding:7px;margin-bottom:25px; background-color:#74b9d9;color:#ffffff;"> Video Konfiguration</div>
  28.                             <div style="width:100%;">
  29.                                 <div style="padding-left:37px;margin-bottom:4px;margin-top:8px;">Bitte wählen Sie:</div>
  30.                                 <div style="padding-left:37px;margin-bottom:10px;">
  31.                                     {% if pimcore_select('videoFormatSelect').isEmpty() %}
  32.                                         {% do pimcore_select('videoFormatSelect').setDataFromResource('---') %}
  33.                                     {% endif %}
  34.                                       {{ pimcore_select("videoFormatSelect", {
  35.                                             "store": [
  36.                                                 ["videodatei", "Video-Datei"],
  37.                                                 ["youtube", "Youtube"]
  38.                                             ],
  39.                                             "reload" : true
  40.                                         }) }}
  41.                                 </div>
  42.                                 {% set AusgabevideoFormatSelect = pimcore_select("videoFormatSelect").getData() %}
  43.                                  {% set youtube = AusgabevideoFormatSelect == 'youtube' ? 'block' : 'none' %}
  44.                                 <div style="display:{{ youtube }};">
  45.                                     <div style="padding-left:37px;margin-bottom:4px;margin-top:30px;">Bitte Youtube Video-Key in das Feld übertragen:</div>
  46.                                     <div class="schreiben"><span class="parentbox">
  47.                                         {{ pimcore_input("youtubeKey", {'width': 540, "height": 25}) }}
  48.                                         </span></div>
  49.                                     <br /><br />
  50.                                 </div>
  51.                                  {% set videodatei = AusgabevideoFormatSelect == 'videodatei' ? 'block' : 'none' %}
  52.                                 <div style="display:{{ videodatei }}">
  53.                                     <div style="padding-left:37px;margin-bottom:4px;margin-top:30px;">Video 'mp4' - Format:</div>
  54.                                     <div class="dragdrop"><span class="parentbox">
  55.                                     {{ pimcore_relation("PfadMp4",{
  56.                                             "width": 520,
  57.                                             "reload": true
  58.                                         }) }}</span></div>
  59.                                     <br /><br />
  60.                                     <div style="padding-left:37px;margin-bottom:4px;">Video 'webm' - Format:</div>
  61.                                     <div class="dragdrop"><span class="parentbox">
  62.                                     {{ pimcore_relation("PfadWebm",{
  63.                                             "width": 520,
  64.                                             "reload": true
  65.                                         }) }}
  66.                                     </span></div>
  67.                                     <br /><br /><br /><hr /><br /><br />
  68.                                     <div style="padding-left:37px;margin-bottom:4px;">Video Startbild (2400 x 1360 Pixel):</div>
  69.                                     <div style="width:520px;">
  70.                                         <div style="float:left;margin-bottom:10px;" class="dragimage"><span class="parentbox">
  71.                                             {{ pimcore_image("posterImage", {
  72.                                                 "width": 100,
  73.                                                 "height": 67,
  74.                                                 "hidetext": true,
  75.                                                 "thumbnail": "singleImage-edm"
  76.                                             }) }}
  77.                                             </span>
  78.                                         </div>
  79.                                     </div>
  80.                                 </div>
  81.                         </td></tr>
  82.                 </table>
  83.                 <br /><br /><br /><br />
  84.             </section>
  85.             {% endif %}
  86.     </div>
  87.     {{ include('includes/backend-fuss.html.twig') }}
  88. {% else %}
  89.     {% set abstand_top_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-top') == true)? ' abstand-top' : '' %}
  90.     {% set abstand_bottom_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-bottom') == true)? ' abstand-bottom' : '' %}
  91.     {% set abstandClasses = abstand_top_class ~ abstand_bottom_class %}
  92.     {% set IDself = document.getId() %}
  93.     <div class="module-video constrainer-inner edgepadding {{ abstandClasses }}">
  94.         <div class="video-wrp">
  95.             <div data-video="{{ IDself }}">
  96.             <div class="video-item">
  97.                  {% set AusgabevideoFormatSelect = pimcore_select("videoFormatSelect").getData() %}
  98.                 {% if AusgabevideoFormatSelect != "---" %}
  99.                     {% if AusgabevideoFormatSelect == "youtube" %}
  100.                         <iframe class="videoextern" width="1600" height="900" 
  101.                                 src="https://www.youtube.com/embed/{{ pimcore_input('youtubeKey') }}?rel=0" frameborder="0" allowfullscreen></iframe>
  102.                     {% endif %}
  103.                     {% if AusgabevideoFormatSelect == "videodatei" %}
  104.                         {% set thumbnail = pimcore_image("posterImage").getThumbnail("videoposter") %}
  105.                         <video class="videoextern" id='videoplayer_{{ IDself }}' preload='metadata' controls poster="{{ thumbnail }}">
  106.                             <source src="{{ bugfiximageurl }} {{ pimcore_relation("PfadMp4").getFullPath()|trim }}" type='video/mp4' />
  107.                             <source src="<?=$bugfiximageurl?>{{ pimcore_relation("PfadWebm").getFullPath()|trim }}" type='video/webm' />
  108.                         </video>
  109.                     {% endif %}
  110.                 {% endif %}
  111.             </div>
  112.             
  113.             </div>
  114.         </div>
  115.     </div>
  116.     {% if AusgabevideoFormatSelect == "videodatei" %}
  117.         <script>
  118.             //------------------------------------------------------------------------------------------------
  119.             // Video einbinden
  120.             //------------------------------------------------------------------------------------------------
  121.             (function () {
  122.                 var video = $("#videoplayer_{{ IDself }}");
  123.                 var windowObj = $(window);
  124.                 if (typeof selt === 'undefined') {
  125.                     selt = {
  126.                         modules: {}
  127.                     };
  128.                 } else if (!selt.modules) {
  129.                     selt.modules = {};
  130.                 }
  131.                 selt.modules[moduleName] = {
  132.                     name: moduleName,
  133.                     init: function () {
  134.                         video.on("loadedmetadata", onLoadMetaData);
  135.                         windowObj.resize(onResizeWindow);
  136.                     }
  137.                 };
  138.                 function onResizeWindow() {
  139.                     resizeVideo(video[0]);
  140.                 }
  141.                 function onLoadMetaData(e) {
  142.                     resizeVideo(e.target);
  143.                 }
  144.                 function resizeVideo(videoObject) {
  145.                     var percentWidth = videoObject.clientWidth * 100 / videoObject.videoWidth;
  146.                     var videoHeight = videoObject.videoHeight * percentWidth / 100;
  147.                     video.height(videoHeight);
  148.                 }
  149.             }());//EOS
  150.         </script>
  151.     {% endif %}
  152. {% endif %}