Exemplo n.º 1
0
        private async void GetLateliveRequst()
        {
            try
            {
                List <Latelive> lateliveList = new List <Latelive>();
                LateliveModel   model        = await App.Client.GetLatelives();

                if (model.status == "true")
                {
                    for (int i = 0; i < model.feeds.Count; i++)
                    {
                        var latelive = new Latelive()
                        {
                            id       = model.feeds[i].id,
                            priority = model.feeds[i].priority,
                            audio    = model.feeds[i].audio,
                            splash   = model.filebase + model.feeds[i].splash,
                            program  = model.feeds[i].program,
                            active   = model.feeds[i].active
                        };

                        lateliveList.Add(latelive);
                    }

                    lateliveListView.ItemsSource = lateliveList;
                }
            }

            catch (Exception)
            {
            }
        }
Exemplo n.º 2
0
        private void lateliveListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Latelive item = (Latelive)lateliveListView.SelectedItem;

            if (item == null)
            {
                return;
            }

            IsLoadLatelive = true;

            latelivePlayerButton.Source         = new BitmapImage(new Uri("ms-appx:///Assets/Icons/pause.png"));
            latelivePlayerPanel.Visibility      = Visibility.Visible;
            latelivePlayerTitle.Text            = item.program;
            latelivePlayer.Source               = new Uri(item.audio);
            latelivePlayer.CurrentStateChanged += LatelivePlayer_CurrentStateChanged1;
        }