Example #1
0
        private void trackBar1_ValueChanged(object sender, EventArgs e)
        {
            int    Hours   = trackBar1.Value / 3600;
            int    Minutes = (trackBar1.Value - Hours * 3600) / 60;
            int    seconds = (trackBar1.Value - Hours * 3600) % 60;
            string str     = Hours + ":" + Minutes + ":" + seconds;

            //DateTime dt = DateTime.ParseExact(str, "HH:mm:ss", System.Globalization.CultureInfo.CurrentCulture);
            label5.Text = str;
            if (count == 5)
            {
                //获取视频当前时间
                int CurrentTime = VM_Player_Vlc.VMK_Player_GetPlayedTime(lPort);
                //设置滑动条时间
                trackBar1.Value = seconds;
                count           = 0;
            }
        }
Example #2
0
        //播放
        private void button1_Click(object sender, EventArgs e)
        {
            //if(lPort!=-1)
            //lRet = VM_Player_Vlc.VMK_Player_Close(lPort);
            lPort = 1;
            string path = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();

            lPort = (int)dataGridView1.SelectedRows[0].Cells[2].Value;
            lRet  = VM_Player_Vlc.VMK_Player_Open(lPort, path);
            lRet  = VM_Player_Vlc.VMK_Player_SetHwnd(lPort, pictureBox1.Handle);
            lRet  = VM_Player_Vlc.VMK_Player_Play(lPort);

            int RecodingTime = VM_Player_Vlc.VMK_Player_GetPlayedTime(lPort);

            //trackBar1.Value = 0;
            trackBar1.Maximum = RecodingTime * 1000;
            if (lRet < 0)
            {
                MessageBox.Show("播放录像失败!");
            }
        }