<?
if (class_exists('ffmpeg_movie'))
{
	$media = new ffmpeg_movie($file);
	$k_frame=intval($media->getFrameCount());

	$w = $media->GetFrameWidth();
	$h = $media->GetFrameHeight();
	$ff_frame = $media->getFrame(intval($k_frame/2));
	if ($ff_frame) 
	{
		$gd_image = $ff_frame->toGDImage();
		if ($gd_image) 
		{
			$des_img = imagecreatetruecolor(128, 128);
			$s_img = $gd_image;
			imagecopyresampled($des_img, $s_img, 0, 0, 0, 0, 128, 128, $w, $h);
			$des_img=img_copyright($des_img); // наложение копирайта
			imagegif($des_img,H."sys/obmen/screens/128/$file_id[id].gif");
			chmod(H."sys/obmen/screens/128/$file_id[id].gif", 0777);
			imagedestroy($des_img);
			imagedestroy($s_img);

		}
	}
}


if($webbrowser == 'web'){
echo '<script type="text/javascript" src="/player.js"></script>
<script class="splayer"> var params = {"playlist":[{"video":[{"url":"http://lafac.ru/obmen/Lichnye_fajly/'.$file_id['id'].'.mp4"}],"duration":0,"posterUrl":"http://lafac.ru/sys/obmen/screens/128/'.$file_id['id'].'.gif"}],"uiLanguage":"ru","width":580,"height":300,"design":{"hide":["shareCodeButton"]},"behavior":{"autoHideControlBar":true}}; player.embed(params); 
</script>';
} else {
echo '<script type="text/javascript" src="/player.js"></script>
<script class="splayer"> var params = {"playlist":[{"video":[{"url":"http://lafac.ru/obmen/Lichnye_fajly/'.$file_id['id'].'.mp4"}],"duration":0,"posterUrl":"http://lafac.ru/sys/obmen/screens/128/'.$file_id['id'].'.gif"}],"uiLanguage":"ru","width":250,"height":150,"design":{"hide":["shareCodeButton"]},"behavior":{"autoHideControlBar":true}}; player.embed(params); 
</script>';
}

if ($file_id['opis']!=NULL)
{
	echo "Описание: ";
	echo output_text($file_id['opis']);
	echo "<br />\n";
}


echo "Добавлен: ".vremja($file_id['time'])."<br />\n";
echo "Размер: ".size_file($size)."<br />\n";
echo '<b>Тег для вставки:</b><br><input size="20" value="[video=/obmen/Lichnye_fajly/'.$file_id['id'].'.mp4]" /><br/>';
?>