示例#1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            var device = (SatIpDevice)_client.FindByUDN(e.Node.Name);

            if (device != null)
            {
                tbxFriendlyName.Text     = device.FriendlyName;
                tbxUniqueDeviceName.Text = device.UniqueDeviceName;
                tbxDeviceType.Text       = device.DeviceType;
                tbxModelDescription.Text = device.ModelDescription;
                tbxManufacture.Text      = device.Manufacturer;
                tbxManufactureUrl.Text   = device.ManufacturerUrl;
                tbxPresentationUrl.Text  = device.PresentationUrl;
                pbxDVBC.Image            = Resources.dvb_c;
                pbxDVBC.Visible          = device.SupportsDVBC;
                pbxDVBS.Image            = Resources.dvb_s;
                pbxDVBS.Visible          = device.SupportsDVBS;
                pbxDVBT.Image            = Resources.dvb_t;
                pbxDVBT.Visible          = device.SupportsDVBT;
                webBrowser1.DocumentText = device.DeviceDescription;
                try
                {
                    string imageUrl = string.Format(device.FriendlyName == "OctopusNet" ? "http://{0}:{1}/{2}" : "http://{0}:{1}{2}", device.BaseUrl.Host, device.BaseUrl.Port, device.GetImage(1));

                    pictureBox1.LoadAsync(imageUrl);
                    pictureBox1.Visible = true;
                }
                catch (Exception)
                {
                    pictureBox1.Visible = false;
                }
            }
        }
示例#2
0
        private void Devices_AfterSelect(object sender, TreeViewEventArgs e)
        {
            var device = (SatIpDevice)_client.FindByUDN(e.Node.Name);

            if (device != null)
            {
                Logger.Info("Selected Sat>Ip Server is {0}", device.FriendlyName);


                if ((_rtspDevice != null) && (!_rtspDevice.FriendlyName.Equals(device.FriendlyName)))
                {
                    _rtspDevice.Dispose();
                    _rtspDevice  = new RtspDevice(device.FriendlyName, device.BaseUrl.Host, device.UniqueDeviceName);
                    _isstreaming = false;
                }
                else
                {
                    _rtspDevice = new RtspDevice(device.FriendlyName, device.BaseUrl.Host, device.UniqueDeviceName);
                }
                var service = (M3uService)PlayList.SelectedItem;
                Logger.Info("Selected Service is {0}", service.Name);
                if (!_isstreaming)
                {
                    _rtspDevice.RtspSession.Setup(service.ToString(), TransmissionMode.Unicast);
                    _rtspDevice.RtspSession.RecieptionInfoChanged += new RecieptionInfoChangedEventHandler(RtspSession_RecieptionInfoChanged);
                    _rtspDevice.RtspSession.Play(String.Empty);
                    _isstreaming = true;
                    axWindowsMediaPlayer1.URL = string.Format("rtp://{0}:{1}", _rtspDevice.RtspSession.Destination,
                                                              _rtspDevice.RtspSession.RtpPort);
                    Text = string.Format("rtp://{0}:{1}", _rtspDevice.RtspSession.Destination,
                                         _rtspDevice.RtspSession.RtpPort);
                }
            }
        }