8 public function preFilter($html, $config, $context) {
9 $pre_regex =
'#<object[^>]+>.+?'.
10 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s';
11 $pre_replace =
'<span class="youtube-embed">\1</span>';
12 return preg_replace($pre_regex, $pre_replace, $html);
16 $post_regex =
'#<span class="youtube-embed">((?:v|cp)/[A-Za-z0-9\-_=]+)</span>#';
17 return preg_replace_callback($post_regex, array($this,
'postFilterCallback'), $html);
21 return str_replace(
'--',
'--', $url);
26 return '<object width="425" height="350" type="application/x-shockwave-flash" '.
27 'data="http://www.youtube.com/'.$url.
'">'.
28 '<param name="movie" value="http://www.youtube.com/'.$url.
'"></param>'.
30 '<embed src="http://www.youtube.com/'.$url.
'"'.
31 'type="application/x-shockwave-flash"'.
32 'wmode="transparent" width="425" height="350" />'.