mirror of
https://github.com/e107inc/e107.git
synced 2025-06-04 09:54:56 +02:00
Youtube embed code now uses embed-responsive when Bootstrap is found. Closed-Captions now display in their respective languages. (when active)
This commit is contained in:
parent
54402fe2b2
commit
8458da560e
@ -3290,15 +3290,25 @@ class e_parser
|
||||
$key = substr($k,8);
|
||||
$ytpref[$key] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
unset($ytpref['bbcode_responsive']); // do not include in embed code.
|
||||
|
||||
if(!empty($ytpref['cc_load_policy']))
|
||||
{
|
||||
$ytpref['cc_lang_pref'] = e_LAN; // switch captions with chosen user language.
|
||||
}
|
||||
|
||||
$ytqry = http_build_query($ytpref);
|
||||
|
||||
|
||||
$defClass = (deftrue('BOOTSTRAP')) ? "embed-responsive embed-responsive-16by9" : "video-responsive"; // levacy backup.
|
||||
|
||||
|
||||
if($type == 'youtube')
|
||||
{
|
||||
// $thumbSrc = "https://i1.ytimg.com/vi/".$id."/0.jpg";
|
||||
$thumbSrc = "http://i1.ytimg.com/vi/".$id."/mqdefault.jpg";
|
||||
$video = '<iframe width="560" height="315" src="//www.youtube.com/embed/'.$id.'?'.$ytqry.'" style="background-size: 100%;background-image: url('.$thumbSrc.');border:0px" allowfullscreen></iframe>';
|
||||
$video = '<iframe class="embed-responsive-item" width="560" height="315" src="//www.youtube.com/embed/'.$id.'?'.$ytqry.'" style="background-size: 100%;background-image: url('.$thumbSrc.');border:0px" allowfullscreen></iframe>';
|
||||
|
||||
|
||||
if($thumb == 'tag')
|
||||
@ -3326,13 +3336,15 @@ class e_parser
|
||||
{
|
||||
return $thumbSrc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($thumb == 'video')
|
||||
{
|
||||
return '<div class="video-responsive video-thumbnail thumbnail">'.$video.'</div>';
|
||||
return '<div class="'.$defClass.' video-thumbnail thumbnail">'.$video.'</div>';
|
||||
}
|
||||
|
||||
return '<div class="video-responsive '.vartrue($parm['class']).'">'.$video.'</div>';
|
||||
return '<div class="'.$defClass.' '.vartrue($parm['class']).'">'.$video.'</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -3352,7 +3364,7 @@ class e_parser
|
||||
}
|
||||
|
||||
$video = '<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list='.$id.'" style="border:0" allowfullscreen></iframe>';
|
||||
return '<div class="video-responsive '.vartrue($parm['class']).'">'.$video.'</div>';
|
||||
return '<div class="'.$defClass.' '.vartrue($parm['class']).'">'.$video.'</div>';
|
||||
}
|
||||
|
||||
if($type == 'mp4') //TODO FIXME
|
||||
|
Loading…
x
Reference in New Issue
Block a user