Ejemplo n.º 1
0
        public void InitializeVideoImage()
        {
            if (_videoImage != null)
            {
                return;
            }

            if (HasThumbnail || HasMoviePicture)
            {
                _videosImageLoadingState = LoadingState.Loaded;

                Task.Run(async() =>
                {
                    await DispatchHelper.InvokeInUIThreadHighPriority(async() =>
                    {
                        VideoImage = await GetBitmap();
                    });
                });
            }
            else if (_videosImageLoadingState == LoadingState.NotLoaded)
            {
                _videosImageLoadingState = LoadingState.Loading;
                Locator.MediaLibrary.GenerateVideoThumbnailAsync(this);
            }
        }
Ejemplo n.º 2
0
        public async Task DeleteVideoThumbFile()
        {
            await DispatchHelper.InvokeInUIThreadHighPriority(() =>
            {
                // Release the image source URI to allow the file deletion.
                if (_videoImage != null)
                {
                    _videoImage.UriSource = null;
                }
            });

            var thumbFile = await tryGetVideoThumbFile();

            if (thumbFile != null)
            {
                await thumbFile.DeleteAsync();
            }
        }