Click here to Skip to main content
Email Password   helpLost your password?

Introduction

I used Silverlight technology in my Electronic School web site. With the help of the great MinoPlayer and silver light streaming services, I was able to provide visual lessons to my students. My site was using Silverlight 2 beta 2 for not less than three months, most of my students downloaded that beta version and all things went fine!

Recently, when Microsoft came up with the final version of Silverlight 2, I was facing problems upgrading to that final version. I did not want to interrupt my students upgrading to the latest version and, in the same time, I was afraid if they upgrade to the newer version, for instance when using a website that requires the final version, my web site would no longer provide them with the video lessons!

MinoPlayer’s author has provided a new version of his product that is compatible with the final release of Silverlight 2, but it can not work with Silverlight 2 beta 2. The old version of MinoPlayer can not work with the final release of Silverlight 2!
Also I wanted my new students to be able to download and use the final release of Silverlight.

Using the Code

I was working hard finding a solution that can handle the following scenarios:

After some experimentation, I came up with very simple, and yet efficient, solution of Silverlight versioning conflicts.
In the server side I put the both versions of MinoPlayer. MinoPlayer_Ver1_2.xap (the old version) and I renamed the new version as MinoPlayer_Ver1_2Final.xap and I put them in the same directory. 

The remainder of the magic was implemented in the client side: I provided two nested Silverlight objects. The outer object is pointing to Silverlight 2 final release and the source is pointing to the new version of MinoPlayer:

<object data="data:application/x-silverlight,"
     type="application/x-silverlight-2"
          width="90%" height="330">
<param name="source" value="MinoPlayer_Ver1_2Final.xap">

The download hint for this outer object is pointing to the location of Microsoft’s final release of Silverlight 2:

<a href="http://go.microsoft.com/fwlink/?LinkId=124807"
     style="text-decoration: none;">
<img src='info.PNG' 
style='width:17px; height:19px;border-style: none' align='middle'>
<span class='lazez'><strong>There is a newer version of  
<span style='color:#FF00FF'>Microsoft Silverlight</span>
...Click here if you want to install it</strong></span>
</a>

The inner object is pointing to Silverlight 2 beta 2 and the source is pointing to the old version of MinoPlayer:

<object data="data:application/x-silverlight," 
type="application/x-silverlight-2-b2"
                      width="90%" height="330">
<param name="source" 
value="MinoPlayer_Ver1_2.xap">

The download hint for the inner object is, also, pointing to the location of Microsoft’s final release of Silverlight 2:

<a href="http://go.microsoft.com/fwlink/?LinkId=124807" 
    style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181"
 alt="Click here to install Silverlight"  style="border-style: none">
</a>

Here there is the full HTML code of the idea:

<div align="center">
<!-- outer silverlight object-->
<object data="data:application/x-silverlight," 
type="application/x-silverlight-2"  
width="90%" height="330">
<param name="source" 
value="MinoPlayer_Ver1_2Final.xap">
<param name="onerror" value="onSilverlightError">
<param name="background" value="black">
<param name="initParams" 
value="VideoSource=http://silverlight.services.live.com/77137/Arabic4/video.wmv
,AutoPlay=false,EnableScrubbing=true,InitialVolume=1
,PreviewImage=http://www.eschoolsudan.com/images/PreviewImage.JPG
,LogoImage=http://www.eschoolsudan.com/images/logosmall.JPG,MarkersTimeView=5">
<div class='worningpanel' align="left">
<a href="http://go.microsoft.com/fwlink/?LinkId=124807" 
style="text-decoration: none;">
<img src='info.PNG' 
style='width:17px; height:19px;border-style: none' align='middle'><
span class='lazez'><strong>There is a newer version of  <
span style='color:#FF00FF'>Microsoft Silverlight</span>
...Click here if you want to install it</strong></span>
</a> ...
</div><br>
<div align="center">
<!-- Inner silverlight object-->
<object data="data:application/x-silverlight," 
type="application/x-silverlight-2-b2" 
 width="90%" height="330">
<param name="source" 
value="MinoPlayer_Ver1_2.xap">
<param name="onerror" value="onSilverlightError">
<param name="background" value="black">
<param name="initParams" 
value="VideoSource=http://silverlight.services.live.com/77137/Arabic4/video.wmv
,AutoPlay=false,EnableScrubbing=true
,InitialVolume=1
,PreviewImage=http://www.eschoolsudan.com/images/PreviewImage.JPG
,LogoImage=http://www.eschoolsudan.com/images/logosmall.JPG,MarkersTimeView=5">
<a href="http://go.microsoft.com/fwlink/?LinkId=124807" 
style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" 
alt="Click here to install Silverlight"  style="border-style: none">
</a>
</object>
</div>
</object>
<iframe style='visibility: hidden;
 height: 0; width: 0; border: 0px'></iframe>
</div>

Screen Shots of the Working Application

When the old beta version of Silverlight is installed in the user machine, she will be able to view the lessons while having the chance upgrading to the final release.

When neither of Silverlight versions is installed in the user machine, she will see two links telling her to install Silverlight; pressing either of them she will be able to download the final release.

When the old beta version of Silverlight is installed in the user machine, she will be able to view the lessons while having the chance upgrading to the final release.

When the old beta version of Silverlight is installed in the user machine, she will be able to view the lessons while having the chance upgrading to the final release.

When the old beta version of Silverlight is installed in the user machine, she will be able to view the lessons while having the chance upgrading to the final release.

When the final release of Silverlight is installed in the user machine, she will be provided with the lesson with neither of the links appeared.

Points of Interest

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralGood work
Amro Fawzy
6:00 26 Oct '08  
Thanks for the good work
GeneralRe: Good work
Mekki Ahmedi
6:49 26 Oct '08  
Very thanks "Ibn Al Nil"

To be a good programmer, you must be a good thieve!

GeneralFormatting
Pascal Ganaye
4:29 23 Oct '08  
Your article is hard to read as the width of every paragraph is very large.
I suspect you should insert some carriage return (or is Shift Carriage return?) in the < CODE > sections to wordrap it.
GeneralRe: Formatting
mekki Ahmedi
7:59 23 Oct '08  
Thanks a lot. You may find more friendly version Here

To be a good programmer, you must be a good thieve!


Last Updated 23 Oct 2008 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010