From 3709ce5da8b8f84c08d57805032c221df58e0c7b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 6 Oct 2021 16:16:20 +0200 Subject: [PATCH] wip #4756 @0.25 --- src/Compiler/Links.php | 26 +++++++++++++++----------- src/Links/VideoLink.php | 1 + 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Compiler/Links.php b/src/Compiler/Links.php index 5a01187..986aacf 100644 --- a/src/Compiler/Links.php +++ b/src/Compiler/Links.php @@ -402,19 +402,23 @@ trait Links return $fixed; } + public function getVideosFormats() + { + return ['mp4', 'jpg']; + } + public function copyLinkFile($source, $dest, $video = false) { -// $types = $this->getVideosFormats(); -// if ($video) { -// wsTools::encodeWebVideos($origDir . $source, null, true); -// $e = explode('.', $source); -// array_pop($e); -// $base = implode('.', $e); -// $source = array(); -// foreach ($types as $type) { -// $source[] = $base . '.' . $type; -// } -// } + $types = $this->getVideosFormats(); + if ($video) { + $e = explode('.', $source); + array_pop($e); + $base = implode('.', $e); + $source = array(); + foreach ($types as $type) { + $source[] = $base . '.' . $type; + } + } if (!is_array($source)) { $source = array($source); diff --git a/src/Links/VideoLink.php b/src/Links/VideoLink.php index bb9c18c..0bd2052 100644 --- a/src/Links/VideoLink.php +++ b/src/Links/VideoLink.php @@ -31,6 +31,7 @@ class VideoLink extends Link { if (!Url::isDistant($this->to)) { $this->copyExternalFile($this->to, true); + } $w = round($this->width * $this->getCssScale()); -- 2.39.5