1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Added a pref to make youtube bbcodes responsive. (ie. behave like media-manager youtube videos)

This commit is contained in:
Cameron
2014-10-22 17:59:15 -07:00
parent a3bb284031
commit 557e0111a5
2 changed files with 22 additions and 11 deletions

View File

@@ -729,7 +729,8 @@ class media_admin_ui extends e_admin_ui
'youtube_showinfo' => array('title'=> "Show Video Info", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
'youtube_cc_load_policy' => array('title'=> "Show Closed-Captions by default", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
'youtube_modestbranding' => array('title'=> "Use Modest Branding", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
'youtube_bbcode_responsive' => array('title'=> "Make the YouTube bbcode responsive", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
//
);

View File

@@ -333,17 +333,27 @@ class bb_youtube extends e_bb_base
$class = "bbcode ".e107::getBB()->getClass('youtube'); // consistent classes across all themes.
$ret = "<!-- Start YouTube-".$dimensions."-".$yID." -->\n"; // <-- DO NOT MODIFY - used for detection by bbcode handler.
$ret .= '<object class="'.$class.'" width="'.$params['w'].'" height="'.$params['h'].'" >
<param name="movie" value="'.$url.'" />
<param name="allowFullScreen" value="'.$fscr.'" />
<param name="allowscriptaccess" value="always" />
<param name="wmode" value="transparent" />
';
// Not XHTML - but needed for compatibility.
$ret .= '<embed class="'.$class.'" src="'.$url.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="'.$fscr.'" wmode="transparent" width="'.$params['w'].'" height="'.$params['h'].'" />';
$ret .= '</object>';
if(e107::getConfig()->get('youtube_bbcode_responsive') == 1) // Responsive Mode.
{
$ret .= e107::getParser()->toVideo($yID.".youtube");
}
else // Legacy Mode.
{
$ret .= '<object class="'.$class.'" width="'.$params['w'].'" height="'.$params['h'].'" >
<param name="movie" value="'.$url.'" />
<param name="allowFullScreen" value="'.$fscr.'" />
<param name="allowscriptaccess" value="always" />
<param name="wmode" value="transparent" />
';
// Not XHTML - but needed for compatibility.
$ret .= '<embed class="'.$class.'" src="'.$url.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="'.$fscr.'" wmode="transparent" width="'.$params['w'].'" height="'.$params['h'].'" />';
$ret .= '</object>';
}
$ret .= "<!-- End YouTube -->"; // <-- DO NOT MODIFY.