Render a video player.

@param Garp_Db_Table_Row $video A record from a video table
@param array $options Various rendering options
@return mixed
353786
public function video($video = null, array $options = array()) {
        if (!func_num_args()) {
            // provide fluent interface
            return $this;
        }
        if (!$video) {
            throw new InvalidArgumentException(
                __METHOD__ . ' expects parameter 1 to be Garp_Db_Table_Row'
            );
        }
        return $this->render($video, $options);
    }
811604
protected function _renderRepeatedDisplayView($options, $repeaterRows = [])
    {
        $repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);
        // $repeaterRows[0] check allows skipping of block check (used for dummy data)
        if (($repeaterRows && $repeaterBlocks) || (isset($repeaterRows[0]) && $repeaterRows[0] === 0)) {

            // pagination
            if (!empty($options['per_page'])) {
                $pagination = new LengthAwarePaginator($repeaterRows, count($repeaterRows), $options['per_page'], Request::input('page', 1));
                $pagination->setPath(Request::getPathInfo());
                $paginationLinks = PaginatorRender::run($pagination);
                $repeaterRows = array_slice($repeaterRows, (($pagination->currentPage() - 1) * $options['per_page']), $options['per_page'], true);
            } else {
                $paginationLinks = '';
            }
            $options['pagination'] = $paginationLinks;
            $options['links'] = $paginationLinks;
            $options['blocks'] = $repeaterBlocks;
            return parent::_renderRepeatedDisplayView($options, $repeaterRows);
        }
        return '';
    }
455654
public function render(Varien_Object $row)
    {
        $name = trim($this->getColumn()->getNamePattern());
        if (!empty($name)) {
            $nameParams = array_map('trim', array_filter(explode(',', $this->getColumn()->getNameParams())));
            if (count($nameParams)) {
                $params = [$name];
                foreach ($nameParams as $key) {
                    $params[] = $row->getDataUsingMethod($key);
                }

                $name = call_user_func_array([$this, '__'], $params);
            }
            $this->getColumn()->setName($name);
        }

        return parent::render($row);
    }
520881
public function renderFragment($uri, $options = [])
    {
        $strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
        unset($options['strategy']);

        return $this->handler->render($uri, $strategy, $options);
    }
1329070
public function render($options = array())
    {
        $string = $options['string'];
        $data = $options['data'];

        return $this->renderTpl($string, $data);
    }
729540
public function renderTableRow($row)
	{
		$htmlOptions=array();
		if($this->rowHtmlOptionsExpression!==null)
		{
			$data=$this->dataProvider->data[$row];
			$options=$this->evaluateExpression($this->rowHtmlOptionsExpression,array('row'=>$row,'data'=>$data));
			if(is_array($options))
				$htmlOptions = $options;
		}

		if($this->rowCssClassExpression!==null)
		{
			$data=$this->dataProvider->data[$row];
			$class=$this->evaluateExpression($this->rowCssClassExpression,array('row'=>$row,'data'=>$data));
		}
		elseif(is_array($this->rowCssClass) && ($n=count($this->rowCssClass))>0)
			$class=$this->rowCssClass[$row%$n];

		if(!empty($class))
		{
			if(isset($htmlOptions['class']))
				$htmlOptions['class'].=' '.$class;
			else
				$htmlOptions['class']=$class;
		}

		echo CHtml::openTag('tr', $htmlOptions)."\n";
		foreach($this->columns as $column)
			$this->renderDataCell($column, $row);
		echo "</tr>\n";
	}
844843
public function render(array $options = array())
    {
        $url = $this->service->generateEmbedUrl($this);
        $options = array_replace(array(
            'width' => 560,
            'height' => 315,
            'frameborder' => 0,
            'allowfullscreen' => ''
        ), $options);

        $html = <<<HTML
<iframe src="$url" width="{$options['width']}" height="{$options['height']}" frameborder="{$options['frameborder']}" {$options['allowfullscreen']}></iframe>
HTML;
        return $html;
    }
