]> _ Git - fluidbook_tools.git/commitdiff
wait #5839 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 30 Mar 2023 09:37:57 +0000 (11:37 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 30 Mar 2023 09:37:57 +0000 (11:37 +0200)
src/Links/WebVideoLink.php

index 0c6be179966232db8ab9ad8ce5920e077c0b0a18..2cb7d194b4b5e5b3d9d17d55cdc5e3814f32ee88 100644 (file)
@@ -92,10 +92,14 @@ class WebVideoLink extends VideoLink {
         if (null === $height) {
             $height = $link->height;
         }
-        return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link) . '" frameborder="0" allowfullscreen></iframe>';
+        return '<iframe width="' . $width . '" height="' . $height . '" src="' . self::getEmbedURL($link) . '" frameborder="0" allowfullscreen allow="autoplay"></iframe>';
     }
 
     public static function getEmbedURL($data) {
+        $sound = $data->video_sound_on ? '1' : '0';
+        $muted = (!$data->video_sound_on) ? '1' : '0';
+        $autoplay = $data->video_auto_start ? '1' : '0';
+        $loop = $data->video_loop ? '1' : '0';
         switch ($data->video_service) {
             case 0:
             case 'youtube':
@@ -105,7 +109,7 @@ class WebVideoLink extends VideoLink {
                 return 'https://www.dailymotion.com/embed/video/' . $data->to;
             case 2:
             case 'vimeo':
-                return 'https://player.vimeo.com/video/' . $data->to;
+                return 'https://player.vimeo.com/video/' . $data->to . '?autoplay=' . $autoplay . '&loop=' . $loop . '&muted=' . $muted;
             case 3:
             default:
                 return $data->to;