Exemplo n.º 1
0
        private async void SearchTube(string search)
        {
            await ProgressBarHelper.ShowProgress("Searching YouTube");

            var searchListRequest = App.YoutubeService.Search.List("snippet");

            searchListRequest.Q          = search;
            searchListRequest.MaxResults = 50;
            var searchListResponse = await searchListRequest.ExecuteAsync();

            // Add each result to the appropriate list, and then display the lists of
            // matching videos, channels, and playlists.
            App.YoutubeSearchResults.Clear();
            foreach (var searchResult in searchListResponse.Items)
            {
                switch (searchResult.Id.Kind)
                {
                case "youtube#video":
                    App.YoutubeSearchResults.Add(new YouTubeMedia()
                    {
                        Description = searchResult.Snippet.Description,
                        Name        = searchResult.Snippet.Title,
                        ThumbUrl    = searchResult.Snippet.Thumbnails.Default.Url,
                        VideoId     = searchResult.Id.VideoId,
                        PostedBy    = searchResult.Snippet.ChannelTitle
                    });
                    break;
                }
            }
            await ProgressBarHelper.HideProgress();
        }
Exemplo n.º 2
0
        private async void youtubeResultsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 1)
            {
                var elem = e.AddedItems[0] as YouTubeMedia;
                await ProgressBarHelper.ShowProgress("Luncing " + elem.Name);

                App.ViewModel.PlayItem(new MediaElemntViewModel()
                {
                    FileUri = elem.GetFullurl()
                });
                await ProgressBarHelper.HideProgress();
            }
        }
Exemplo n.º 3
0
        private async void TryToConnect()
        {
            await ProgressBarHelper.ShowProgress("Connecting to VLC…");

            var res = await App.ViewModel.ConnectAndLoad(App.VlcSettings.GetUrl(), App.VlcSettings.Password, @"");

            await ProgressBarHelper.HideProgress();

            if (!res)
            {
                var dialog = new Windows.UI.Popups.MessageDialog("Connection failed. Pleease check settings");
                await dialog.ShowAsync();

                return;
            }
        }
        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();
        }