Sourabhs
Sourabhs

Reputation: 63

How to access videos from sd card

I'm currently developing a video player for Windows Phone 8 which will show a list of all videos (Stored in phone memory and sd card).

I didn't find any way to access system reserved files and folders by using ExternalStorageDevice class.

ExternalStorageDevice _sdCard = (await ExternalStorage.GetExternalStorageDevicesAsync()).FirstOrDefault();

var folders = await _sdCard.RootFolder.GetFoldersAsync();

MessageBox.Show(folders.Count().ToString());

By using this code I got other folders but I didn't got system folders like Pictures, Music, and Videos.

As well as I didn't got .mp4 files which are directly on root folder.

Please Help me to sort out this problem.

Thanks in Advance.

Upvotes: 3

Views: 454

Answers (1)

Romasz
Romasz

Reputation: 29792

You won't get it working (for now - as many files are reserved and not accessible by third party apps).

Normally to see files on SD card you have to register an extension - point 2 at MSDN:

To read a file, your app must register for a file association in the app manifest file and declare what file types (extensions) it can handle.

Unfortunately (as I've mentioned) many files are reserved (list is here):

But there are some file and URI associations that you can’t use, associations that are reserved. If your app registers for a reserved association, that registration will be ignored.

So for now it is not possible that your App can see these files.

Upvotes: 1

Related Questions