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);
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'));