public async Task DownloadAndPlaySample(string artist, string title) {
EditVideoBusiness FindVideoBusiness = new EditVideoBusiness();
Media sample = FindVideoBusiness.GetVideoByTitle(MediaType.Video, artist, title);
if (sample != null) {
if (sample.FileName != null && File.Exists(Settings.NaturalGroundingFolder + sample.FileName)) {
// File exists, play.
await PlayVideo(sample);
} else if (sample.DownloadUrl != null) {
// File doesn't exist, download.
// It will only auto-play if user is still on the same page.
downloadPage = currentPage;
await SessionCore.Instance.Business.DownloadManager.DownloadVideoAsync(sample, -1, DownloadBusiness_DownloadCompleted);
}
}
}