<?php
if(!defined('AUTHACCESS')){echo "Not Allowed";exit();}
?>

<link href="<?php echo "$site_directory/themes/$template/loopplayer/nouislider.css"; ?>" rel="stylesheet">
<script src="<?php echo "$site_directory/themes/$template/loopplayer/nouislider.js"; ?>"></script>
<script src="<?php echo $site_directory."/themes/".$template; ?>/loopplayer/loopplayer.js"></script>
<?php
	foreach($related_model as $v) {
		$vplaylist[] = $v['vid'];
	}
?>
<script>
	let vplaylist = [];
	let plndx = 0;
	<?php 
		$templst = implode("','", $vplaylist);
		echo "vplaylist = ['" . $templst  . "'];";	
	?>
		
	let numofads = 0; // set numofads to ads in advertlist to activate ads
	// set time to seconds in advertlist. Ad will start after video plays for those seconds
	let advertlist = [
		{time:23,adtype:"video",vidurl:"https://yoursite.com/video1.mp4",link:"https://yoursponsor1.com"},
		{time:54,adtype:"video",vidurl:"https://yoursite.com/video2.mp4.mp4",link:"https://yoursponsor2.com/"},
	];

</script>

	<div class="vidbox">
	<div class="videojoinlink"><a class=joinhref href="<?php echo $sitelink;  ?>">Join "<?php echo $sponsor;  ?>"</a></div>
	<br>
		<div id="loopplayer">
			<div id="vidcontainer" style="overflow:hidden;border-radius:20px;">
				<video id="myVideo" poster="<?php echo $poster;  ?>" src="<?php echo $vid; ?>">  

				</video>
			</div>
			<div id="skipad">skip</div>
			<div id="loopcontrols"> 
				<div id="progressbar">
					<div id="loadingprogress">.
					</div>
					<div id="vtime"></div>
				</div> 
				<div id="slider"></div>
				<div id="leftctls">
					<div class="ctlbutton">
						<div id="playbutton"><img src='<?php echo "$site_directory/themes/$template/loopplayer/play.png"; ?>'></div>
						<div id="pausebutton"><img src='<?php echo "$site_directory/themes/$template/loopplayer/pause.png"; ?>'></div>
					</div>
					<div class="ctlbutton">
						<div id="loopbuttongreen"><img src='<?php echo "$site_directory/themes/$template/loopplayer/loopon.png"; ?>'></div>
						<div id="loopbuttonred"><img src='<?php echo "$site_directory/themes/$template/loopplayer/loopoff.png"; ?>'></div>
					</div>
					<div class="ctlbutton">
						<div id="vslider"></div>
					</div>

				</div>
				<div id="rightctls">
					<div class="ctlbutton">
						<div id="speedslider"></div>
					</div>
					<div class="ctlbutton">
						<div id="fsbutton"><img src='<?php echo "$site_directory/themes/$template/loopplayer/fullscreen.png"; ?>'></div>
					</div>
					<div class="ctlbutton">
						<div id="vzoom"><img src='<?php echo "$site_directory/themes/$template/loopplayer/zoomin.png"; ?>'></div>
					</div>
					<div class="ctlbutton">
						<div id="vzoomout"><img src='<?php echo "$site_directory/themes/$template/loopplayer/zoomout.png"; ?>'></div>
					</div>
					<div class="ctlbutton">
						<div id="lp"><a style="color:white;font-size:12px;" href="https://vvvlooper.com/">LP</a></div>
					</div>
				</div>
			</div>
			
		</div>
		

</div><!--vidbox-->

<link rel="stylesheet" href="<?php echo $site_directory."/themes/".$template; ?>/loopplayer/loopplayer.css">

<br>
<div id=modelinfo class=minfo style="clear:both;">
	<div class=musername><?php echo $display_name; ?></div>
	<div class=mtopic><?php echo str_replace('"','',$topic);  ?></div>
</div><!-- modelinfo -->

<?php
	if (!empty($tag_array)) {
		echo "\n<div id=modelinfotags class=minfotags>\n";
		foreach($tag_array as $t) {
			if (!empty($t)) {
				if ( (strlen($t) > 3) || (strtolower($t) == "fat") || (strtolower($t) == "bbw") ) {
					echo "<a class=taglink href=\"$site_directory/search/$media_type/" . $feed . "/$t" . $theme . "\"><span class=mtag>$t</span> </a>"	;
				}
			}
		}
		echo "</div><!-- modelinfotags -->\n";
	}	
?>	
	

	<div class=related_box>
	<div class=related_box_heading>Related </div>
	
<?php
	foreach($related_model as $v) {
		$vpagelink = $site_directory . "/video/" . $v['feed_name'] . "/clip/" . $v['zx'] . $theme;
		$modelpagelink = thbcell_html($v);
		$vplaylist[] = $v['vid'];
		echo $modelpagelink;

	}
?>
	</div>
	
	




