private function embed_video($url, $autoplay = 0, $params = '') { $regex = "/ (width|height)=\"[0-9\\%]*\"/"; require_once 'AutoEmbed.php'; $autoEmbed = new AutoEmbed(); $embed_code = $autoEmbed->get_html($url, array('width' => '100%', 'height' => '100%', 'autoplay' => $autoplay, 'params' => $params)); if (!$embed_code) { return '<strong>' . __('Error: Invalid URL!', 'respvid') . '</strong>'; } $this->document->addScript('view/plugins/fitvids/jquery.fitvids.js'); return preg_replace($regex, '', $embed_code); }