From 666dc076066a0915b7f7c5c337dff57c38a73633 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 26 Nov 2024 18:44:59 +0100 Subject: [PATCH] wait #7211 @1 --- src/Links/VideoLink.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Links/VideoLink.php b/src/Links/VideoLink.php index ed98e50..16552a3 100644 --- a/src/Links/VideoLink.php +++ b/src/Links/VideoLink.php @@ -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; -- 2.39.5