5

I'm using Xamarin with Visual Studio + the Media Plugin by Media Plugin by James Montemagno.

I'm using it to access the native device gallery, using PickVideoAsync() to choose/pick a video.

var file = await CrossMedia.Current.PickVideoAsync();

I want to get the full path of the video (var file) I'm picking.

However, the resulting file seems to be a temporary (and compressed) version of the actual file. Therefore the path this file is referring to is not the original file path.

My Results:

file.Path: /var/mobile/Containers/Data/Application/9436142C-F8A1-43BF-ADE9-AD2DD676FC65/Documents/temp/trim.33800B19-DCDE-4629-896F-B34F5CDFB768.MOV

file.AlbumPath: assets-library://asset/asset.mov?id=8938D860-B84F-4878-9EA2-E91CBF9E9157&ext=mov

file.Path = temporary filepath

file.AlbumPath = seems to be a unique "path" that refers to the file no matter what changes are applied to the gallery. Sadly, this file seems to be an URI/URL.

How to get the actual path, or at least the actual file name?

Hint: var file is from type something like Media.Plugin.Abstractions.MediaFile as far as I remember, so it's not an actual .NET type

0

Browse other questions tagged or ask your own question.