private void GetFilePlayPos() { float pos = PlayCtrl.PlayM4_GetPlayPos(m_lPort); this.pgbPlayPos.Value = Convert.ToInt32(pos * 100); if (pos == 1) {//播放结束 StopVideo(); } }
private void timer1_Tick(object sender, EventArgs e) { if (!play || m_bPause) { return; } progressBar1.Value = (int)(PlayCtrl.PlayM4_GetPlayPos(0) * 100); label4.Text = GetTime(PlayCtrl.PlayM4_GetPlayedTime(0)); Console.WriteLine(PlayCtrl.PlayM4_GetPlayedTime(0)); Console.WriteLine(PlayCtrl.PlayM4_GetPlayedTimeEx(0)); Console.WriteLine(PlayCtrl.PlayM4_GetFileTime(0)); if (PlayCtrl.PlayM4_GetPlayedTimeEx(0) >= PlayCtrl.PlayM4_GetFileTime(0) * 1000) { progressBar1.Value = 100; play = false; m_bPause = false; button2_Click(null, null); } }