public static function fetchData($url, $fields = array())
 {
     $id = Video_Fetcher::extractIDFromURL($url);
     $channel = Video_Fetcher::extractChanneldFromURL($url);
     switch ($channel) {
         case 'youtube':
             return Video_Fetcher::fetchYoutubeData($id, $fields);
         case 'vimeo':
             return Video_Fetcher::fetchVimeoData($id, $fields);
         default:
             return null;
     }
 }
            ?>
"></param>
										<?php 
            if ($interactive_videos == 0) {
                ?>
										<param name="allowScriptAccess" value="samedomain"></param>
										<?php 
            } else {
                ?>
										<param name="allowScriptAccess" value="always"></param>
										<?php 
            }
            ?>
										<param name="wmode" value="transparent"></param>
										<embed src="http://www.youtube.com/v/<?php 
            echo Video_Fetcher::extractIDFromURL($url);
            if ($onoff_related_yt != '0') {
                ?>
&rel=0<?php 
            }
            if ($auto_play == '1') {
                ?>
&autoplay=1<?php 
            }
            if ($onoff_info_yt == '1') {
                ?>
&showinfo=0<?php 
            }
            if ($remove_annotations != '1') {
                ?>
&iv_load_policy=3<?php 
示例#3
0
    function quick_view_tm()
    {
        $html = '';
        $title = get_the_title();
        $title = strip_tags($title);
        $link_q = get_post_meta(get_the_id(), 'tm_video_url', true);
        $link_q = str_replace('http://vimeo.com/', 'http://player.vimeo.com/video/', $link_q);
        if (strpos($link_q, 'wistia.com') !== false) {
            $link_q = '';
        }
        if ($link_q == '') {
            $file = get_post_meta(get_the_id(), 'tm_video_file', true);
            $files = !empty($file) ? explode("\n", $file) : array();
            $link_q = isset($files[0]) ? $files[0] : '';
        }
        if ($link_q != '') {
            if (strpos($link_q, 'youtube.com') !== false) {
                $id_vd = Video_Fetcher::extractIDFromURL($link_q);
                $link_q = 'http://www.youtube.com/embed/' . $id_vd . '?rel=0&amp;wmode=transparent';
            }
            $html .= '<div><a href=' . $link_q . ' class=\'youtube\'  title=\'' . $title . '\' data-url=\'' . esc_url(get_permalink()) . '\' id=\'light_box\'>
				' . __('Quick View', 'cactusthemes') . '
			</a></div>';
        }
        return $html;
    }