]> _ Git - fluidbook-toolbox.git/commitdiff
#7232
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 1 Apr 2025 09:45:54 +0000 (11:45 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 1 Apr 2025 09:45:54 +0000 (11:45 +0200)
app/Fluidbook/Link/Link.php
app/Models/Traits/PublicationSettings.php

index cbdc0b76492979f08dc32a41aff4ed47d10e9958..fce158fac00c6b6d9493c51d1759dff15938b94d 100644 (file)
@@ -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);
 
 
index d1ae9a5a35c5a8c37eaf3ea912b30d5e2f25abb7..e3be38d58e5c5691b2d20c1bd12537e97978e60c 100644 (file)
@@ -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'));