home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 November / PCWorld_2007-11_cd.bin / temacd / imtoodownyoutube / download-youtube-video.exe / script / playerfileinfos.js < prev    next >
Text File  |  2007-07-25  |  2KB  |  69 lines

  1. LoadLib("Helper.dll"); 
  2. var helper=new JSHelper();
  3.  helper.Helper_Init();
  4.  
  5. function GetFileInfo(filename)
  6. {
  7.  helper.Helper_InitFileInfo(filename);
  8.  playerfileinfos.filename.SetText(getfilename(filename));
  9.  playerfileinfos.filelocation.SetText(getlocation(filename));
  10.  playerfileinfos.filelocation.SetLink(getlocation(filename));
  11.  var duration=helper.Helper_GetDuration();
  12.  playerfileinfos.fileduration.SetText(duration);
  13.  var filesize=helper.Helper_GetFileSize();
  14.  
  15.  
  16.  playerfileinfos.filesize.SetText(parseInt(filesize/1024)+"KB");
  17.  var videowidth=helper.Helper_GetVideoWidth();
  18.  var videoheight=helper.Helper_GetVidoeHeight(); 
  19.  playerfileinfos.Dimensionvalue.SetText(videowidth+"*"+videoheight); 
  20.  
  21.  var videoframe=helper.Helper_GetVideoFrame();
  22.  
  23.  playerfileinfos.FramerateValue.SetText(videoframe);
  24.  
  25.  
  26.  
  27.  var audiochannel=helper.Helper_GetAudioChannels();
  28.  playerfileinfos.ChannelsValue.SetText(audiochannel);
  29.  var audiofreq=helper.Helper_GetAudioFrequency();
  30.  playerfileinfos.FidelityValue.SetText(audiofreq+"Hz");
  31.  
  32.  var audiorate=helper.Helper_GetAudioRate();
  33.  playerfileinfos.BitrateValue.SetText(audiorate);
  34.  
  35.  var videorate=helper.Helper_GetVideoRate();
  36.  playerfileinfos.videorate.SetText(videorate);
  37.  
  38.  var videocodec=helper.Helper_GetVideoCodec();
  39.  playerfileinfos.videocodecvalue.SetText(videocodec);
  40.  var audiocodec=helper.Helper_GetAudioCodec();
  41.  playerfileinfos.AudioCodecValue.SetText(audiocodec);
  42.  
  43.  
  44. }
  45.  
  46. function formatFloat(src, pos)
  47. {
  48.     return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);
  49. }
  50.  
  51. function getfilename(filename)
  52. {
  53.  var start=filename.lastIndexOf("\\");
  54.  var file1=filename.substr(start+1,filename.length-start);
  55.  return file1;
  56. }
  57. function getlocation(filename)
  58. {
  59.  var end=filename.lastIndexOf("\\");
  60.  var filepath=filename.substr(0,end+1);
  61.  return filepath;
  62. }
  63.  
  64. function fileinfos_destroy()
  65. {
  66.  //helper.Helper_UnInit();
  67.  playerfileinfos.Close();
  68. }
  69.