Beispiel #1
0
        private async void ListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            var l = (sender as ListView).ItemsSource as List <PartDiaplayModel>;

            var data = e.ClickedItem as PartDiaplayModel;

            StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(data.path);

            if ((await storageFolder.GetFilesAsync()).Count(x => x.FileType == ".flv") > 1)
            {
                MessageDialog md = new MessageDialog("该视频由多段FLV文件组成,建议合并后观看\r\n是否要合并文件?");
                md.Commands.Add(new UICommand("合并")
                {
                    Id = 0
                });
                md.Commands.Add(new UICommand("取消")
                {
                    Id = 1
                });
                if (Convert.ToInt32((await md.ShowAsync()).Id) == 0)
                {
                    var dialog = DownloadHelper2.videoProcessingDialogs.FirstOrDefault(x => x.ID == data.cid);
                    if (dialog == null)
                    {
                        dialog = new VideoProcessingDialog(data.cid, data.title + " " + data.eptitle, storageFolder);
                        DownloadHelper2.videoProcessingDialogs.Add(dialog);
                    }
                    await dialog.ShowAsync();

                    return;
                }
            }


            List <PlayerModel> ls = new List <PlayerModel>();
            int i = 0;

            foreach (var item in l)
            {
                ls.Add(new PlayerModel()
                {
                    Aid = item.id, Mid = item.cid, Mode = PlayMode.Local, No = "", VideoTitle = item.eptitle, Path = item.path, Title = item.title, episode_id = item.epid
                });
                i++;
            }


            MessageCenter.SendNavigateTo(NavigateMode.Play, typeof(PlayerPage), new object[] { ls, l.IndexOf(data) });
        }
Beispiel #2
0
        private async void btn_ToMp4_Click(object sender, RoutedEventArgs e)
        {
            var           model         = (sender as MenuFlyoutItem).DataContext as PartDiaplayModel;
            StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(model.path);

            if ((await storageFolder.GetFilesAsync()).Any(x => x.FileType == ".flv"))
            {
                var dialog = DownloadHelper2.videoProcessingDialogs.FirstOrDefault(x => x.ID == model.cid);
                if (dialog == null)
                {
                    dialog = new VideoProcessingDialog(model.cid, model.title + " " + model.eptitle, storageFolder);
                    DownloadHelper2.videoProcessingDialogs.Add(dialog);
                }
                await dialog.ShowAsync();
            }
            else
            {
                Utils.ShowMessageToast("该视频已经是MP4格式了");
            }
        }