Essence\Provider\Presenter\Youtube::present PHP Method

present() public method

{@inheritDoc}
public present ( Media $Media )
$Media Essence\Media
    public function present(Media $Media)
    {
        $url = $Media->get($this->_property);
        if ($url && isset($this->_names[$this->_format])) {
            $thumbnail = str_replace('hqdefault', $this->_names[$this->_format], $url);
            $Media->set($this->_property, $thumbnail);
        }
        return $Media;
    }

Usage Example

 /**
  *	@dataProvider thumbnailFormatProvider
  */
 public function testPresent($format, $file)
 {
     $Youtube = new Youtube($format);
     $this->assertEquals("http://i1.ytimg.com/vi/5jmjBXoyugM/{$file}.jpg", $Youtube->present($this->Media)->get('thumbnailUrl'));
 }