views:

632

answers:

3

Hi,

I'm trying to build a simple Silverlight 3 MediaPlayer using the MediaElement tag:

<Border Margin="8,8,0,8" Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1" CornerRadius="7">+
<MediaElement x:Name="FighterPilot" Source="http://localhost/repository/FighterPilot.wmv" Stretch="Fill"/>
</Border>

This works very well for low resolution wmv files. But when a WMV File that has a 720p resolution, i get the build error

Xap packaging failed: System.OutOfMemoryException

Do anyone have any clue why I get this build error?

Thankful for any help on this one!

Update: The PC I'm developing on has loads of free RAM, so memory shouldn't be a problem.

+1  A: 

No, I've never had that problem. The easy solution would be to not include the wmv file in the Silverlight project. You could add it somewhere in the ASP.NET project instead to avoid it being packaged in the xap all together.

James Cadd
Thank you! I removed the WMV file out of the project, and it worked intimidately.
Clean
+2  A: 

Assuming that you are using Visual Studio and the WMV file is in your Silverlight project, set the build action on the WMV file to "None" and set "Copy to output directory" to "Copy Always". That way it will not get bundled with the XAP file.

Or you could consider putting the WMV file in a "Video" directory under the ClientBin folder in the website which you can then access using the following:

FighterPilot.Source = new Uri("/Video/FighterPilot.wmv", UriKind.Relative);
Timothy Lee Russell
A: 

This post has an answer: http://forums.silverlight.net/forums/p/138497/313054.aspx

DMC