private void VideoForm_FormClosing(object sender, FormClosingEventArgs e) { try { if (this.multimediaManager == null) { return; } if (this.videoChatRecorder != null) { this.videoChatRecorder.Dispose(); this.videoChatRecorder = null; } this.decibelDisplayer_mic.Working = false; this.decibelDisplayer_speaker.Working = false; this.switchCameraSzieCallbackTimer.Stop(); this.cameraConnector1.Disconnect(); this.dynamicCameraConnector1.Disconnect(); this.microphoneConnector1.Disconnect(); this.timerLabel1.Stop(); if (this.activeHungUp) { if (this.HungUpVideo != null) { this.HungUpVideo(this.hungUpCauseType); } } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void button_record_Click(object sender, EventArgs e) { if (this.videoChatRecorder == null) { this.Cursor = Cursors.WaitCursor; this.videoChatRecorder = new VideoChatRecorder(this.multimediaManager, this.dynamicCameraConnector1, this.cameraConnector1); this.videoChatRecorder.Initialize("VideoChat.mp4"); this.label_record.Visible = true; this.button_record.Text = "停止录制"; this.Cursor = Cursors.Default; } else { this.Cursor = Cursors.WaitCursor; this.label_record.Visible = false; this.videoChatRecorder.Dispose(); this.videoChatRecorder = null; this.button_record.Text = "开始录制"; this.Cursor = Cursors.Default; MessageBox.Show("录制完成!"); } }