Ejemplo n.º 1
0
        /// Triggers the initial AVAssetDownloadTask for a given Asset.
        public void DownloadAsset(MusicAsset asset)
        {
            Track.Download(asset.Music);

            // For the initial download, we ask the URLSession for an AVAssetDownloadTask
            // with a minimum bitrate corresponding with one of the lower bitrate variants in the asset.
            var taskOptions = new AVAssetDownloadOptions {
                MinimumRequiredMediaBitrate = 265000
            };

            var task = assetDownloadURLSession.GetAssetDownloadTask(asset.UrlAsset, asset.Id, null, taskOptions);

            // To better track the AVAssetDownloadTask we set the taskDescription to something unique for our sample.
            task.TaskDescription = asset.Id;

            activeDownloadsMap [task] = asset;

            task.Resume();

            AssetDownloadStateChanged?.Invoke(this, new MusicAssetDownloadStateChangeArgs(asset.Music, MusicAssetDownloadState.Downloading));
        }
Ejemplo n.º 2
0
 public AVAssetDownloadTask GetAssetDownloadTask(AVUrlAsset urlAsset, string title, NSData artworkData, AVAssetDownloadOptions options)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 public AVAssetDownloadTask GetAssetDownloadTask(AVUrlAsset urlAsset, NSUrl destinationUrl, AVAssetDownloadOptions options)
 {
     throw new NotImplementedException();
 }