Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click OpenFileDialog1.Filter = "FLV (*.flv) |*.flv|F4V (*.f4v) |*.f4v|VOB (*.vob) |*.vob|mpg (*.mpg) |*.mpg|avi (*.avi) | *.avi|wmv (*.wmv)| *.wmv|asf (*.asf) | *.asf |mov (*.mov)| *.mov|mp4 (*.mp4)| *.mp4|3GP (*.3gp)| *.3gp" If OpenFileDialog1.ShowDialog() = DialogResult.OK Then ListBox1.Items.Add(OpenFileDialog1.FileName) End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim iIndex As Integer iIndex = ListBox1.SelectedIndex If iIndex <> -1 Then ListBox1.Items.RemoveAt(iIndex) End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim iCount As Integer Dim i As Integer iCount = ListBox1.Items.Count ListBox1.Items.Clear() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click AxVideoBroadcast1.StopBroadCast() ListBox2.Items.Clear() Dim strfile As String Dim iresult As Integer For Each strfile In ListBox1.Items AxVideoBroadcast1.AddVideo(strfile) Next AxVideoBroadcast1.AudioBitRate = Convert.ToInt32(txtaudiobitrate.Text) AxVideoBroadcast1.VideoBitRate = Convert.ToInt32(txtvideobitrate.Text) AxVideoBroadcast1.FrameRate = Convert.ToInt16(txtframe.Text) AxVideoBroadcast1.Port = Convert.ToInt16(txtport.Text) AxVideoBroadcast1.TimeOut = Convert.ToInt16(txttimeout.Text) AxVideoBroadcast1.VideoWidth = Convert.ToInt16(txtwidth.Text) AxVideoBroadcast1.VideoHeight = Convert.ToInt16(txtheight.Text) iresult = AxVideoBroadcast1.StartBroadCast() If iresult <> 0 Then MessageBox.Show("broadcast failed") Exit Sub End If txttotaldur.Text = AxVideoBroadcast1.GetTotalDuration().ToString() If CheckBox1.Checked Then AxVideoBroadcastPlayer1.Connect("127.0.0.1", Convert.ToInt16(txtport.Text)) End If End Sub Private Sub AxVideoBroadcast1_ClientConnected(ByVal sender As System.Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_ClientConnectedEvent) Handles AxVideoBroadcast1.ClientConnected ListBox2.Items.Add(e.strClientIP) End Sub Private Sub AxVideoBroadcast1_ClientDisconnected(ByVal sender As Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_ClientDisconnectedEvent) Handles AxVideoBroadcast1.ClientDisconnected Dim iIndex As Integer iIndex = ListBox2.FindString(e.strClientIP.ToString()) If iIndex <> -1 Then ListBox2.Items.RemoveAt(iIndex) End If End Sub Private Sub AxVideoBroadcast1_Playing(ByVal sender As Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_PlayingEvent) Handles AxVideoBroadcast1.Playing txtCurPos.Text = e.iPos.ToString() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click AxVideoBroadcast1.StopBroadCast() End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)