0

asset is not null but avAsset always comes up as null. That's why I can't get video url. How can I fix this?

var vOptions = new PHVideoRequestOptions();
vOptions.NetworkAccessAllowed = true;
vOptions.Version = PHVideoRequestOptionsVersion.Original;
vOptions.DeliveryMode = PHVideoRequestOptionsDeliveryMode.FastFormat;

PHImageManager.DefaultManager.RequestAvAsset(asset, vOptions, (avAsset, audioMix, vInfo) =>
{
   if (avAsset != null)
   {
      videoUrl = ((AVFoundation.AVUrlAsset)avAsset).Url.Path;
   }
});

await Task.Delay(5000);
psyduck
  • 51
  • 1
  • 5
  • Can you please have a try with `PHVideoRequestOptionsVersionCurrent`? And do you have a video there? – nevermore Dec 09 '20 at 07:52
  • @JackHua-MSFT I tried but the result did not change – psyduck Dec 09 '20 at 08:21
  • Well your codes looks code, how about implementing `options.progressHandler` as mentioned in [this thread](https://stackoverflow.com/a/33909949/10539446). I will test and update you if I find anything. – nevermore Dec 09 '20 at 09:46
  • Hi @JackHua-MSFT I have same problem. How can i implement ProgressHandler to xamarin ios. I went your suggested thread but I didn't change it to Xamarin.iOS codes. – Pelin Konaray Dec 16 '20 at 11:37
  • You mean you have difficulty translate oc to c#? You can open a new thread and we will support you there. – nevermore Dec 17 '20 at 09:04

0 Answers0