/**
 * Returns a thumbnail, from YouTube, for specified video
 * @param  string $url YouTube url
 * @return string      link to YouTube thumbnail
 */
function getYouTubeThumbnail($url)
{
    $id = getYouTubeId($url);
    return "http://img.youtube.com/vi/" . $id . "/hqdefault.jpg";
}
        </div>
      </div>
    </div>
    <div class="row webinar-row">
      <?php 
        $count = 1;
        ?>
      <?php 
        foreach (webinarYoutube($webinar->ID) as $youtube) {
            ?>
        <div class="col-md-3 col-sm-6">
          <a href="#" class="webinar-link" data-chapter="<?php 
            echo $count;
            ?>
" data-youtube-embed="http://www.youtube.com/embed/<?php 
            echo getYouTubeId($youtube);
            ?>
?autoplay=1"><img src="<?php 
            echo getYouTubeThumbnail($youtube);
            ?>
" class="img-responsive" alt=""></a>
          <h3>Chapter <?php 
            echo $count;
            ?>
</h3>
        </div> 
        <?php 
            $count++;
            ?>
      <?php 
        }
Esempio n. 3
0
function getStreamingEmbed($url, $ext = FALSE, $filename = FALSE)
{
    $res = "";
    if (isYouTube($url)) {
        $video_id = getYouTubeId($url);
        $res = getYouTubeCode($video_id);
        return $res;
    }
    if ($ext === FALSE) {
        if ($filename === FALSE) {
            $filename = basename($url);
            $filename = strpos($filename, "?") !== FALSE ? preg_replace("/(\\?.*)/", "", $filename) : $filename;
        }
        $ext = end(explode(".", $filename));
    }
    switch ($ext) {
        case "flv":
            $res .= getDoceboFlashPlayer($url);
            break;
        case "swf":
            $res .= getFlashPluginCode($url);
            break;
        case "wmv":
            $res = "";
            $res .= '<object width="400px"  height="300px" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">';
            $res .= '<param name="filename" value="' . $url . '">';
            $res .= '<param name="Showcontrols" value="True">';
            $res .= '<param name="autostart" value="false">';
            $res .= '<embed type="application/x-mplayer2" src="' . $url . '"  height="300px" width="400px" autostart="false"></embed>';
            $res .= '</object>';
            return $res;
            break;
    }
    return $res;
}