In my Xamarin.Forms app, I want to use a DependencyService for each platform to get meta data about local media files such as Height, Width and Rotation. Here is how I do it in Android:
public double ReturnVideoHeight(string mediaFilePath)
{
MediaMetadataRetriever reader = new MediaMetadataRetriever();
reader.SetDataSource(mediaFilePath);
var str = reader.ExtractMetadata(MetadataKey.VideoHeight);
if (double.TryParse(str, out double num))
{
return num;
}
return -1;
}
public double ReturnVideoWidth(string mediaFilePath)
{
MediaMetadataRetriever reader = new MediaMetadataRetriever();
reader.SetDataSource(mediaFilePath);
var str = reader.ExtractMetadata(MetadataKey.VideoWidth);
if (double.TryParse(str, out double num))
{
return num;
}
return -1;
}
public string ReturnVideoRotation(string mediaFilePath)
{
MediaMetadataRetriever reader = new MediaMetadataRetriever();
reader.SetDataSource(mediaFilePath);
return reader.ExtractMetadata(MetadataKey.VideoRotation);
}
I can't seem to find iOS libraries to accomplish the same thing. How could I go about this?