I’ve just been scratching my head wondering why I can’t publish from Expression Encoder 2 to Silverlight Streaming using one of the new SL 2 media player templates. The simple answer being that the “Publish to Silverlight Streaming” plug-in doesn’t yet support this (you’ll probably see a message “No Silverlight template found. Please re-encode.” if you try to do this).
I had a play around and found a way to publish the SL 2 player to Silverlight Streaming and get it to play your video – you just have to do it manually rather than rely on the plug-in. Here are the steps I used…
- Package the output from Expression Encoder and upload to Silverlight Streaming in the usual way
- Essentially that means zipping up the MediaPlayerTemplate.xap and your wmv file and uploading
- You can either add a manifest to the zip file before upload or create one using the UI in Silverlight Streaming
- Follow Method 2 “Use a Live Control” to embed your application in a web page
- The MediaPlayer gets its playlist from initparams – that means you need to use the “Live Control” to embed the MediaPlayer application (as far as I can see there’s no way to use initparams with the iframe embed method)
- To point the MediaPlayer at the video to be played, add an initparams attribute to the HTML slscontrol fragment (step 3)
- The initparams attribute takes the form:
- initparams='playlist=<playList><playListItems><playListItem mediaSource="http://silverlight.services.live.com/27832/Test_CanDelete/ProductViewer.wmv" frameRate="10" width="640" height="480" ></playListItem></playListItems></playList>'
- I blogged back here about how you can get a URL permalink for videos uploaded as part of your application.
- Thus you end up with something like:
<devlive:slscontrol silverlightversion="2.0" src="/27832/ProductViewer_Blog/"
initparams='playlist=<playList><playListItems><playListItem mediaSource="http://silverlight.services.live.com/27832/Test_CanDelete/ProductViewer.wmv" frameRate="10" width="640" height="480" ></playListItem></playListItems></playList>'>
Where 27832 is my account ID, Test_CanDelete is the fileSet name and ProductViewer.wmv is the video filename.
Of course, you could *just* publish the MediaPlayer application, publish all your videos to Silverlight Streaming as videos (rather than as part of your application) and then simply use the above technique to point the MediaPlayer to the required video.