oembed) {
return $this->oembed;
}
$endpoint = $this->format($this->config->get('endpoint', ''));
if (!$endpoint) {
return [];
}
// Extract owner from embed code
list($owner, $id) = explode('/', $this->embedCode, 2);
// Fake response
$this->oembed = [
'type' => 'rich',
'title' => '',
'description' => '',
'author_name' => $owner,
'author_url' => 'http://slides.com/'.$owner,
'provider' => 'Slides',
'provider_url' => 'http://slides.com',
'url' => 'http://slides.com/'.$this->embedCode,
'html' => '',
'width' => 576,
'height' => 420,
];
return $this->oembed;
}
public function getEmbedCode($params = [])
{
$embed = parent::getEmbedCode($params);
if ($this->embedCode && $this->oembed) {
// Inject parameters directly into HTML OEmbed attribute
$query = http_build_query($this->params());
$url = $this->attributes['protocol'].'slides.com/'.rtrim($this->embedCode, '/').'/embed';
if (mb_strlen($query) > 0) {
$url .= (false === strpos($url, '?') ? '?' : '&') . $query;
}
// Get width and height
$width = $this->attributes['width'];
$height = $this->attributes['height'];
$embed = '';
}
return $embed;
}
}