$this->forms['slideshow'] = ['label' => __('Slideshow'),
'fieldsnames' => ['inlineSlideshowLibrary', 'popupSlideshowLibrary', '|', 'slideshowCaptionSize', '|', 'inlineSlideshowTransitionDuration', 'inlineSlideshowDuration']];
+ $this->fields['webvideoAsLocal'] = ['type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Intégrer les webvidéos en local')];
$this->fields['mobileVideosPath'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Chemin vers les vidéos'), 'grade' => 5);
$this->fields['brightcovePlayerId'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Id'), 'grade' => 3);
$this->fields['brightcovePlayerSecret'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Secret'), 'grade' => 3);
$this->fields['bigPlayImage'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Image pour le bouton "Big Play"'), 'grade' => 3, 'fileFilter' => $imageExtraFilter];
$this->forms['videos'] = array('label' => __('Vidéos'),
- 'fieldsnames' => array('mobileVideosPath', '|', 'brightcovePlayerId', 'brightcovePlayerSecret', '|', 'bigPlayImage'));
+ 'fieldsnames' => array('webvideoAsLocal', '|', 'mobileVideosPath', '|', 'brightcovePlayerId', 'brightcovePlayerSecret', '|', 'bigPlayImage'));
//.
$this->fields['audioPlayerTheme'] = ['type' => 'combo', 'default' => 'native', 'editable' => true, 'label' => __('Apparence du lecteur audio'), 'datas' => [__('Apparence native du navigateur') => 'native', __('Zone cliquable invisible') => 'invisible', __('Red Bull') => 'redbull']];
$this->forms['audio'] = ['label' => __('Lecteur audio'),
$init['scorm'] = self::isScorm($init);
$init['to'] = self::replaceCustomURL($init['to']);
+ if ($init['type'] == 10 && $compiler->book->parametres->webvideoAsLocal) {
+ switch ($init['video_service']) {
+ case 0:
+ $url = 'https://www.youtube.com/watch?v=' . $init['to'];
+ break;
+ case 1:
+ $url = 'https://www.dailymotion.com/video/' . $init['to'];
+ break;
+ case 2:
+ $url = 'https://www.vimeo.com/' . $init['to'];
+ break;
+ default:
+ break;
+ }
+ if (isset($url)) {
+ $fname = commonTools::_youtubedl($url);
+ $file = '/data/extranet/www/cache/youtubedl/' . $fname;
+ }
+ if (isset($file) && file_exists($file)) {
+ $init['type'] = 4;
+ $init['to'] = $fname;
+ $init['video_sound_on'] = true;
+ $init['video_controls'] = true;
+ copy($file, $compiler->wdir . $fname);
+ }
+
+
+ }
+
switch ($init['type']) {
case 1:
case 2:
class webVideoLink extends videoLink
{
+
public static function getVideoAttributes($data, $w = null, $h = null, $compiler = null)
{
$attributes = parent::getVideoAttributes($data, $w, $h, $compiler);
// Todo: add local version of script...
// Note: this plugin doesn't seem to work currently so it is not included
//$compiler->addJs('https://rawgit.com/benjipott/video.js-dailymotion/master/dist-test/videojs-dailymotion.js');
+ //$compiler->addJs('https://rawgit.com/benjipott/video.js-dailymotion/master/dist-test/videojs-dailymotion.js');
$setup = [
// 'techOrder' => ['dailymotion'],
// 'sources' => [