private async void TestConnection() { await ProgressBarHelper.ShowProgress("Connecting to VLC…"); var com = new VlcWebControler(this.GetUrl(), this.password.Password); var isOk = await com.TestConnexion(); if (isOk) { this.connectionResult.Text = "Connection TEST: OK!"; /* await com.PlayFile(new VlcLib.Media.VlcMediaItem() * { * FileName = "https://www.youtube.com/watch?v=OCy5461BtTg?vq=hd1080" * });*/ } else { this.connectionResult.Text = "Connection TEST: Failed"; } await ProgressBarHelper.HideProgress(); }
public async Task <bool> ConnectAndLoad(string url, string password, string remoteDir) { if (timer != null) { timer.Cancel(); } com = new VlcWebControler(url, password); try { this.IsConnected = await com.TestConnexion(); if (this.IsConnected) { this.timer = new Timer(this.TimerCallBack, state, 250, 250); this.remoteDir = remoteDir; } } catch { this.IsConnected = false; } return(this.IsConnected); }
public async Task<bool> ConnectAndLoad(string url, string password, string remoteDir) { if (timer != null) { timer.Cancel(); } com = new VlcWebControler(url, password); try { this.IsConnected = await com.TestConnexion(); if (this.IsConnected) { this.timer = new Timer(this.TimerCallBack, state, 250, 250); this.remoteDir = remoteDir; } } catch { this.IsConnected = false; } return this.IsConnected; }