From 8bc6119230505da6ed7ec6e5937de9583b416a5e Mon Sep 17 00:00:00 2001
From: Kevin Paxman <kpaxman@uwaterloo.ca>
Date: Wed, 4 Sep 2024 15:06:35 -0400
Subject: [PATCH] ISTWCMS-6863: refactor video to UW standards so it resizes
 properly

---
 .../03-layouts/ofis/ofis-profile.twig         | 27 ++++++++++++-------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/patterns/03-layouts/ofis/ofis-profile.twig b/src/patterns/03-layouts/ofis/ofis-profile.twig
index 0db26b5b..ddd5aaf9 100644
--- a/src/patterns/03-layouts/ofis/ofis-profile.twig
+++ b/src/patterns/03-layouts/ofis/ofis-profile.twig
@@ -41,17 +41,24 @@
   </div>
   {% if ofis_data.profile.video %}
     <div>
-      {% set vid = ofis_data.profile.video|split('?v=')[1] %}
-      {% if vid %}
-        {% set ytembed = 'https://www.youtube.com/embed/' ~ vid %}
-        <iframe width="560" height="315" src="{{ ytembed }}"
-                allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
-                referrerpolicy="strict-origin-when-cross-origin"
-                allowfullscreen></iframe>
-        <div class="ofis-video__link">
-          <a href="{{ ofis_data.profile.video }}">Watch on Youtube</a>
+      <div class="uw-remote-video">
+        {% set vid = ofis_data.profile.video|split('?v=')[1] %}
+        {% if vid %}
+          {% set ytembed = 'https://www.youtube.com/embed/' ~ vid %}
+          <div class="uw-remote-video__video">
+            <div class="uw-media media media--type-uw-mt-remote-video media--view-mode-default">
+              <div class="uw-field uw-field--name-field-media-oembed-video uw-field--type-string uw-field--label-visually_hidden uw-field__items">
+                <div class=uw-field__item">
+                  <iframe class="media-oembed-content" width="200" height="113" src="{{ ytembed }}" aria-label="Remote Video"></iframe>
+                </div>
+              </div>
+            </div>
+          </div>
+        {% endif %}
+        <div class="uw-remote-video__view">
+          <a href="{{ ofis_data.profile.video }}">View on YouTube</a>
         </div>
-      {% endif %}
+      </div>
     </div>
   {% endif %}
 </section>
-- 
GitLab