WynApse Home Page
Home    Blog    About    Contact       
Latest Article:


My Tags:
My Sponsors:






Lifetime Member:

<SL2Tooltip Number="003" animationcount<"?" />




The Problem

I'm not quite sure when this problem began, and I'm pretty well positive it's not ONLY Silverlight that is causing it either. I want to associate it with Silverlight greater than 1.0, but that's just me :)

Here's the deal... I've had the rotating Silverlight logo on WynApse.com since Mike Harsh first exposed it, I believe it was the day they branded WPF/E as Silverlight. The animation is a wmv that spins once through the sequence, and I have it setup so that when the animation completes, it kicks itself back off again for another go-around.

This looks pretty cool on the site although after a year and a half, I'll admit maybe I'm getting jaded, but that's not the problem. The problem is that my Dell workstation works just fine at reboot, but over a period of time (where t=varying and unknown), the workstation would degrade to the point that a wmv file would no longer play, including the logo. Now I don't play a lot of videos, but it is disconcerting when you get something in an email that you can't open it! And, since I use my site as a portal of sorts, I like to have the site open in my browser.

In the back of my mind, I've sort of considered it might be the logo, but geez... once the browser would shut down, what difference could it possibly make?

The Solution

Last week, I decided to take a bit of time and see if I could clobber the logo and over a period of time notice a difference in the operation of the workstation.

I modified the JS to allow the logo to run twice through and then clean out the canvas. I was already displaying the Microsoft Silverlight logo beneath the wmv, so when the canvas is cleared, the logo is displayed.

The site This has been running in this manner for almost a week now, and without rebooting the box, I was able to run a wmv last night...

Conclusions?

I don't know if I can formulate any conclusions from this... this is a pretty empirical solution to the problem. It might be the video card, which is not all that great since I'm not into gaming. It might be the workstation itself since it is getting a tad old. It might be (gasp) Silverlight, although I doubt it.

I just think it's all the above rolled together. I use IE6 at work, and use my site as a portal, and have never experienced any issues, and I hardly ever reboot that box. IE7 at home and the rest of the gang, and the problem exists.

Just writing this down in case anyone else may have had trouble with my site, or while doing something similar on theirs!

JavaScript for the logo:

var nLogoLoopCount;

function root_LogoLoaded(sender, args) {
var media = sender.findName("media");
media.addEventListener("mediaEnded", "LogohandleCompleted");
nLogoLoopCount=0;
}

function LogohandleCompleted(sender, eventArgs) {
sender.stop();
nLogoLoopCount = nLogoLoopCount + 1;
if (nLogoLoopCount = 2)
{
sender.findName("LogoLoopCanvas").children.clear();
}
else
{
sender.play();
}
}

function _LogoLinkDown(sender, args){
window.location="http://silverlight.net/default.aspx";
}


XAML for the logo:

<Canvas 
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Cursor="Hand" MouseLeftButtonDown="_LogoLinkDown"
x:Name="LogoLoopCanvas">
<MediaElement x:Name="media" Loaded="root_LogoLoaded" Source="http://www.wynapse.com/images/silverlightLogoLoop.wmv" Canvas.Left="11" Canvas.Top="0" Height="110" Width="110" />
<Line X1="0" Y1="0" X2="143" Y2="0" Stroke="White" StrokeThickness="2" />
<Line X1="0" Y1="110" X2="143" Y2="110" Stroke="White" StrokeThickness="2" />
</Canvas>
Copyright © 2006-2017, WynApse