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:
@@ -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'=>''),
|
||||
|
||||
//
|
||||
|
||||
);
|
||||
|
@@ -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.
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user