//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;
* that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.gnu.org/licenses/gpl-3.0.txt */ /** * Template file for embed the player vimeo video * * @package Yithemes * @author Francesco Grasso <*****@*****.**> * @since 1.0.0 */ $video_id = preg_replace('/[&|&]feature=([\\w\\-]*)/', '', $video_id); $shortcode_id = 'yit_video_' . mt_rand(); $placeholder = isset($placeholder) && $placeholder != '' ? $placeholder : 'no'; if ($placeholder == 'no') { YIT_Video::vimeo("id={$video_id}&width={$width}&height={$height}&echo=1"); } elseif ($placeholder == 'yes' && $placeholder_img != '') { ob_start(); ?> <a class="yit_embedded_video" id="<?php echo $shortcode_id; ?> " href="//player.vimeo.com/video/<?php echo $video_id; ?> "> <img src="<?php echo esc_url($placeholder_img); ?> "/> </a>
/** * 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; }
<?php /** * This file belongs to the YIT Plugin Framework. * * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.gnu.org/licenses/gpl-3.0.txt */ /** * Template file for embed the player youtube video * * @package Yithemes * @author Francesco Licandro <*****@*****.**> * @since 1.0.0 */ $video_id = preg_replace('/[&|&]feature=([\\w\\-]*)/', '', $video_id); YIT_Video::youtube("id={$video_id}&width={$width}&height={$height}&echo=1");