void StartDownloadData()
 {
     xLoadGrid.Visibility  = Visibility.Visible;
     _channelDetailFactory = new ChannelDetailFactory();
     _channelDetailFactory.HttpFailHandler    += _channelDetailFactory_GetChannelDetailByVIDFailed;
     _channelDetailFactory.HttpSucessHandler  += _channelDetailFactory_GetChannelDetailByVIDSucceed;
     _channelDetailFactory.HttpTimeOutHandler += _channelDetailFactory_GetChannelDetailTimeout;
     _channelDetailFactory.DownLoadDatas(VID);
 }
        private void RequestDatas()
        {
            _dataSource = null;
            DataContext = null;

            channelList.ItemsSource  = null;
            downloadList.ItemsSource = null;
            loadingTip.Visibility    = Visibility.Visible;

            _downloadList.Clear();
            _channelDetailFactory.DownLoadDatas(_id);
        }
Exemple #3
0
        private void LoadDatas(int vid)
        {
            CloseWaitToolTips();
            _downloadList.Clear();

            BottomAppBar.IsOpen    = false;
            downloadBar.Visibility = Visibility.Collapsed;

            btnPlayList.IsChecked       = true;
            btnDownload.IsChecked       = false;
            channelListView.Visibility  = Visibility.Visible;
            downloadListView.Visibility = Visibility.Collapsed;

            _dataSource = null;
            DataContext = null;
            channelListView.ItemsSource  = null;
            downloadListView.ItemsSource = null;

            if (loadingTip.Visibility == Visibility.Collapsed)
            {
                OpenWaitToolTips();
                _channelDetailFactory.DownLoadDatas(vid);
            }
        }
Exemple #4
0
        void BeginGetInfoNPlay(bool isPlayOtherProgram = false, bool isPlayNextProgram = true)
        {
            if (isPlayOtherProgram)
            {
                if (ChannelDetailInfo != null)
                {
                    if (isPlayNextProgram)
                    {
                        //下一集
                        int temp = ProgramIndex + 1;
                        if (temp < ChannelDetailInfo.ProgramInfos.Count)
                        {
                            //有下一集时, 1.保存当集 2.播放下一集
                            _currentPlayBitrate = null;
                            SetInfo(true, "正在加载第" + ChannelDetailInfo.ProgramInfos[temp].Title + "集");

                            SetControlBarStatus(false, true);
                            ProgramIndex = temp;
                            SaveToDB(temp - 1);
                        }
                        else
                        {
                            if (NavigationService.CanGoBack)
                            {
                                NavigationService.GoBack();
                            }
                        }
                    }
                    else
                    {
                        //上一集
                        int temp = ProgramIndex - 1;
                        if (temp >= 0)
                        {
                            //有上一集时, 1.保存当集 2.播放上一集
                            _currentPlayBitrate = null;
                            SetInfo(true, "正在加载第" + ChannelDetailInfo.ProgramInfos[temp].Title + "集");
                            SetControlBarStatus(false, true);
                            ProgramIndex = temp;
                            SaveToDB(temp + 1);
                        }
                    }
                }
                else
                {
                    //_isPlayProgram = true;
                    //_isPlayNextProgram = true;
                }
            }
            if (ChannelDetailInfo == null)
            {
                //重新读取影片信息
                SetControlBarStatus(false, true);
                SetInfo(true, "正在读取影片信息");
                _channelDetailFactory.DownLoadDatas(VID);
            }
            else if (_currentPlayBitrate == null || string.IsNullOrEmpty(_currentPlayBitrate.Rid) ||
                     _currentPlayBitrate.Rid == "null")
            {
                //只读Play接口信息
                StartGetPlayAPI();
            }
        }
 private void OnRefreshPage(object sender, EventArgs e)
 {
     xLoadGrid.Visibility = Visibility.Visible;
     _channelDetailFactory.DownLoadDatas(VID);
 }
Exemple #6
0
 void StartDownloadData()
 {
     xLoadGrid.Visibility = Visibility.Visible;
     _channelDetailFactory = new ChannelDetailFactory();
     _channelDetailFactory.HttpFailHandler += _channelDetailFactory_GetChannelDetailByVIDFailed;
     _channelDetailFactory.HttpSucessHandler += _channelDetailFactory_GetChannelDetailByVIDSucceed;
     _channelDetailFactory.HttpTimeOutHandler += _channelDetailFactory_GetChannelDetailTimeout;
     _channelDetailFactory.DownLoadDatas(VID);
 }
 private void BeginGetDetailInfo()
 {
     _channelDetailFactory.DownLoadDatas(_playInfo.ChannelVID);
 }