Files
fdn2/private/lib/media/mediaRenderers/MediaYoutube.php
T
2016-03-04 11:09:05 +01:00

21 lines
555 B
PHP

<?php
class MediaYoutube implements MediaRendererInterface{
private $link;
public function __construct($model){
$this->link = $model->link;
}
public function asText(array $opt = array()){
// return $this->link;
return '<iframe width="420" height="315"
src="'.$this->link.'?autoplay=0" frameborder="0"></iframe>';
// return '<iframe width="560" height="315" src="https://www.youtube.com/embed/4qkv-iy_MaQ" frameborder="0" allowfullscreen></iframe>';
}
public function render(array $opt = array()){
echo $this->asText($opt);
}
}
?>