* @subpackage Simple_Video_Embed/public/partials */ ?> <div class="wpsve-youtube" id="wpsve-youtube-{playerapiid}"> <div class="wpsve-wrapper-with-margin"> <div class="owl-video-carousel owl-carousel-{playerapiid}"> <?php if (array_key_exists('items', $this->api_data)) { foreach ($this->api_data['items'] as $item) { $contentDetails = $item['contentDetails']; $param = $this->toArray(); $param["type"] = 'video'; $param["autoplay"] = 1; $param["loop"] = 0; $s = Sve_Youtube::withParams($item['contentDetails']["videoId"], $param, "1"); ?> <div class="item-video" data-merge="3"> <a class="owl-video" href="<?php echo $s->getUrl(); ?> "></a> </div> <?php } } ?> </div> </div> <?php if (array_key_exists('error', $this->api_data)) {
/** * Shortcode wpsve definition */ function wpsve_shortcode($atts) { // Attributes extract(shortcode_atts(array('object' => '', 'type' => '', 'id' => '', 'autoplay' => '', 'template' => '', 'height' => '', 'col' => '', 'thumb_title' => ''), $atts)); // Code static $uniqueId = 0; $uniqueId++; if (array_key_exists('height', $atts)) { $atts['video-carousel-height'] = $atts['height']; } if (array_key_exists('col', $atts)) { $atts['thumb-columns-number'] = $atts['col']; } switch ($atts['object']) { case 'youtube': $yt = Sve_Youtube::withParams($atts['id'], $atts, $uniqueId); break; } return $yt->getHtml(); }