How to open a local file with Xamarin?

Asked

Viewed 607 times

1

Using Xamarin with Visual Studio and C#, I made an Android application and am creating a player using VideoView.

I wonder how to access the mobile folder that contains the video.

For example: "/storage/pasta/video.mp4".

I know it’s something with the .SetVideoPath of VideoView, but I didn’t understand how.

  • 1

    Try to see it in the Xamarin documentation itself. It will help you a lot: https://developer.xamarin.com/recipes/android/data/files/browse_files/

1 answer

2


Ronaldo, I don’t understand if this is what you want, but when I have to access a certain folder I use the following code:

var documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonVideos);
        var filePath = System.IO.Path.Combine(documentsPath, filename);

Now with filePath I already have the path to be accessed (in the case of the default videos folder).

See if the link Working with files help you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.