Inheritance: System.Windows.Forms.UserControl
示例#1
0
        /// <summary>
        /// Method to calculate video length
        /// </summary>
        /// <param name="videoPath"></param>
        public void VideoTimeSpan(string videoPath)
        {
            var player = new WindowsMediaPlayer();
            var clip   = player.newMedia(videoPath);

            Times = (int)clip.duration;
        }
示例#2
0
 public MediaFacade(string fileName)
 {
     wmp = new WindowsMediaPlayer();
     wmp.settings.autoStart = playing;
     IsLooping = false;
     wmp.settings.setMode("autoRewind", true);
     wmp.PlayStateChange += Wmp_PlayStateChange;
     var media = wmp.newMedia(fileName);
     if (0.0 == media.duration) throw new Exception("Could not load file '" + fileName + "'");
     length = (float)media.duration;
     wmp.URL = fileName;
 }
示例#3
0
 public string getAlbum(string file)
 {
     string result;
     WindowsMediaPlayer wmp = new WindowsMediaPlayer();
     IWMPMedia mediainfo = wmp.newMedia(file);
     result = mediainfo.getItemInfo("Album");
     return result;
 }
示例#4
0
 public string getDuration(String file)
 {
     string result;
     WindowsMediaPlayer wmp = new WindowsMediaPlayer();
     IWMPMedia mediainfo = wmp.newMedia(file);
     var timespan = TimeSpan.FromSeconds(mediainfo.duration);
     result = timespan.ToString(@"hh\:mm\:ss");
     return result;
 }