bbCode element "video" now serves Youtube videos in iFrames instead of Objects. Thanks abrother!
See http://flatpress.org/home/comments.php?entry=entry190112-133621#comment190112-184518
This commit is contained in:
parent
e9fa4c746d
commit
9bd174673b
@ -348,16 +348,12 @@ function do_bbcode_video($action, $attr, $content, $params, $node_object) {
|
||||
$the_url = null;
|
||||
$others = '';
|
||||
switch ($type) {
|
||||
case 'google':
|
||||
$the_url = "http://video.google.com/googleplayer.swf?docid={$query['docid']}";
|
||||
$others = '<param name="FlashVars" value="playerMode=embedded" />';
|
||||
break;
|
||||
case 'youtube':
|
||||
$the_url = "http://youtube.com/v/{$query['v']}";
|
||||
$the_url = "https://www.youtube.com/embed/{$query['v']}";
|
||||
break;
|
||||
case 'default':
|
||||
default:
|
||||
$the_url = null;
|
||||
$the_url = $attr['default'];
|
||||
}
|
||||
if ($the_url) {
|
||||
$width = isset($attr['width'])
|
||||
@ -369,10 +365,8 @@ function do_bbcode_video($action, $attr, $content, $params, $node_object) {
|
||||
$float = isset($attr['float'])
|
||||
? "style=\"float: {$attr['float']}\" "
|
||||
: '';
|
||||
return '<object type="application/x-shockwave-flash" height="'.$height.'" width="'.$width.'" '
|
||||
. $float .'data="'. $the_url .'">'
|
||||
.'<param name="movie" value="'. $the_url .'" />'
|
||||
. $others .'</object>';
|
||||
$videoHtml = '<iframe border="0" style="border:none;" width="'.$width.'" height="'.$height.'" '. $float . ' src="' . $the_url . '" ' . $others . '></iframe>';
|
||||
return $videoHtml;
|
||||
}
|
||||
return '[unsupported video]';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user