Exemplo n.º 1
0
 private void btPause_Click(object sender, EventArgs e)
 {
     if (this.btPause.Text == Messages.Pause)
     {
         try
         {
             BcVideoServer     bcVideoServer     = BcVideoServer.LoadById(this.MainDevice.Vsid);
             VideoServerClient videoServerClient = new VideoServerClient();
             videoServerClient.Endpoint.Address = new EndpointAddress("net.tcp://" + (object)bcVideoServer.Ip + ":" + (string)(object)bcVideoServer.Port + "/VideoStreamServer/VideoServer");
             videoServerClient.Open();
             videoServerClient.Pause(this.MainDevice.Id);
             this.btPause.Text = Messages.Continue;
             videoServerClient.Abort();
         }
         catch (Exception ex)
         {
         }
     }
     else
     {
         try
         {
             BcVideoServer     bcVideoServer     = BcVideoServer.LoadById(this.MainDevice.Vsid);
             VideoServerClient videoServerClient = new VideoServerClient();
             videoServerClient.Endpoint.Address = new EndpointAddress("net.tcp://" + (object)bcVideoServer.Ip + ":" + (string)(object)bcVideoServer.Port + "/VideoStreamServer/VideoServer");
             videoServerClient.Open();
             this.btPause.Text = Messages.Pause;
             videoServerClient.Run(this.MainDevice.Id);
             videoServerClient.Abort();
         }
         catch (Exception ex)
         {
         }
     }
 }
Exemplo n.º 2
0
 private void btPlay_Click(object sender, EventArgs e)
 {
     try
     {
         BcVideoServer     bcVideoServer     = BcVideoServer.LoadById(this.MainDevice.Vsid);
         VideoServerClient videoServerClient = new VideoServerClient();
         videoServerClient.Endpoint.Address = new EndpointAddress("net.tcp://" + (object)bcVideoServer.Ip + ":" + (string)(object)bcVideoServer.Port + "/VideoStreamServer/VideoServer");
         videoServerClient.Open();
         this.trackBarControl1.Visible = true;
         this.trackBarControl1.Value   = 0;
         this.btPause.Visible          = true;
         this.btPlay.Visible           = true;
         this.btStop.Visible           = true;
         videoServerClient.PlayStart(this.MainDevice.Id);
         try
         {
             Thread.Sleep(2000);
             this.trackBarControl1.Properties.Maximum = (int)videoServerClient.GetDuration(this.MainDevice.Id);
         }
         catch (Exception ex)
         {
         }
         this.btPause.Text = "Пауза";
         videoServerClient.Abort();
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 3
0
 private void btStop_Click(object sender, EventArgs e)
 {
     try
     {
         BcVideoServer     bcVideoServer     = BcVideoServer.LoadById(this.MainDevice.Vsid);
         VideoServerClient videoServerClient = new VideoServerClient();
         videoServerClient.Endpoint.Address = new EndpointAddress("net.tcp://" + (object)bcVideoServer.Ip + ":" + (string)(object)bcVideoServer.Port + "/VideoStreamServer/VideoServer");
         videoServerClient.Open();
         this.trackBarControl1.Value = 0;
         videoServerClient.Stop(this.MainDevice.Id);
         videoServerClient.Abort();
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 4
0
 private void trackBarControl1_EditValueChanged(object sender, EventArgs e)
 {
     if (!this._nextPos)
     {
         try
         {
             BcVideoServer     bcVideoServer     = BcVideoServer.LoadById(this.MainDevice.Vsid);
             VideoServerClient videoServerClient = new VideoServerClient();
             videoServerClient.Endpoint.Address = new EndpointAddress("net.tcp://" + (object)bcVideoServer.Ip + ":" + (string)(object)bcVideoServer.Port + "/VideoStreamServer/VideoServer");
             videoServerClient.Open();
             videoServerClient.SetPos(this.MainDevice.Id, (double)this.trackBarControl1.Value);
             videoServerClient.Abort();
         }
         catch (Exception ex)
         {
         }
     }
     this.lbPeriod.Text = this.GetTime((double)this.trackBarControl1.Value) + "//" + this.GetTime((double)this.trackBarControl1.Properties.Maximum);
 }