示例#1
0
        public void LoadAllVideos(ObservableCollection <DownloadedVideo> DownloadedList)
        {
            var listTask = GetAllFilesInFolder();

            listTask.ContinueWith(task =>
            {
                var list = listTask.Result;
                DownloadedList.Clear();

                foreach (var item in list)
                {
                    if (item.Name.EndsWith("mp4", StringComparison.CurrentCulture) || item.Name.EndsWith("webM", StringComparison.CurrentCulture))
                    {
                        DownloadedVideo video = new DownloadedVideo
                        {
                            VideoName      = item.Name,
                            VideoPath      = item.Path,
                            VideoTime      = videoUtils.GetVideoDuration(item.Path),
                            IsDownloading  = false,
                            VideoThumbnail = videoUtils.GetVideoThumbnail(item.Path)
                        };
                        DownloadedList.Add(video);
                    }
                }
            });
        }
示例#2
0
 void ShareVideo(DownloadedVideo item)
 {
     if (item != null)
     {
         videoHelper.OpenActionSheet(item.VideoPath);
         ListItemSelected = null;
     }
 }
示例#3
0
        void RemoveVideo(DownloadedVideo videoItem)
        {
            string path  = videoItem.VideoPath;
            int    index = DownloadedList.IndexOf(videoItem);

            System.Diagnostics.Debug.WriteLine("Menu item delete click and its index in collection is: " + index);
            DownloadedList.RemoveAt(index);
            videoHelper.RemoveVideoFile(videoItem.VideoName);
        }
示例#4
0
        private void CreateNewDownloadedVideo(string name)
        {
            DownloadedVideo video = new DownloadedVideo
            {
                VideoName      = name,
                VideoPath      = "",
                VideoTime      = "Downloading...",
                IsDownloading  = true,
                VideoThumbnail = ImageSource.FromFile("downloading.png")
            };

            DownloadedList.Add(video);
        }