youtu.be
Код обработки новых share-ссылок с youtube.com
/engine/modules/text/Text.class.php
/engine/modules/text/Text.class.php
public function VideoParser($sText) { /** * youtu.be */ $sText = preg_replace( '/<video>http:\/\/(?:www\.|)youtu.be\/([a-zA-Z0-9_\-]+)(&.+)?<\/video>/Ui', '<iframe width="560" height="315" src="http://www.youtube.com/embed/$1?rel=0" frameborder="0" allowfullscreen></iframe>', $sText);
3 комментария