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

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