1
votes

Within Windows Phone 8 I have a solution whereby I am capturing a video and saving it to local storage using the new WPRT Windows.Storage APIs.

When I want to playback the video using a MediaElement control I appear to be stuck as it doesn't support playback from local storage (only isolated storage).

The code I am using is:

public async void MethodName(IStorageFile file){
            var stream = (await file.OpenReadAsync()).AsStream();
            VideoPlayer.SetSource(stream);
            VideoPlayer.Play();
}

Yet when I run it I receive an exception "Stream must be of type IsolatedStorageFileStream".

I've also attempted to set the Source to a URI pointing to the file's location property, and following typical local storage URI convention - but this gets ignored.

Has anyone come across a solution to this?

1

1 Answers

0
votes

Isolated Storage and Local Storage are the same location on the phone.

It looks like you need to use the Isolated Storage APIs rather than the new-fangled Windows Runtime ones in this case.