Пример #1
0
        protected void LoadThumbnailAsync(NetworkItemInfo item, ICollection <Thumbnail> thumbnailList, bool useUnsupportedThumbnail, int codePage)
        {
            var thumbnail = thumbnailList?.FirstOrDefault(x => x.Name == item.Name.ToLower() && x.ParentPath == item.ParentFolderPath.ToLower() &&
                                                          x.Size == (ulong)item.Size && x.CreatedDateTime == item.Modified);

            if (thumbnail == null)
            {
                //썸네일 로드
                if (useUnsupportedThumbnail)
                {
                    var url = item.GetAuthenticateUrl(Settings.Server);
                    Windows.Foundation.Collections.PropertySet ps = new Windows.Foundation.Collections.PropertySet();
                    ps["codepage"] = codePage;
                    var ffInfo = CCPlayer.UWP.Factory.MediaInformationFactory.CreateMediaInformationFromUri(url, ps);
                    LoadThumbnailFromMediaInformaion(item, ffInfo);
                }
            }
            else if (useUnsupportedThumbnail)
            {
                //캐싱 이미지 로드
                LoadCachedThumbnail(item, thumbnail);
            }
        }
Пример #2
0
        protected async Task <ImageSource> GetThumbnailAsync(NetworkItemInfo item, ICollection <Thumbnail> thumbnailList, bool useUnsupportedThumbnail, int codePage)
        {
            ImageSource imageSource = null;
            var         thumbnail   = thumbnailList?.FirstOrDefault(x => x.Name == item.Name.ToLower() && x.ParentPath == item.ParentFolderPath.ToLower() &&
                                                                    x.Size == (ulong)item.Size && x.CreatedDateTime == item.Modified);

            if (thumbnail == null)
            {
                //썸네일 로드
                if (useUnsupportedThumbnail)
                {
                    //썸네일을 로드하지 못한 경우  FFmpeg으로 처리
                    var url    = item.GetAuthenticateUrl(Settings.Server);
                    var ffInfo = CCPlayer.UWP.Factory.MediaInformationFactory.CreateMediaInformationFromUri(url);
                    imageSource = await GetThumbnailAsync(item, ffInfo);
                }
            }
            else if (useUnsupportedThumbnail)
            {
                //캐싱 이미지 로드
                imageSource = await GetChachedThumbnail(thumbnail);
            }
            return(imageSource);
        }