Ejemplo n.º 1
0
//options to video background
$video_upload_mp4 = $video_upload_mp4 ? '<source src="' . $video_upload_mp4 . '" type="video/mp4" />' : false;
$is_video = false;
if ($video_upload_mp4) {
    $is_video = true;
    $video_upload_ogg = $video_upload_ogg ? '<source src="' . $video_upload_ogg . '" type="video/ogg" />' : false;
    $video_upload_webm = $video_upload_webm ? '<source src="' . $video_upload_webm . '" type="video/webm" />' : false;
}
//video poster
$video_poster = isset($video_poster) ? $video_poster : '';
//options to button "see video"
$video_button = $video_button == 'yes' ? $video_button : false;
$video_button_style = isset($video_button_style) ? $video_button_style : false;
if ($video_button) {
    $video_url = $video_url ? $video_url : false;
    $video_id = YIT_Video::video_id_by_url($video_url);
    if ($video_id) {
        $v_i = explode(':', $video_id);
        if ($v_i[0] == 'vimeo') {
            $video_url = 'http://player.vimeo.com/video/' . $v_i[1] . '?iframe=true';
        } elseif ($v_i[0] == 'youtube') {
            $video_url = 'http://www.youtube.com/embed/' . $v_i[1] . '?iframe=true';
        }
    }
    $label_button_video = $label_button_video ? '<span class="label-button">' . $label_button_video . '</span>' : false;
}
$layout = yit_get_option('general-layout-type');
?>
<style type="text/css">
    #<?php 
echo $id;
Ejemplo n.º 2
0
 /**
  * Generate the main content of slide
  *
  * @param string $content_type 'image' or 'video'
  * @param array $args
  *
  * @return string The output html
  * @since 1.0
  * @author Antonino Scarfì <*****@*****.**>
  */
 public function featured_content($content_type, $args = array())
 {
     $default = array('container' => true, 'id_container' => '', 'before' => '', 'after' => '', 'video_width' => 425, 'video_height' => 356);
     $args = wp_parse_args($args, $default);
     extract($args, EXTR_SKIP);
     $link_url = $this->get('link');
     $link = !empty($link_url) ? true : false;
     $output = $attr = $a_before = $a_after = '';
     if ($link) {
         $a_before = '<a href="' . $link_url . '">';
         $a_after = '</a>';
     }
     $output .= $before;
     if (!empty($id_container)) {
         $id_container = " id=\"{$id_container}\"";
     }
     switch ($content_type) {
         case 'image':
             if ($container) {
                 $output .= '<div class="featured-image"' . $id_container . '>';
             }
             $output .= $a_before . $this->get_image('full') . $a_after;
             if ($container) {
                 $output .= '</div>';
             }
             break;
         case 'video':
             list($type, $id) = explode(':', YIT_Video::video_id_by_url($this->get('url_video')));
             $output .= '<div class="video-container">' . YIT_Video::$type("id={$id}&width={$video_width}&height={$video_height}") . '</div>';
             break;
     }
     $output .= $after . "\n";
     return $output;
 }