From 8458da560e69cf066db82e6e66b2a73fba89a5f5 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 1 Oct 2015 11:02:24 -0700 Subject: [PATCH] Youtube embed code now uses embed-responsive when Bootstrap is found. Closed-Captions now display in their respective languages. (when active) --- e107_handlers/e_parse_class.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 0a09907d4..2d8f43a9e 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -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 = ''; + $video = ''; if($thumb == 'tag') @@ -3326,13 +3336,15 @@ class e_parser { return $thumbSrc; } + + if($thumb == 'video') { - return '
'.$video.'
'; + return '
'.$video.'
'; } - return '
'.$video.'
'; + return '
'.$video.'
'; } @@ -3352,7 +3364,7 @@ class e_parser } $video = ''; - return '
'.$video.'
'; + return '
'.$video.'
'; } if($type == 'mp4') //TODO FIXME