<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>slayt</title>
 <link rel="stylesheet" href="theme/style.css" type="text/css" media="screen" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="flowplayer-3.2.11.min.js"></script>

</head><body>
<?php 
$dizin_ne= @$_GET['dizin'];
if($dizin_ne==''){echo 'dizin bož';}else{
$dir = opendir("$dizin_ne");
$dosyaSayisi = 0;
$x1s=array();
$gelen=array();
while (($x = readdir($dir)) !== false) {
if ($x != "." && $x != "..") and  (strtolower(substr($x,-3))=="flv" or strtolower(substr($x,-3))=="mp4" or strtolower(substr($x,-3))=="mov" or strtolower(substr($x,-3))=="m4v" ) 
{   
$dosyaSayisi++;
$gelen[]=$x;
echo "<a href=".$x." style=display:block;width:100%;  id='player'></a>";
}
}

closedir($dir); 
}
?>
<script>
$('#player').css('height', ($(window).height())  + 'px');
flowplayer('player', 'flowplayer-3.2.12.swf',{
	clip: {
  onBeforeFinish: function (clip) {
    if (clip.index === this.getPlaylist().length - 1) {
      return false;
    }
  }
},
	playlist: [
        <?php for ( $say=0 ; $say < $dosyaSayisi; $say++ ){
					echo"{url: '$dizin_ne/". $gelen[$say]."'},";			
			}
			?>
    ]
	});
</script>

</body></html>
