public void StartReadStream(string uri, int timeout_ms, int transport = 1) //transport : 1-TCP, 2-UDP, 0-NONE { m_strUri = uri; m_nTimeOut = timeout_ms; m_nTransPort = transport; Uri u = new Uri(uri); TimeSpan ts = new TimeSpan(0, 0, 0, 0, timeout_ms); RtspTransport tsport = (RtspTransport)transport; IniFile ini = new IniFile(); ini.IniWriteValue(INISECT_RTSP, INIKEY_URI, uri, DefPath.VisionSetting); ini.IniWriteValue(INISECT_RTSP, INIKEY_TIMEOUT, timeout_ms.ToString(), DefPath.VisionSetting); ini.IniWriteValue(INISECT_RTSP, INIKEY_TRANSPORT, transport.ToString(), DefPath.VisionSetting); m_streamControl.StartPlay(u, ts, tsport, RtspFlags.None); m_camStatus = CamStatus.Connecting; }
public void play(string url) { try { streamPlayerControler.StartPlay(new Uri(url), TimeSpan.FromSeconds(timeout)); } catch (Exception e) { MessageBox.Show(e.Message, "Person Detector Stream Player", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } timer.Start(); }