255902
public function fromArray($options)
    {
        if (isset($options['AdMarkerSource'])) {
            Validate::isString($options['AdMarkerSource'], 'options[AdMarkerSource]');
            $this->_adMarkerSource = $options['AdMarkerSource'];
        }

        if (isset($options['IgnoreCea708ClosedCaptions'])) {
            Validate::isString($options['IgnoreCea708ClosedCaptions'], 'options[IgnoreCea708ClosedCaptions]');
            $this->_ignoreCea708ClosedCaptions = (bool) $options['IgnoreCea708ClosedCaptions'];
        }

        if (!empty($options['VideoStreams'])) {
            Validate::isArray($options['VideoStreams'], 'options[VideoStreams]');
            foreach ($options['VideoStreams'] as $videoStream) {
                $this->_videoStreams[] = VideoStream::createFromOptions($videoStream);
            }
        }

        if (!empty($options['AudioStreams'])) {
            Validate::isArray($options['AudioStreams'], 'options[AudioStreams]');
            foreach ($options['AudioStreams'] as $audioStream) {
                $this->_audioStreams[] = AudioStream::createFromOptions($audioStream);
            }
        }

        if (isset($options['SystemPreset'])) {
            Validate::isString($options['SystemPreset'], 'options[SystemPreset]');
            $this->_systemPreset = $options['SystemPreset'];
        }
    }
627137
public function withVideos(array $videos)
    {
        Assertion::allIsInstanceOf($videos, VideoInterface::class);

        $instance = clone $this;

        $instance->videos = $videos;

        return $instance;
    }
645445
public function renderPager(TableView $view, $viewName = 'twitter_bootstrap3', array $options = [])
    {
        if (!$view->pager) {
            return '';
        }

        $pageParam = $view->ui['page_name'];

        $options = array_merge([
            'pageParameter' => '[' . $pageParam . ']',
            'proximity'     => 3,
            'next_message'  => '&raquo;',
            'prev_message'  => '&laquo;',
            'default_view'  => 'default',
        ], $options);

        $routeGenerator = function ($page) use ($pageParam) {
            return '?' . $pageParam . '=' . $page;
        };

        return $this->viewFactory->get($viewName)->render($view->pager, $routeGenerator, $options);
    }
789179
public function render($options = array())
    {
        $template = $options['template'];
        $data = $options['data'];

        if (file_exists(($file = $this->templatePath.DIRECTORY_SEPARATOR.$template.'.tpl.php'))) {
            $template = file_get_contents($file);
        }
        else {
            Console::writeInfo('template '.$file.' was not found...');
        }

        return $this->renderTpl($template, $data);
    }
576346
public function channelVideos($channel, $options = [])
    {
        $availableOptions = ['limit', 'offset', 'broadcasts', 'hls'];

        return $this->sendRequest('GET', 'channels/'.$channel.'/videos', false, $options, $availableOptions);
    }
706553
public function renderFileFromHtml($html, $targetPath, Options $options = null)
    {
        $tmpFilePath = $this->createTempFilePath(self::HTML_EXTENSION);
        $this->createFile($tmpFilePath, $html);

        if ($options === null) {
            $options = new Options();
        }

        $options = $this->prepareOptions($options);

        $this->convertToPdf($tmpFilePath, $targetPath, $options);
    }
184083
public function display($content, $options = [])
    {
        if (!empty($content)) {
            $videoInfo = $this->_cache($content);
            if (!($videoInfo || empty($options['alwaysRender']))) {
                return 'Video does not exist, it may have been removed from youtube';
            }
            return $this->_renderDisplayView($options, $videoInfo);
        } else {
            return '';
        }
    }
286837
public function getPlayerHtml($video_html)
    {
        $player_url = $this->getPlayerUrl($video_html);

        $cache_path = sprintf('%s/%s', $this->storage_dir, md5($player_url));

        if (file_exists($cache_path)) {
            $contents = file_get_contents($cache_path);
            //return unserialize($contents);
        }

        $contents = $this->curl($player_url);

        // cache it too!
        file_put_contents($cache_path, serialize($contents));

        return $contents;
    }
492829
public function render($youtube, array $options = array()) {
        $this->_setDefaultAttribs($options);

        $_attribs = $options['attribs'];
        $_attribs['width'] = $options['width'];
        $_attribs['height'] = $options['height'];
        $_attribs['frameborder'] = '0';
        $_attribs['allowfullscreen'] = 'allowfullscreen';

        // unset the parameters that are not part of the query string
        unset($options['width']);
        unset($options['height']);
        unset($options['attribs']);

        // create the YouTube URL
        $youtubeUrl = $this->getPlayerUrl($youtube, $options);
        $_attribs['src'] = $youtubeUrl;

        $html = '<iframe' . $this->_htmlAttribs($_attribs) . '></iframe>';
        return $html;
    }
541198
public function media($media, $format, $options = [])
    {
        $media = $this->getMedia($media);

        if (null === $media) {
            return '';
        }

        $provider = $this
            ->getMediaService()
            ->getProvider($media->getProviderName());

        $format = $provider->getFormatName($media, $format);

        $options = $provider->getHelperProperties($media, $format, $options);

        return $this->render($provider->getTemplate('helper_view'), [
            'media' => $media,
            'format' => $format,
            'options' => $options,
        ]);
    }