Beispiel #1
0
        public void ShowVideo(Media.MediaUri uri, Media.VideoEncoderConfiguration encoder, Media.AudioEncoderConfiguration audio)
        {
            try
            {
                _videoWindow = new VideoContainer();
                DeviceEnvironment environment    = ContextController.GetDeviceEnvironment();
                int messageTimeout               = environment.Timeouts.Message;
                Media.TransportProtocol protocol = GetTransportProtocol();
                VideoUtils.AdjustVideo(
                    _videoWindow,
                    environment.Credentials.UserName,
                    environment.Credentials.Password,
                    messageTimeout,
                    protocol,
                    Media.StreamType.RTPUnicast,
                    uri,
                    encoder);
                _videoWindow.KEEPALIVE = true;
                _videoWindow.DebugPage = true;
                _videoWindow.OpenWindow(audio != null);

                Invoke(new Action(() => { btnGetStreams.Text = "Stop Video"; }));
            }
            catch
            {
                _videoWindow.DebugPage = false;
                _videoWindow           = null;
                throw;
            }
        }
Beispiel #2
0
 public void ShowVideo(Onvif.MediaUri uri, Onvif.VideoEncoderConfiguration encoder)
 {
     try
     {
         _videoWindow = new VideoContainer();
         DeviceEnvironment environment = ContextController.GetDeviceEnvironment();
         int messageTimeout            = environment.Timeouts.Message;
         VideoUtils.AdjustVideo(
             _videoWindow,
             environment.Credentials.UserName,
             environment.Credentials.Password,
             messageTimeout,
             Onvif.TransportProtocol.UDP,
             Onvif.StreamType.RTPUnicast,
             uri,
             encoder);
         _videoWindow.KEEPALIVE = true;
         _videoWindow.OpenWindow(false);
         Invoke(new Action(() => { btnVideo.Text = "Stop Video"; }));
     }
     catch
     {
         _videoWindow = null;
         throw;
     }
 }
Beispiel #3
0
 /// <summary>
 /// Handles media uri received event
 /// </summary>
 protected void OnMediaUriReceived(Onvif.MediaUri uri, Onvif.VideoEncoderConfiguration encoder, Onvif.AudioEncoderConfiguration audio)
 {
     View.ShowVideo(uri, encoder, audio);
 }