views:

647

answers:

1

So I have some URL of an MP4 file. I want to develop a simple Silverlight application to play it.

How to do it? (Preferably with example code.)

+1  A: 

Ole Jak,

Here is a suggested step-by-step:

Step 1: Create a sample Silverlight application with Visual Studio (File / New Project / Silverlight Application

Step 2: In your newly create project, edit the MainPage.xaml, and place the following code inside the UserControl's Grid

<MediaElement Stretch="Uniform" Grid.Row="0" Width="400" Height="300"
     AutoPlay="true"
     Name="x_Media"
     Source="http://silverlightatlanta.net/Firestarter/Videos/TimHeuer_2.mp4" />

Step 3: Build and Run!

Jim McCurdy
Strange, but it does not work in Google Chrome... And works in IE... (Bilt using blend)
Blender
I tried it, and also I thought it had failed to appear but discovered that it took a full 80 seconds before the video appeared. So make sure you wait long enough for the video that I used in my example to appear. Maybe Google Chrome downloads the video vs. streaming it.
Jim McCurdy