]> _ Git - fluidbook_tools.git/commitdiff
wait #8028 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 27 Feb 2026 16:20:52 +0000 (17:20 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 27 Feb 2026 16:20:52 +0000 (17:20 +0100)
src/Links/WebVideoLink.php

index 4b93c3b7369023c73308068298855b73f5691991..2befb25dc40654b00948cfc80b24814749eaf2ab 100644 (file)
@@ -101,7 +101,7 @@ class WebVideoLink extends VideoLink
     public function getHTMLContent()
     {
         if (!self::supportVideoJS($this->video_service)) {
-            return self::getEmbed($this);
+            return self::getEmbed($this, $this->compiler, null, null);
         }
 
         $w = round($this->width * $this->getCssScale());
@@ -110,7 +110,7 @@ class WebVideoLink extends VideoLink
         return self::makeVideoTag($this, $w, $h, $this->compiler);
     }
 
-    public static function getEmbed($link, $width = null, $height = null)
+    public static function getEmbed($link, $compiler = null, $width = null, $height = null)
     {
         if (null === $width) {
             $width = $link->width;
@@ -118,10 +118,10 @@ class WebVideoLink extends VideoLink
         if (null === $height) {
             $height = $link->height;
         }
-        return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link) . '" frameborder="0" allowfullscreen allow="autoplay; fullscreen"></iframe>';
+        return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link, $compiler) . '" frameborder="0" allowfullscreen allow="autoplay; fullscreen"></iframe>';
     }
 
-    public static function getEmbedURL($data)
+    public static function getEmbedURL($data, $compiler)
     {
         $muted = (!$data->video_sound_on) ? '1' : '0';
         $autoplay = $data->video_auto_start ? '1' : '0';
@@ -154,7 +154,7 @@ class WebVideoLink extends VideoLink
                 }
                 return $url;
             default:
-                return $data->to;
+                return $compiler->shortenURL($data->to);
         }
     }
 
@@ -164,7 +164,7 @@ class WebVideoLink extends VideoLink
         if (self::supportVideoJS($link->video_service)) {
             return parent::makeVideoTag($link, $width, $height, $compiler);
         }
-        return self::getEmbed($link);
+        return self::getEmbed($link, $compiler);
     }
 
     protected static function supportVideoJS($service)