How to play video in isolatedstorage using mediaelement?



How to play video in isolatedstorage using mediaelement?..

Answer / Shailendra Kumar

To play a video file stored in IsolatedStorage, first, you need to read the video file into a `Stream`. Then, create an instance of `MediaElement`, set its source to the stream, and call the `Play()` method. Here's an example:

```csharp
Stream videoStream = await IsolatedStorageFile.GetUserStoreForApplication().OpenToRead("video.mp4", FileMode.Open);
MediaElement mediaElement = new MediaElement();
mediaElement.SetSource(videoStream, "video/mp4");
mediaElement.Play();
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Windows Phone OS Interview Questions

Tell me What are the supported codecs for video?

1 Answers  


Suppose my site is down, and async calls are taking too long to timeout. How can I set a reasonable timeout?

1 Answers  


Explain how to edit location for weather?

0 Answers  


Tell me is it temporary that the control styles are included in App.xaml?

1 Answers  


I see applications using listbox that show scrollbar only on while scrolling. How can I detect that I am scrolling?

1 Answers  


Tell me is there a way to know if my code is running on emulator or device?

1 Answers  


Explain how to deserialize json from a rest call?

1 Answers  


Explain about windows phone user interface?

1 Answers  


How do you know you have a virus on your phone?

1 Answers  


How to save screen from an XNA app?

1 Answers  


What is windows phone web browser?

1 Answers  


Can you please explain the best way to detect that I am in design-mode in expression blend or visual studio?

1 Answers  


Categories