If you're familiar with the way embedly embeds articles, if gives you a nice thumbnail that when clicked, opens up a preview in a lightbox to the material that's being embedded. However, when I click on the thumbnail for an embedded article (example), i get Notice: Undefined index: html in C:\wamp\www\articledisplay.php on line 131
Line 131 is the print $oembed['html']
of case 'video':
, shown below.
I'm guessing an article probably isn't supposed to get embedded as a video, and I'm clearly missing some code from Embedly's PHP github.
Could anyone that's worked with Embedly before help me figure out how to resolve this? Thank you.
switch($oembed['type']) {
case 'photo':
print '<div class="embed-content"><div class="embed-wrapper">';
if (!array_key_exists('title', $oembed)) {
?><img src="<?php echo $oembed['url'] ?>"></img><?php
}
else {
?><img src="<?php echo $oembed['url'] ?>" alt="<?php echo $oembed['title'] ?>"></img><?php
}
print '</div></div>';
break;
case 'link':
case 'rich':
case 'video':
print '<div class="embed-content"><div class="embed-wrapper">';
print $oembed['html'];
print '</div></div>';
break;
case 'error':
default:
}