Playing Smooth Streaming Content in Silverlight

The main goal of Smooth Streaming (SSF) is to provide a way to stream video and provide an automatic fallback mechanism when there is network congestion and avoid constant rebuffering. The client can communicate with the server and request low bandwidth video when the connection is slow and higher quality video when the connection recovers. This mechanism is automatically built-in to Silverlight players.

The content can be static (on-demand) or live (broadcast situations). Both of them are explained in the following material.

Sample HTML files that can be used to quickly add Smooth Streaming capabilities to your web server can be found in <InstallDir>\Examples\LTMM\HTML\SSF.

Here are the instructions for quickly testing them in your web server. These instructions are for a IIS Server with Smooth Streaming capabilities. At the time this tutorial was written, the IIS Smooth Streaming capabilities were provided through IIS Media Services. More information can be found at http://www.iis.net/download/ServeMedia. If the link has moved, search for "IIS Smooth Streaming".

In general, the HTML pages with the player and the SSF content are stored on the web server and are accessed from client computers. For testing purposes, keep them on your development computer and access them through http://localhost before deploying to a real web server. It is best to start with a testing server that doesn't have too many security restrictions so you don't run into authentication and "access denied" errors until you become familiar with the process.

The following steps are for Windows Vista, but Windows 7 and XP have similar steps:

  1. Check whether IIS is working by going to http://localhost . If you see the IIS or your page, skip to step 3.

  2. Enable IIS. In most operating systems, this can be done by going to "Control Panel"->"Programs and Features"->"Turn Windows Features On or Off" and selecting "Internet Information Services".

  3. Make sure IIS is working by going to http://localhost . You should now see the standard IIS page or your default web server page. If you don't, go back to step 2 and install more options.

  4. Install IIS Media Services Extension by going to http://www.iis.net/download/SmoothStreaming and clicking the "Install IIS Media Services" button. If you do not have the "Microsoft Web Platform Installer", you will have to install that first. Again, if the link doesn't work, search for "IIS Media Services" and install it from there.

  5. Copy the contents of <InstallDir>\Examples\LTMM\HTML\SSF to C:\inetpub\wwwroot\SSF . (Copy the entire directory).

  6. Enable the Live Smooth Streaming by going to "Control Panel"->"Administrative tools"->"Internet Information Services (IIS) Manager". Click on Sites\Default Web Site\SSF, then click on the Live Smooth Streaming link. If you see a note on the right side saying "Application pool settings must be enabled to enable Live smooth streaming. Click here to update application pool settings", then click on it and click OK on the following message box.
    You should now see a "Live.isml" in the Live smooth streaming publishing points. If you do not see this, then make sure you are in "Features view" and that you have selected SSF folder under the "Default Web Site" on the left side.

  7. Test that it is all working by going to a client computer and playing the static HTML sample using the following url: http://<server-address>/SSF/Static.html.
    This should start playing the video clip present in SSF\Static. Note that you need to have Silverlight installed on the client computer in order to see the video. If you don't have Silverlight installed, then install it and reload the page.

  8. Test that live streaming is working. First you will need to start uploading the live content, after which you can start playing it. Note that this content will be cached on the server and you will only be able to upload the contents once. The second time you try to upload content to an existing IIS Smooth Streaming Publishing point you will get the Win32 error ERROR_INTERNET_CONNECTION_ABORTED (0x80072EFE).
    To upload the content, run the ConvertSSF demo, select the source file and choose the following target filename:
    http://<server-address>/SSF/Live.isml
    Start the conversion and let it run. Note that you won't be able to stop and restart the conversion (you will get the 0x80072EFE error). If you want to replace the live stream, you will need to shut down the live publishing stream by going into the list of live publishing points, clicking on Live.isml and then clicking on Shut down publishing point. After that, you can run the conversion again.
    It is best to choose a long file so you can also check out the seeking feature.

  9. Play the live stream by opening the following URL on a client computer:
    http://<server-address>/SSF/Live.html
    (Note that when you push video to the server, you push to a .ISML file; and when you play, you play the corresponding .HTML file.

  10. Now that you have successfully played the same streams,create your own static or live streaming points.
    For static streams:

    1. Create a folder (for example, C:\inetpub\wwwroot\SSF\MyStaticFolder)

    2. Copy the smooth streaming files to C:\inetpub\wwwroot\SSF\MyStaticFolder

    3. Copy C:\inetpub\wwwroot\SSF\static.html as C:\inetpub\wwwroot\SSF\MyStatic.html and modify the following line from the end of MyStatic.html:
      <param name="InitParams" value="mediaurl=Static/manifest.ism/manifest" />
      to be
      <param name="InitParams" value="mediaurl=MyStaticFOlder/manifest.ism/manifest" />

    4. Play the new html file: http://<server-address>/SSF/MyStatic.html

For live streams:

    1. Create a new live point (C:\inetpub\wwwroot\SSF\MyLive.isml). Copy Live.isml as MyLive.isml

    2. Copy C:\inetpub\wwwroot\SSF\Live.html as C:\inetpub\wwwroot\SSF\MyLive.html

    3. Change the following line from the end of MyLive.html:
      <param name="InitParams" value="mediaurl=Live.isml/manifest" />
      to be
      <param name="InitParams" value="mediaurl=MyLive.isml/manifest" />

    4. Push live content using the ConvertSSF demo and setting the output file format to
      http://<server-address>/SSF/MyLive.isml

    5. Play the new html file: http://<server-address>/SSF/MyLive.html

Note that static streams are described in .ISM files, while the live points use a .ISML file.

Of course, you can create your own player page and you can pass the URL as a parameter so you don't have to create a new HTML file for each stream. How to do that is beyond the scope of this tutorial.

The SSF content is generated by the LEAD SSF Writer. See the Using the LEAD SSF Writer topic for more details on how to use this filter and about the compressions supported by the Smooth Streaming Format.

See Also:

Using the LEAD SSF Writer

LEAD SSF Writer