12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace Grav\Plugin\MediaEmbed\OEmbed;
- use Grav\Plugin\MediaEmbed\OEmbed\OEmbed;
- class OEmbedVideo extends OEmbed
- {
- public function getOEmbed()
- {
- $oembed = parent::getOEmbed();
- if ($this->embedCode && $this->oembed) {
- $width = $this->oembed->get('width');
- $height = $this->oembed->get('height');
- $this->attributes(['width' => $width, 'height' => $height]);
- }
- return $oembed;
- }
- public function getEmbedCode($params = [])
- {
- $embed = parent::getEmbedCode($params);
- if (mb_strlen($embed) == 0 && $this->embedCode && $this->oembed) {
- $embed = $this->oembed->get('html', '');
- }
- return $embed;
- }
- }
|