Files
fdn2/app/private/lib/media/mediaRenderers/MediaHtml5.php
T
2022-08-29 23:20:16 +02:00

28 lines
708 B
PHP

<?php
class MediaHtml5 extends MediaRenderer{
private $code;
public function __construct($code){
$this->code = $code;
}
public function asText(array $opt = array()){
$size = MediaRendererInterface::SIZE_ORIGINAL;
$width = '';
$height = '';
if(array_key_exists("size", $opt) && array_key_exists($opt["size"], self::$SIZES)){
$size = $opt["size"];
$width = 'height:'.self::$SIZES[$size]["width"].'px;';
$height = 'width:'.self::$SIZES[$size]["height"].'px;';
}
return $this->code;
// return '<div style="'.$height.$width.'overflow:hidden;height:100%;width:100%;">'.$this->code.'</div>';
}
public function render(array $opt = array()){
echo $this->asText($opt);
}
}
?>