public InjectedAutoPlayer(TypeViewers typeViewers, Structures Camera, TypePlayer tp = TypePlayer.SD) : this() { this.Camera = Camera; Viever = typeViewers; Player = tp; if (typeViewers == TypeViewers.ImageV) { ImageVPlayer play = new ImageVPlayer { ImageURL = Camera.GetPhotoStream, FPS = (byte)Settings.StaticMembers.ImageSettings.FPS, Dock = DockStyle.Fill, }; Controls.Add(play); } else if (typeViewers == TypeViewers.FFPLAY) { ffplayer ffplayer1 = new ffplayer(); ffplayer1.Dock = DockStyle.Fill; ffplayer1.Disposed += (o, q) => { Dispose(); }; ffplayer1.FilePath = Player == TypePlayer.SD ? Camera.GetRTSPSecondONVIF : Camera.GetRTSPFirstONVIF; ffplayer1.StartFFPLAY(); Controls.Add(ffplayer1); } else if (typeViewers == TypeViewers.MPlayer) { mplayer mplayer1 = new mplayer(); mplayer1.Dock = DockStyle.Fill; mplayer1.Disposed += (o, q) => { Dispose(); }; mplayer1.FilePath = Player == TypePlayer.SD ? Camera.GetRTSPSecondONVIF : Camera.GetRTSPFirstONVIF; mplayer1.Startmplayer(); Controls.Add(mplayer1); } }
/// <summary> /// Обыявление структуры настроек /// </summary> /// <param name="IP">IP адрес камеры</param> /// <param name="Name">Имя пользователя</param> /// <param name="Password">Пароль</param> /// <param name="HTTPPort">Порт HTTP</param> /// <param name="RTSPPort">Порт RTSP</param> /// <param name="vdm">Порог детектора движения</param> /// <param name="rt">Зона детектора движения</param> /// <param name="typeCamera">Тип чипа камеры</param> /// <param name="records">Структура для записи</param> public Structures(string IP, string Name, string Password, uint HTTPPort, uint RTSPPort, uint ONVIFPort, int SelectedFirstProfile, int SelectedSecondProfile, bool ptz, decimal vdm, Rectangle rt, Network.Network.TypeCamera typeCamera, Record.Records records, string NameCamera, string MAC, TypeViewers v1, TypeViewers v2, TypeViewers v3) { this.IP = IP; //this.Uri = new Uri(IP); this.Name = Name; this.Password = Password; this.HTTPPort = HTTPPort; this.RTSPPort = RTSPPort; this.ValueMD = vdm; this.ZoneDetect = rt; this.TypeCamera = typeCamera; this.Records = records; this.ONVIFPort = ONVIFPort; this.SelectFirstProfile = SelectedFirstProfile; this.SelectSecondProfile = SelectedSecondProfile; this.PTZ = ptz; this.NameCamera = NameCamera; this.MAC = MAC; this.SinglePlay = v1; this.GroupPlay = v2; this.MonitorPlay = v3; }