Browse Source

fix tac yt

kevin 3 years ago
parent
commit
9cc2fbf333

+ 6 - 1
web/themes/custom/popsu_colloque/css/components/components.scss

@@ -14,4 +14,9 @@
 @import "btn/all_btn.scss";
 @import "footer/footer.scss";
 @import "leaflet/custom_leaflet.scss";
-@import "paragraph/paragraphs.scss";
+@import "paragraph/paragraphs.scss";
+
+
+.video-embed-field-provider-youtube.video-embed-field-responsive-video{
+    display: flex;
+}

+ 10 - 1
web/themes/custom/popsu_colloque/template/fields/video-embed-iframe.html.twig

@@ -4,4 +4,13 @@
  * Display an iframe with alterable components.
  */
 #}
-<iframe{{ attributes }}{% if url is not empty %} title="le direct" src="{{ url }}{% if query is not empty %}?{{ query | url_encode }}{% endif %}{% if fragment is not empty %}#{{ fragment }}{% endif %}"{% endif %}></iframe>
+{# <iframe{{ attributes }}{% if url is not empty %} title="le direct" class="youtube_player" src="{{ url }}{% if query is not empty %}?{{ query | url_encode }}{% endif %}{% if fragment is not empty %}#{{ fragment }}{% endif %}"{% endif %}></iframe> #}
+
+{% if url is not empty %}
+{% set id = url|split('v=')|last %}
+{% set id = id|split('&')|first %}
+{% set id = id|split('/')|last %}
+
+<div class="youtube_player w-100" width="auto" height="auto" videoID="{{ id }}" theme="light" rel="1" controls="1" showinfo="1" autoplay="0" mute="0"></div>
+
+{% endif %}

+ 7 - 0
web/themes/custom/popsu_colloque/template/html.html.twig

@@ -34,6 +34,8 @@
     <js-placeholder token="{{ placeholder_token }}">
     <script src="https://unpkg.com/scrollreveal@4.0.0/dist/scrollreveal.min.js"></script>
 
+
+   
   </head>
   <body{{ attributes }}>
     {#
@@ -47,5 +49,10 @@
     {{ page }}
     {{ page_bottom }}
     <js-bottom-placeholder token="{{ placeholder_token }}">
+
+    <script type="text/javascript">
+        (tarteaucitron.job = tarteaucitron.job || []).push('youtube');
+    </script>
+
   </body>
 </html>