From: Vincent Vanwaelscappel Date: Tue, 1 Apr 2025 09:45:54 +0000 (+0200) Subject: #7232 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2d7a4ff2dd1a6e351f74ee3f24efb71171212970;p=fluidbook-toolbox.git #7232 --- diff --git a/app/Fluidbook/Link/Link.php b/app/Fluidbook/Link/Link.php index cbdc0b764..fce158fac 100644 --- a/app/Fluidbook/Link/Link.php +++ b/app/Fluidbook/Link/Link.php @@ -102,40 +102,40 @@ class Link extends \Fluidbook\Tools\Links\Link break; } case Link::WEBVIDEO: - if ($compiler->getSetting('webvideoAsLocal', false)) { - if (!isset($init['video_service'])) { - return parent::getInstance($id, $init, $compiler); - } - switch ($init['video_service']) { - case 'youtube': - $url = 'https://www.youtube.com/watch?v=' . $init['to']; - break; - case 'dailymotion': - $url = 'https://www.dailymotion.com/video/' . $init['to']; - break; - case 'vimeo': - $url = 'https://www.vimeo.com/' . $init['to']; - break; - default: - break; - } - if (isset($url)) { - $file = YoutubeDL::downloadVideo($url, protected_path('youtubedl')); - $file = new \SplFileInfo($file); - } - if (isset($file) && file_exists($file->getPathname())) { - $init['type'] = Link::VIDEO; - $init['to'] = $file->getFilename(); - $init['video_sound_on'] = true; - $init['video_controls'] = true; - $init['video_loop'] = false; - $dest = $compiler->getWorkingDir() . $file->getFilename(); - if (file_exists($dest)) { - unlink($dest); - } - symlink($file->getPathname(), $dest); - } - } +// if ($compiler->getSetting('webvideoAsLocal', false)) { +// if (!isset($init['video_service'])) { +// return parent::getInstance($id, $init, $compiler); +// } +// switch ($init['video_service']) { +// case 'youtube': +// $url = 'https://www.youtube.com/watch?v=' . $init['to']; +// break; +// case 'dailymotion': +// $url = 'https://www.dailymotion.com/video/' . $init['to']; +// break; +// case 'vimeo': +// $url = 'https://www.vimeo.com/' . $init['to']; +// break; +// default: +// break; +// } +// if (isset($url)) { +// $file = YoutubeDL::downloadVideo($url, protected_path('youtubedl')); +// $file = new \SplFileInfo($file); +// } +// if (isset($file) && file_exists($file->getPathname())) { +// $init['type'] = Link::VIDEO; +// $init['to'] = $file->getFilename(); +// $init['video_sound_on'] = true; +// $init['video_controls'] = true; +// $init['video_loop'] = false; +// $dest = $compiler->getWorkingDir() . $file->getFilename(); +// if (file_exists($dest)) { +// unlink($dest); +// } +// symlink($file->getPathname(), $dest); +// } +// } return parent::getInstance($id, $init, $compiler); diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index d1ae9a5a3..e3be38d58 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -1168,9 +1168,9 @@ trait PublicationSettings protected function _video() { $this->addSettingField('section_videos', FormSection::class, $this->__('Vidéos')); - $this->addSettingField('webvideoAsLocal', Checkbox::class, $this->__('Intégrer les webvidéos en local'), [ - 'default' => false, - ]); +// $this->addSettingField('webvideoAsLocal', Checkbox::class, $this->__('Intégrer les webvidéos en local'), [ +// 'default' => false, +// ]); $this->addSettingField('', FormSeparator::class); $this->addSettingField('brightcovePlayerId', LongText::class, $this->__('Identifiant du player Brightcove')); $this->addSettingField('brightcovePlayerSecret', LongText::class, $this->__('Secret du player Brightcove'));