Skip to main content
Home Forums Silverlight Design Video and Media media element and silverlight
3 replies. Latest Post by jay nanavati on July 13, 2009.
(0)
TheRekz
Member
4 points
40 Posts
07-05-2009 8:04 PM |
How do you create something like this with a media element?http://narenda.com/silverlight/default.htmlWhat I have so far is:
Canvas[] cI = new Canvas[9]; MediaElement[] me = new MediaElement[9]; int blockSizeW = 97; int blockSizeH = 97; int nx = 0; for (int ix = 0; ix < 3; ix++) for (int iy = 0; iy < 3; iy++) { nx = (ix * 3) + iy; me[nx] = new MediaElement(); me[nx].Height = 300; me[nx].Width = 300; me[nx].Stretch = Stretch.UniformToFill; RectangleGeometry r = new RectangleGeometry(); r.Rect = new Rect((ix * blockSizeW), (iy * blockSizeH), blockSizeW, blockSizeH); me[nx].Clip = r; me[nx].Source = new Uri("assets/SharePoint.wmv", UriKind.Relative); me[nx].SetValue(Canvas.TopProperty, Convert.ToDouble(iy * blockSizeH * -1)); me[nx].SetValue(Canvas.LeftProperty, Convert.ToDouble(ix * blockSizeW * -1)); cI[nx] = new Canvas(); cI[nx].Width = blockSizeW; cI[nx].Height = blockSizeH; cI[nx].Children.Add(me[nx]); cI[nx].SetValue(Canvas.NameProperty, "C" + nx.ToString()); cI[nx].MouseLeftButtonDown += new MouseButtonEventHandler(Page_MouseLeftButtonDown); if (nx < 8) GameContainer.Children.Add(cI[nx]); }
but it always gives me an error:
Error: Unhandled Error in Silverlight 2 Application SlidingBlocks.xapCode: 4001 Category: MediaError Message: AG_E_NETWORK_ERROR
jay nana...
Contributor
3388 points
624 Posts
07-06-2009 2:46 AM |
Create folder "assets" in the ClientBin directory under SilverlightApplication.Web project, put your video in this folder. and set source like this:
brightstar
406 points
185 Posts
07-06-2009 9:22 PM |
I haven't such error as the topic-starter had at http://narenda.com/silverlight/default.html
I have the next error:
Webpage error detailsUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)Timestamp: Tue, 7 Jul 2009 01:20:42 UTCMessage: Syntax errorLine: 1Char: 1Code: 0URI: http://narenda.com/silverlight/default.xaml
07-13-2009 4:36 AM |
Hi brightstar,
I have checked the url but I am not getting any error in IE 7 ,IE8 or in Mozilla Firefox 3.