0
votes

I require to play a short video in my WP8 application. Unfortunately, there is no API available for playback from MediaLibrary.

The only API I know of is as per this link:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394041(v=vs.105).aspx

The above method works only if the VideoFile is stored in Isolated Storage.

While I understand that I can upload files to Isolated Storage using some tools, I would rather prefer to package the Video file inside the xap, and then copy the file to Isolated Storage during run-time.

Can someone please guide me on copying a VideoFile included in Application project to Isolated Storage during run-time.

2

2 Answers

0
votes

You can add a video as an app asset the same way as you add an image. Add video to your project and mark it as Content. The video will be packaged with the app in xap.

0
votes

You accomplish this with the MediaElement control. Here is a great sample on how to use it. The basics is to add it to your xaml and set the source to a file that is has the build action set to content.

<MediaElement x:Name="VidoPlayer" Source="/Assests/MyVideo.wma" AutoPlay="True" Volume="1"/>

So as long as you have a file MyVideo.wma located in the Assests folder and the Build Action is set to Content, you're golden!