function smarty_cms_function_Video($params, &$smarty)
{
    $vid = new Video();
    if (isset($params['url'])) {
        $vid->setVideoUrl($params['url']);
    }
    if (isset($params['width'])) {
        $vid->setWidth((int) $params['width']);
    }
    if (isset($params['height'])) {
        $vid->setHeight((int) $params['height']);
    }
    return $vid->getHtml();
}
 public function parseVideo($videoObject)
 {
     $video = new Video();
     $video->setFileId($videoObject->file_id);
     $video->setWidth($videoObject->width);
     $video->setHeight($videoObject->height);
     $video->setDuration($videoObject->duration);
     if (property_exists($videoObject, 'thumb')) {
         $video->setThumb($this->parsePhotoSize($videoObject->thumb));
     }
     if (property_exists($videoObject, 'mime_type')) {
         $video->setMimeType($videoObject->mime_type);
     }
     if (property_exists($videoObject, 'file_size')) {
         $video->setFileSize($videoObject->file_size);
     }
     return $video;
 }