echo "<li>";
if($p_meta_set ['items_name'] [$key] != 'video')
echo "<img src='".$item."' alt='".$p_meta_set ['items_name'] [$key]."'>";
else {
//For Vimeo...
if ( strpos($item, "vimeo") ) :
$url = substr( strrchr($item, "/"),1);
echo "<iframe src='https://player.vimeo.com/video/{$url}' width='940' height='470' frameborder='0'></iframe>";
//For Youtube...
elseif( strpos($item, "?v=") ):
$url = substr( strrchr($item, "="),1);
echo "<iframe src='https://www.youtube.com/embed/{$url}?wmode=opaque' width='940' height='470' frameborder='0'></iframe>";
endif;
}
echo "</li>";