Section 1: Smooth Streaming Video from Blob Storage


In this lab, you will build a Silverlight Media Player that plays videos stored in Azure Blob Storage. The player will utilize “Smooth Streaming”, which is the Microsoft HTTP-based adaptive streaming protocol. This approach uses HTTP progressive download to download and play chunks of a video stream.


In this lab, you will:

  • Learn to create a Silverlight Media Player.
  • Learn to store videos in Azure Blob Storage.

System Requirements

You must have the following items to complete this lab:


This lab uses several tools and resources that must be downloaded and installed prior to starting the lab. These resources are:

  • The Big Buck Bunny video
  • Adaptive Streaming with Windows Azure Blobs Uploader
  • Azure Storage Explorer

Download the Big Buck Bunny video from and save it in a working directory.

Download the Adaptive Streaming with Windows Azure Blobs Uploader ( Unzip the files into the same working directory where you placed the Big Buck Bunny video.

Download the Azure Storage Explorer. Run AzureStorageExplorer4.msi to install the tool.

The Windows Azure SDK (included in Windows Azure Tools for Visual Studio) installs a simulation environment on your development machine for testing Azure applications locally before deploying them to the cloud. The simulation environment consists of the development fabric to host web and worker roles, and the development storage which simulates cloud blob, table and queue storage locally.

Development storage uses SQL Server as its underlying storage mechanism, and by default the SDK will attempt to configure it to use SQL Server Express. If you do not have SQL Server Express installed before installing the SDK, or you wish to simply use an existing SQL Server instance to host the development storage database, you must run the dsinit command to select the SQL Server instance where the database will be created.

Please see instructions below for how to run dsinit.

Using dsinit to Configure Development Storage

  1. Open a command prompt.
  2. Edit the following command line as appropriate for your environment, where [AzureSDKInstallDrive] is the drive where you installed the Azure SDK (or Windows Azure Tools for Visual Studio), and [YourSqlInstance] is the SqlServer where you want to create the development storage database.[AzureSDKInstallDrive]\ Program Files\Windows Azure SDK\v1.3\bin\devstore\dsinit.exe /sqlinstance:[YourSqlInstance]Example Command Line:“C:\Program Files\Windows Azure SDK\v1.3\bin\devstore\dsinit.exe” /sqlinstance:.
  3. Note that the sample command line above uses the value “.” for the sqlinstance argument, which specifies that the local default SQL instance will be used for development storage.


This Hands-On Lab is comprised of the following exercises:

  1. Smooth Streaming Content
  2. Smooth Steaming in SharePoint 2010

Estimated Time to complete this lab: 30 minutes

Exercise 1: Smooth Streaming Content

In this exercise, you will create the smooth streaming content to upload into Azure. Then you will play the content in a SharePoint 2010 site.

Task 1 – Installing the Expresion Encoder Publishing Plugin

In this task, you will install the Expression Encoder Publishing Plugin for creating the smooth streaming content.

  1. Open a Command Prompt window running as administrator on your machine.
  2. Change the directory to the EncoderPlugin directory associated with the Adaptive Streaming with Windows Azure Blobs Uploader binaries you downloaded during the exercise setup.
  3. Execute install.cmd.

Task 2 – Publishing the Content

In this task, you will create the smooth streaming content and publish it to Azure.

  1. Open Microsoft Expression Encoder 4.
  2. In the Load a New Project screen, click Silverlight Project.
  3. In Expression Encoder 4, click Import.
  4. In the Import Media Files, navigate to the video you downloaded earlier and click Open.
  5. Right click the video and select Apply Preset>Encoding for Silverlight>IIS Smooth Streaming>VC-1 IIS Smooth Streaming - SD 480p VBR.
  6. In the Publish Window, select Windows Azure Adaptive Streaming Publisher from the Publish To drop-down list.
  7. Check the Publish After Encode box.
  8. Enter the Account Name for your Azure account.
  9. Enter the Account Key for your Azure account.
  10. In the Path field, enter smoothstreaming.

    Figure 1

    Publish Settings

  11. Select File>Save Job from the main menu and save the project with the name SmoothStreamingEncoding.
  12. Click Encode.
  13. After the encoding and uploading process is complete, the browser will open with the video running.

Exercise 2: Smooth Streaming in SharePoint 2010

In this exercise, you will play the smooth streaming content in a SharePoint 2010 site.

Task 1 – Playing the Video in SharePoint 2010

In this task, you will play the smooth streaming video in SharePoint 2010.

  1. Run the Azure Storage Explorer you installed as part of the lab set up.
  2. When prompted, add your account information.
  3. Click the Blobs button in the ribbon.
  4. Double click the smoothstreaming folder to display all of the files previously uploaded into Azure.
  5. Double click the MediaPlayerTemplate.xap file to open the Properties window.
  6. Record the Absolute Uri to the package for use in SharePoint 2010 later.
  7. Double click the Manifest file.
  8. Record the Absolute Uri to the Manifest for use in SharePoint 2010 later
  9. Open a SharePoint 2010 site and optionally add a new page for hosting web parts.
  10. Select Site Actions>Edit Page.
  11. Click Insert>Web Part in the ribbon.
  12. In the Media and Content category, select the Silverlight Web Part and click Add.
  13. In the Silverlight Web Part dialog, enter the absolute Uri to the MediaPlayerTemplate.xap file and click OK.
  14. Click Edit Web Part.
  15. Under the Other Settings category, click Custom Initialization Parameters.
  16. Put the following string in this field being careful to enter the absolute Uri for your manifest.



  17. Click OK and the video should begin to play.

Task 2 – Creating a Time-Limited Uri

In this task, you will create a tme-limited URL for the video so that it can be played for only a specified period of time..

  1. Run the Azure Storage Explorer you installed as part of the lab set up.
  2. Click the Blobs button in the ribbon.
  3. Click the smoothstreaming folder.
  4. Click the Manifest file.
  5. Click the Security button in the ribbon.
  6. In the Blob & Container Security dialog, click the Shared Access Policies tab.
  7. In the Policy Name field type Time Limited.
  8. Check the Read box.
  9. In the Start Time and Expiry Time boxes, enter a time range.

    Figure 2

    Shared Access Policies

  10. Click Save Policies.
  11. Close the Blob & Container Security dialog.
  12. Click the Security button in the ribbon.
  13. In the Blob & Container Security dialog, click the Shared Access Signatures tab.
  14. Make sure the Container Name is set to smoothstreaming and the Blob Name references the Manifest file.
  15. In the Policy drop-down list, select the Time Limited policy.
  16. Click Generate Signature.

    Figure 3

    Shared Access Signatures

  17. Click Copy to Clipboard.
  18. Click the Container Access tab.
  19. Change the Container Access Level to Private.
  20. Click Update Access Level.
  21. Click Close.
  22. Return to the page where the Silverlight Web Part is located and edit the web part properties.
  23. Under the Other Settings category, click Custom Initialization Parameters.
  24. Carefully replace the value of the MediaSource element with the value you copied from the Azure Storage Explorer.
  25. Escape all of the ampersands in the new MediaSource element with &amp; or the resulting XML will be invalid.
  26. Save the changes and play the video.


In this lab you learned about smooth streaming video. You used community tools to convert a video and save it into Azure blob storage. You then used the available Silverlight web part in SharePoint 2010 to play the video.