]> _ Git - fluidbook_tools.git/commitdiff
wait #7211 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Nov 2024 17:44:59 +0000 (18:44 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Nov 2024 17:44:59 +0000 (18:44 +0100)
src/Links/VideoLink.php

index ed98e509467c84eb729c654e8953202e0eb5dedc..16552a3090aa98bdf693ebbed742b6c28c773c69 100644 (file)
@@ -7,26 +7,32 @@ use Cubist\Util\Url;
 use Fluidbook\Tools\Compiler\CompilerInterface;
 use Illuminate\Support\Facades\Cache;
 
-class VideoLink extends Link {
+class VideoLink extends Link
+{
     public $defaultZIndex = 50;
     public $backgroundColor = '#000000';
+    public $repeat = -1;
 
 
-    public static function addVideoJS($compiler) {
+    public static function addVideoJS($compiler)
+    {
         $compiler->addVideoJs();
     }
 
-    public function getClasses() {
+    public function getClasses()
+    {
         return array_merge(['videoLink'], parent::getClasses());
     }
 
-    public function getCSS() {
+    public function getCSS()
+    {
         $res = parent::getCSS();
         $res .= 'background-color:' . $this->backgroundColor . ';';
         return $res;
     }
 
-    public function getHTMLContent() {
+    public function getHTMLContent()
+    {
         if (!Url::isDistant($this->to)) {
             $this->copyExternalFile($this->to, true);
 
@@ -42,7 +48,8 @@ class VideoLink extends Link {
         return self::makeVideoTag($this, $w, $h, $this->compiler);
     }
 
-    public static function makeVideoTag($linkDatas, $w = null, $h = null, $compiler = null) {
+    public static function makeVideoTag($linkDatas, $w = null, $h = null, $compiler = null)
+    {
         static::addVideoJS($compiler);
 
         $attributes = static::getVideoAttributes($linkDatas, $w, $h, $compiler);
@@ -64,7 +71,8 @@ class VideoLink extends Link {
      * @param $compiler CompilerInterface
      * @return array
      */
-    public static function getVideoAttributes($data, $w = null, $h = null, $compiler = null) {
+    public static function getVideoAttributes($data, $w = null, $h = null, $compiler = null)
+    {
         $attr['name'] = VideoPopupLink::getBasename($data->to);
         $attr['stats-name'] = $attr['name'];
         $attr['stats-type'] = 'video';
@@ -79,6 +87,7 @@ class VideoLink extends Link {
         $attr['hidelinksonplay'] = $data->hidelinksonplay;
         $attr['link-id'] = $data->uid;
         $attr['backgroundcolor'] = $data->backgroundColor ?? '#000000';
+        $attr['repeat'] = $data->repeat??-1;
 
         if (!is_null($w) && !is_null($h)) {
             $attr['width'] = $w;