Your IP : 10.10.0.253


Current Path : /var/www/modules/mod_yendifvideoshare_playlist/tmpl/
Upload File :
Current File : /var/www/modules/mod_yendifvideoshare_playlist/tmpl/default.php

<?php 
/**
 * @version    1.2.9
 * @package    Com_YendifVideoShare
 * @author     PluginsWare Interactive Pvt. Ltd <admin@yendifplayer.com>
 * @copyright  Copyright (c) 2012 - 2021 PluginsWare Interactive Pvt. Ltd. All Rights Reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
 
// Prevent direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

$options = array(
	'ratio',	
	'playlist_position',
	'playlist_width',
	'playlist_height',
	'playlist_desc_limit'
);

foreach ( $options as $option ) {
	$value = $params->get( $option, 'global' );
	if ( $value == 'global' ) {
		$params->set( $option, $config->{$option} );
	}
}

// Player args
static $uid = 0;
$uid++;

$args = array( 
	'uid' => $uid
);

$player_options = array(
	'ratio',
	'volume',
	'autoplay',
	'autoplaylist',
	'loop',
	'controlbar',
	'playbtn',
	'playpause',
	'currenttime',
	'progress',
	'duration',
	'volumebtn',
	'fullscreen',
	'embed',
	'share',
	'download'
);

foreach ( $player_options as $option ) {
	$value = $params->get( $option, 'global' );
	if ( $value != 'global' ) {
		$args[ $option ] = $value;
	}
}

// Import CSS & JS
$document = JFactory::getDocument();

if ( $config->bootstrap_version == 3 ) {
	$document->addStyleSheet( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/css/bootstrap.css', 'text/css', 'screen' ) );
}

$document->addStyleSheet( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/css/yendifvideoshare.css', 'text/css', 'screen' ) );

$inlineStyle = $config->responsive_css;

if ( $params->get( 'playlist_position' ) == 'right' ) {
	$inlineStyle .= "
		#yendif-video-share-playlist-" . $uid . " .yendif-video-share-playlist-player {
			width: calc(100% - " . (int) $params->get( 'playlist_width', 250 ) . "px);
		}

		#yendif-video-share-playlist-" . $uid . " .yendif-video-share-playlist-videos {
			width: " . (int) $params->get( 'playlist_width', 250 ) . "px;
		}

		@media only screen and (max-width: 768px) {
			#yendif-video-share-playlist-" . $uid . " .yendif-video-share-playlist-player,
			#yendif-video-share-playlist-" . $uid. " .yendif-video-share-playlist-videos {
				width: 100%;
			}

			#yendif-video-share-playlist-" . $uid . " .yendif-video-share-playlist-videos {
				max-height: " . (int) $params->get( 'playlist_height', 250 ) . "px;
			}
		}
	";
} else {
	$inlineStyle .= "
		#yendif-video-share-playlist-" . $uid . " .yendif-video-share-playlist-videos {
			max-height: " . (int) $params->get( 'playlist_height', 250 ) . "px;
		}
	";
}

$document->addStyleDeclaration( $inlineStyle );

JHtml::_('jquery.framework');
$document->addScript( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/js/yendifvideoshare.js' ) );
?>

<div id="yendif-video-share-playlist-<?php echo $uid; ?>" class="yendif-video-share playlist <?php echo $moduleclass_sfx; ?>">
	<div class="yendif-video-share-playlist">
		<!-- Player -->
		<div class="yendif-video-share-playlist-player">
			<?php
			$args['videoid'] = $items[0]->id;
			echo YendifVideoSharePlayer::load( $args, $params );
			?>
		</div>

		<!-- Playlist -->
		<div class="yendif-video-share-playlist-videos <?php echo $params->get( 'playlist_position', 'right' ); ?>">
			<div class="yendif-video-share-playlist-items">
				<?php foreach ( $items as $index => $item ) :
					$args['videoid']  = $item->id;
					$args['autoplay'] = 1;

					$image = YendifVideoShareUtils::getImage( $item->image, '_poster', $config->default_image );

					$iframe_src = YendifVideoSharePlayer::getURL( $args );
					?>
					<div class="yendif-video-share-playlist-item<?php if ( $index == 0 ) echo ' active'; ?>" data-index="<?php echo (int) $index; ?>" data-src="<?php echo $iframe_src; ?>">
						<div class="media">
							<div class="media-left">
								<div class="media-object">
									<div class="yendif-thumbnail" style="padding-bottom: <?php echo ( (float) $params->get( 'ratio', 0.5625 ) * 100 ); ?>%">
										<div class="yendif-image" style="background-image: url( '<?php echo $image; ?>' );">&nbsp;</div>

										<?php if ( ! empty( $item->duration ) ) : ?>
											<span class="yendif-duration"><?php echo $item->duration; ?></span>
										<?php endif; ?> 
									</div>
								</div>
							</div>
							<div class="media-body">
								<div class="yendif-video-share-title">
									<?php echo $item->title; ?>
								</div>

								<?php if ( $show_excerpt && ! empty( $item->description ) ) : ?>
									<div class="yendif-video-share-excerpt small muted">
										<?php echo YendifVideoShareUtils::Truncate( $item->description, $params->get( 'playlist_desc_limit' ) ); ?>
									</div>
								<?php endif; ?>
							</div>
						</div>
					</div>
				<?php endforeach; ?>
			</div>
		</div>
	</div>	
</div>