• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/note/source/parser.php
  • Класс: BitrixLandingNoteSourceParser
  • Вызов: Parser::getVideoContent
static function getVideoContent(string $videoSrc): ?array
{
	if (preg_match('#^//www.youtube.com/embed/([^?]+)#i', $videoSrc, $matches))
	{
		$ytCode = $matches[1];

		return [
			'src' => $videoSrc,
			'source' => 'https://www.youtube.com/watch?v=' . $ytCode,
			'preview' => '//img.youtube.com/vi/' .$ytCode . '/sddefault.jpg'
		];
	}

	return null;
}