views:

30

answers:

1

I'd like to write a Windows Phone 7 app, where you can connect a lot of short video sequenzes to one seamless video for playing (I don't want to edit and really create the video, just play the short ones in a special (not quite random) order).

Is it possible to get a lot of videos on the phone and play them seamless?

+1  A: 

Hi Sam,

The simplest piece of code to play a video on the Windows Phone 7 is -

// media1 is <MediaElement x:Name="media1" />
media1.Source = new Uri("http://yoursite/yourvideo.wmv");
media1.Play();

Since you wish to loop through a number of videos, you can add an event handler for MediaEnded event

media1.MediaEnded += new RoutedEventHandler(media1_MediaEnded);

and load the next media file within the media1_MediaEnded event handler. You may add a PerformanceProgressBar animation that is visible until the media is opened, you can turn off the animation in the MediaElement's MediaOpened event.

Although it is relevant for MP3 files, I found Tim Heuer's post very useful to design my applications. You may need to consider looking at the list of supported media codecs in Windows Phone 7 as all media files may not play on the phone.

HTH, indyfromoz

indyfromoz