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); } }
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(); } }