Search code examples
silverlightexpression-blendmediaelement

System.OutOfMemoryException when using MediaElement in Silverlight 3


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.


Solution

  • 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.