示例#1
0
 public function sb_base_show_post_content_list($h)
 {
     if (!isset($h->post->vars['media']) || $h->post->vars['media'] != 'video') {
         return false;
     }
     include_once PLUGINS . "video_inc/libs/AutoEmbed.class.php";
     $AE = new AutoEmbed();
     // If this url doesn't parse as a valid video link...
     if (!$AE->parseUrl($h->post->origUrl)) {
         return false;
     }
     // get an associated static image (if there is one)
     $imageURL = $AE->getImageURL();
     $video_inc_url = BASEURL . "index.php?page=video_inc&url=" . urlencode($h->post->origUrl);
     // echo the image
     if ($imageURL) {
         echo "<div class='video_inc_list'>\n";
         if ($h->isActive('thickbox')) {
             echo "<a href='" . $video_inc_url . "&amp;height=336&amp;width=588' class='thickbox'>\n";
             echo "<img src='" . $imageURL . "' alt='video' /></a>\n";
         } else {
             echo "<img src='" . $imageURL . "' alt='video' />\n";
         }
         echo "</div>\n";
     }
 }
示例#2
0
<?php

include "AutoEmbed.class.php";
error_reporting(0);
ini_set('user_agent', 'OpenRecommender');
/* clean, validate and set URL */
$u = filter_var($_REQUEST['url'], FILTER_SANITIZE_URL);
$url = !empty($u) && isset($u) && filter_var($u, FILTER_VALIDATE_URL) ? $u : 'http://www.youtube.com/watch?v=ikTxfIDYx6Q';
$AE = new AutoEmbed();
// load the embed source from a remote url
if ($AE->parseUrl($url)) {
    if ($AE->getEmbedCode()) {
        $AE->setParam('wmode', 'transparent');
        $AE->setParam('autoplay', 'true');
        echo $AE->getEmbedCode();
    } else {
        if ($AE->getImageURL()) {
            echo '<img src="' . $AE->getImageURL() . '/" />';
        } else {
            //iframe it
            echo '<iframe src="' . $url . '" width="600" height="400" frameborder="0" scrolling="auto"></iframe>';
        }
    }
} else {
    //try oEmbed
}