banner
Workin' on Windows running on Windows Azure
Posts
 
Previous Next 

If you are using the Silverlight 2 MediaPlayer that comes with Expression Encoder but are not using IIS Smooth Streaming, you can slim the player down from 162k to 90k pretty easily.

First off, edit a copy of the template you want to put on a diet in Visual Studio:

image

Next, open the Expression Player project and remove the reference to adaptive streaming:

image

Now comment out the adaptive streaming references in Expression Media Player:

Using directive:

image

OnMediaOpened:

image

AdaptiveStreamingSourceFactory class definition:

image

SourceFactory initialization in the constructor:

image

If you now recompile the project and try it out in Expression Encoder, you'll see that the XAP has shrunk:

image

Part two of this tip can be applied to any XAP made in Visual Studio 2008 or Expression Blend. 

1) Rename the XAP to ZIP and extract the contents using your favorite ZIP utility.. here I'm showing how to do this using the shell:

image

Now recompress it using the same tool and you'll see a magic saving of a further 22k:

image

For an even greater saving, it would be possible to eliminate the dependency on LINQ but, for now, I shall leave this as an exercise for the reader :-)

Comments[2]
  1. 1. Made by James Clarke on 6/15/2010 4:46:14 AM

    Great tip James.. Is there any work being done on moving more of the SL1 templates to SL2? If so, could these be placed on codeplex? It definatley would be a timesaver, as I like a few of the SL1 templates over the SL2 ones.


  2. 1. Made by James Clarke on 6/15/2010 4:46:14 AM

    Chris.. thanks for the feedback on the V1 templates.. We are working on some better designs for the next version. We are also looking at Codeplex.. stay tuned for more info :-)


 Name
  email (will not be shown)
 web site


Close

7/31/2010 10:51:37 AM