public ChannelContentProvider(WebServer server, TTVProxyDevice device) { server.AddRouteUrl(ChannelContentProvider.PLAYLIST_PATH, new Action<MyWebRequest>(((ContentProvider)this).SendResponse), HttpMethod.Get); server.AddRouteUrl(ChannelContentProvider.PLAY_PATH, new Action<MyWebRequest>(((ContentProvider)this).Play), HttpMethod.Get); server.AddRouteUrl(ChannelContentProvider.FAVOURITE_ADD, new Action<MyWebRequest>(this.AddFavouriteRequest), HttpMethod.Get); server.AddRouteUrl(ChannelContentProvider.FAVOURITE_DEL, new Action<MyWebRequest>(this.DelFavouriteRequest), HttpMethod.Get); server.AddRouteUrl(ChannelContentProvider.SCREEN_PATH, new Action<MyWebRequest>(this.ScreenRequest), HttpMethod.Get); this._device = device; }
public void Start() { Log.WriteInfo("Start TTVProxy"); int setting = MySettings.GetSetting("web", "port", 8081); try { this.Vlc = new VlcClient(); this.Vlc.OnEvent += new VlcClient.VlcEvent(this.VlcOnOnEvent); this.Vlc.ConnectAsync(); } catch (Exception ex) { this.OnNotifyed("Не удалось запустить VLC-сервер. Дальнейшая работа программы не возможна", 2); this.IsWorking = false; return; } Log.WriteInfo("[TTVProxy] Starting Web-server"); this._web = new WebServer(Convert.ToUInt16(setting)); this._web.Start(); this.Login(); this.Device = new TTVProxyDevice(this._web, this); this.Device.Start(); this.IsWorking = true; }
public TTVProxyDevice(WebServer webServer, TtvProxy proxy) { webServer.AddRouteUrl("/login", new Action<MyWebRequest>(this.LoginRequest), HttpMethod.Get); this.Web = webServer; this.Proxy = proxy; }