using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace QMAPP.WinForm.Forms.ODS { public partial class MediaPlayerSubForm : Form { public string _url=""; public MediaPlayerSubForm() { InitializeComponent(); } private void MediaPlayerSubForm_Load(object sender, EventArgs e) { this.axWindowsMediaPlayer1.URL = _url; //Double duration = Int32.Parse(textBox2.Text); //if (duration > 0) //{ // //获取媒体总长度不好用. // //if (this.axWindowsMediaPlayer1.currentMedia.duration > duration) // //{ // // MessageBox.Show("输入时间大于视频播放时间."); // //} // //else // //{ // // this.axWindowsMediaPlayer1.Ctlcontrols.currentPosition = duration; // //} // this.axWindowsMediaPlayer1.Ctlcontrols.currentPosition = duration; //} this.axWindowsMediaPlayer1.Ctlcontrols.play(); //var t1 = this.axWindowsMediaPlayer1.currentMedia.duration; //var t2 = axWindowsMediaPlayer1.Ctlenabled; //var t3 = axWindowsMediaPlayer1.isOnline; } private void MediaPlayerSubForm_FormClosed(object sender, FormClosedEventArgs e) { this.axWindowsMediaPlayer1.Ctlcontrols.stop(); } } }