21 lines
555 B
PHP
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);
|
|
}
|
|
}
|
|
?>
|