<?

if (is_file(H."files/user_files/screens/$file_id[id].gif"))
{
echo "<img src='/files/user_files/screens/$file_id[id].gif' alt='Скрин...' /><br />\n";
}
if (stristr($_SERVER['HTTP_USER_AGENT'],'windows') || stristr($_SERVER['HTTP_USER_AGENT'],'linux') || 
    stristr($_SERVER['HTTP_USER_AGENT'],'macintosh') || stristr($_SERVER['HTTP_USER_AGENT'],'unix') || 
    stristr($_SERVER['HTTP_USER_AGENT'],'macos') || stristr($_SERVER['HTTP_USER_AGENT'],'bsd')){
$pred_file=H.'files/user_files/'.$file_id['id'].'.dat';
if (is_file(H."files/prev/audio/$file_id[id].mp3")){
echo'<script type="text/javascript" src="/sys/audio-player.js"></script> 
<script type="text/javascript">
 AudioPlayer.setup ( "http://vdrugbe.ru/sys/player.swf", { width:"320", animation:"yes", encode:"no", initialvolume:"70", remaining:"yes", noinfo:"no", buffer:"5", checkpolicy:"no", rtl:"no", bg:"064a91", text:"000000", leftbg:"064a91", lefticon:"fee300", volslider:"fee300", voltrack:"ffffff", rightbg:"064a91", rightbghover:"064a91", righticon:"fee300", righticonhover:"fee300", track:"FFFFFF", loader:"fee300", border:"D2F0FF", tracker:"fee300", skip:"ff284b", pagebg:"064a91", transparentpagebg:"yes" } );  
 </script>
 <p id="audioplayer_1">Alternative content</p>  
 <script type="text/javascript"> 
 AudioPlayer.embed ( "audioplayer_1", {  soundFile: "http://vdrugbe.ru/files/prev/audio/'.$file_id['id'].'.mp3",  titles: "",  artists: "'.$file_id['name'].'",  autostart: "no" } ); 
</script><br/>';
}elseif (!@copy($pred_file, H."files/prev/audio/$file_id[id].mp3"))
{}else{
echo'<script type="text/javascript" src="/sys/audio-player.js"></script> 
<script type="text/javascript">
 AudioPlayer.setup ( "http://vdrugbe.ru/sys/player.swf", { width:"320", animation:"yes", encode:"no", initialvolume:"70", remaining:"yes", noinfo:"no", buffer:"5", checkpolicy:"no", rtl:"no", bg:"064a91", text:"000000", leftbg:"064a91", lefticon:"fee300", volslider:"fee300", voltrack:"ffffff", rightbg:"064a91", rightbghover:"064a91", righticon:"fee300", righticonhover:"fee300", track:"FFFFFF", loader:"fee300", border:"D2F0FF", tracker:"fee300", skip:"ff284b", pagebg:"064a91", transparentpagebg:"yes" } );  
 </script>
 <p id="audioplayer_1">Alternative content</p>  
 <script type="text/javascript"> 
 AudioPlayer.embed ( "audioplayer_1", {  soundFile: "http://vdrugbe.ru/files/prev/audio/'.$file_id['id'].'.mp3",  titles: "",  artists: "'.$file_id['name'].'",  autostart: "no" } ); 
</script><br/>';
}}
if ($file_id['opis']!=NULL)
{

echo trim(br(links($file_id['opis'])));

echo "<br />\n";
}
if (class_exists('ffmpeg_movie')){
$media = new ffmpeg_movie($file);

if (intval($media->getDuration())>3599)
echo 'Время: '.intval($media->getDuration()/3600).":".date('s',fmod($media->getDuration()/60,60)).":".date('s',fmod($media->getDuration(),3600))."<br />\n";
elseif (intval($media->getDuration())>59)
echo 'Время: '.intval($media->getDuration()/60).":".date('s',fmod($media->getDuration(),60))."<br />\n";
else
echo 'Время: '.intval($media->getDuration())." сек<br />\n";
echo "Битрейт: ".ceil(($media->getBitRate())/1024)." KBPS<br />\n";
if($media->getAudioChannels()==1)echo "Тип: Mono<br />\n";else echo "Тип: Stereo<br />\n";
echo 'Дискретизация: '.$media->getAudioSampleRate()." Гц<br />\n";
if(($media->getArtist())<>""){
if (function_exists('iconv'))
echo 'Исполнитель: '.iconv('windows-1251', 'utf-8', $media->getArtist())."<br />\n";
else
echo 'Исполнитель: '.$media->getArtist()."<br />\n";
}
if(($media->getGenre())<>"")echo 'Жанр: '.$media->getGenre()."<br />\n";
}
else
{
include_once H.'sys/inc/mp3.php';
$id3 = new MP3_Id(); 
  $result = $id3->read($file); 
  $result = $id3->study();
if(($id3->getTag('length')<>0)){echo 'Время: '.$id3->getTag('length')."<br />\n";}
if(($id3->getTag('bitrate'))<>0){echo'Битрейт: '.$id3->getTag('bitrate')." KBPS<br />\n";}
if(($id3->getTag('mode'))<>""){echo 'Тип: '.$id3->getTag('mode')."<br />\n";}
if(($id3->getTag('frequency'))<>0){echo 'Дискретизация: '.$id3->getTag('frequency')." Гц<br />\n";}
if(($id3->getTag('album'))<>""){
if (function_exists('iconv'))
echo 'Альбом: '.iconv('windows-1251', 'utf-8', $id3->getTag('album'))."<br />\n";
else
echo 'Альбом: '.$id3->getTag('album')."<br />\n";
}
if(($id3->getTag('artists'))<>""){
if (function_exists('iconv'))
echo 'Исполнитель: '.iconv('windows-1251', 'utf-8', $id3->getTag('artists'))."<br />\n";
else
echo 'Исполнитель: '.$id3->getTag('artists')."<br />\n";
}
if(($id3->getTag('genre'))<>""){echo 'Жанр: '.$id3->getTag('genre')."<br />\n";}

}
?>