Introduction
Web Playlists for Internet Information Services 7 (IIS 7.0) provides the ability to control media delivery to the client and limit the client’s ability to seek or skip individual entries in the playlist. The server administrator may enable or disable seek / skip behavior through fields in the playlist entry.
This feature exists as a Request Handler for the IIS 7.0 pipeline. The actual playlist database is stored in a file per playlist.
This article includes:
Scope
This article describes the steps needed to create a playlist from the Web Playlists module in IIS Manager.
Prerequisites
- IIS 7.0: This module installs over IIS 7.0.
- .NET Framework: This feature has a user interface (UI) that requires the .NET Extensibility role services if you are running the Web Server (IIS) role on Windows Server® 2008 or .NET framework if you plan to install on Windows Vista SP1.
Creating a Simple Playlist
A playlist is a list of media entries. Each entry has a list of possible controls that can be enforced on the server side - Seek, Skip Forward (Next), Skip Backward (Previous). These controls are useful in several situations where you want to limit the control on the playback of a media entry for the client. These situations could be for compliance, monetization (ads) or any other needs like training, etc.
Creating a Playlist in IIS Manager
The first step is to use this feature after it is installed to make a playlist by creating a list of media elements and setting properties that limit the ability to Seek, SkipForward or SkipBackward. The steps involved are:
- Create an empty playlist.
- Add the media entries to the playlist.
- Select Media Entries (either one at a time or in bulk) for the playlist.
- Set the properties for the element(s) and add them to the playlist.
- Ensure that the order of entries in the playlist is correct.
- Set the properties for the playlist.
- Click Apply.
Scenario: The following shows the steps to create a playlist that has an advertisement (that cannot be seeked / skipped) followed by actual content that can be skipped and/or seeked.
Create an Empty Playlist
1. In the IIS Manager, go the Web site that you want to create a playlist for and open the Playlists feature under the Media Services category

2. Click on the “Add Playlist” in the Actions Panel.


Set the Properties for the Playlist
There are following properties available to be set
- Name – This is the playlist file name. This is a unique name and the same name cannot be shared by other playlists.
- Title (optional) – This is the title for the playlist.
- Description (optional, server only) - This can be used by playlist creator to store some information to later distinguish this playlist. This information is not passed on to the client.
- Entries – See “Add Media Entries to the Playlist”
Add Media Entries to the Playlist
1. In the Edit Playlist page, click the Add button in the Entries section to open the “Add Media Entry” dialog box. The details in this dialog will apply to all the entries selected in this dialog
2. In the Add Media Entry dialog box, add the following details to add media entries:
- Local / Playlist or Remote Content – In the drop-down list, select whether the content referenced by the playlist is local or remote.
- Local content is on the local disk(Relative URI/Physical path) or on a UNC share (Physical path) that is accessible to the playlist handler.
- Remote content is a URL to content (for example , http://myServer/myfile.wmv) or to another playlist. If the content location remote, Web Playlist is not able to control seek and skip behavior.
- Also see sections below on how to add Nested Playlists and integrate with web applications to obtain content location
- Content Location – Use the browse button to populate a comma-separated list of content items. The Browse button allows multi-select so you can populate this list either by using the Browse button or by hand coding a comma separated list.
Note: If you are using IIS Manager to connect to a remote server, ensure that the paths correspond to the remote machine. The browse button will not work in this case.
- Content Attributes – These are all optional attributes. It is acceptable to skip them if there is no need in your case.
- Title (optional) – The playlist title.
- Content Controls
- Disable skip forward (optional) – If selected, disallows the content to be skipped so that the next entry is played before the current entry is played. (For example, a particular site may want to disable skip on all advertisements on the site)
Note: Disable skip forward has a dependency on the playlist handler attribute “allowSkipAfterMinPercent”, which specifies when the content skip is enabled. For example, If this attribute value is set to 80, it means that after 80 percent of the content has been viewed, Skip Forward will be enabled (if disabled) and the user will be able to skip to the next item in the playlist. If you want to disallow this, ensure that this value is set to 100.
- Disable skip backward (optional) – If selected, disallows the content to be skipped so that it can be played again from the beginning. This is very helpful in the cases where you want to disallow viewing/listening to a piece of content repeatedly. (For example, with online radio stations).
- Disable seek (optional) – If selected, disallows seeking within the content. For most media clients, the Seek bar in the player is disabled. However, in cases where it is enabled, the Web server disallows seek.


Ensure That the Order of Entries in the Playlist is Correct
The order of entries in a playlist is very important, as the playlist is played in that order. The order goes from top to bottom. This means that content on top will be played before content below. Therefore, it is important to ensure that you have the right order in the playlist (For example, if you want users of your content to be able to get to the content only after playing an ad, you must ensure that the ad is placed above the content in the playlist. You may additionally want to disable skip forward if you want to enforce viewing the ads)
After entries are added, you can re-order them in the playlist by selecting an entry and using the Move Up and Move Down buttons to appropriately reposition the media entry in the playlist.

Nested Playlists
A nested Playlists is a playlist that is added as a media entry to another playlist. An user consuming a nest playlist would see it as a client-side playlist (a file with .asx file name extension) contained in another client-side playlist. The media entries in a nested playlist are known only when it is requested by the user, providing an additional dynamic aspec to the playlists. The default number of nesting levels supported by nested playlists is 5, which is the default number supported by Silverlight, Windows Media Player.
Note: Since the web playlists has a dynamic model, the number of levels cannot be known as playback start. So during playback if number of levels go beyond 5, some content may not be delivered and the request will be failed.
A nested playlist entry can be added by using the Playlists feature the same way any other entry is added. For example, in the Content location box, you can give the path/URL to a playlist (for example, C:\media\play.isx or http:\\media\play.isx)
Configuration Settings for Nested Playlists
The following configuration entries are used for nested playlist functionality:
Playlist Settings for Nested Playlists
In case of nesting, the settings in the master playlist are used. This is done because the master playlist has the best idea of what it takes to go through the entire set of media entries (including other playlists). The settings in the nested playlists are ignored.
- Enable playlist lifetime timeout. The lifetime of the playlist. The value of this attribute in the outermost playlist applies to the entire session. Attribute values in nested playlists are ignored. This is value for the setting Session life span for the playlist.
- Enable playlist inactivity timeout. The time after which the session information for the playlist is invalid. The value of this attribute in the outermost playlist applies to the entire session. Attribute values in nested playlists are ignored. This is the value for the setting Inactive session timeout for the playlist.
Controlling Nested Playlist Playback
A general rule of thumb for media player playback controls is that they are applicable only to the media entry they are associated with.
When the media entry is a nested playlist, the media entry flags determine if the nested playlist media entry can be skipped. After a client begins playing the nested playlist, the skip/seek logic is then governed by the media entries in the nested playlist. At this point, the parent playlist flags are still in force because the parent entry is not yet completed. The nested media entry is marked as completed only after the entire playlist has been played.
The Seek control in media players is ignored when a media entry is a nested playlist.
Adding HTTPD Media Entries
The Web Playlists feature can use media entries that begin with the httpd:// URL prefix to request that an external application, such as an asp page, ASP.net, or PHP application, which then compute the correct content path/URL to serve. Server variables can be included in the URL while requesting these applications using the {var_name} syntax (for example, httpd://{SERVER_NAME}:{SERVER_PORT}/pre.aspx). Remote applications can use this information to to determine the correct content to serve. The call flow is best captured by the following figure:

In the Web Playlists feature in IIS Manager, you can use any Location type with an httpd:// media entry. Set the Location type to match the content location returned by the remote application that served the request. For example, if the remote application returns a physical path such as C:\media\file.asf, then Location type should be set to Physical path.
In the Web Playlists feature in IIS Manager, simply add a media entry that uses the httpd:// syntax in the Content location field.
Sample playlist and web application
For illustration let us take a simple example. Let us consider the playlist below:
<?xml version="1.0" encoding="UTF-8"?>
<playlist name="Demo4" title="Demo Playlist 4" description="Demo of integration with Web Application">
<entry location="httpd://{SERVER_NAME}:{SERVER_PORT}/pre.aspx" locationType="relativeURI" clientSkipFwd="true" clientSkipBack="true" clientSeek="true" />
<entry location="C:\test\media\Videos\Movie Trailers\Elephant's Dream 720p 2M.wmv" locationType="physicalPath" clientSkipFwd="true" clientSkipBack="true" clientSeek="true" />
</playlist>
For this playlist, when the client requests the first entry during playback, the web playlists module will actually download the response from the pre.aspx page. Also, if you see the request uses two server variables SERVER_NAME and SERVER_PORT. These will be replaced by their values while requesting the Aspx page.
Here is a very simplified example of what the pre.aspx page could look like.
<%@ Page ContentType="text/plain" Language="c#" %>
advertisement.wmv
This page simply returns a path advertisement.wmv. However, you could have any logic here to compute what the right path/ URL to be returned should be. For example, you could get the values from a databased based on the request parameters. You could also pass any other server variables in the request like IP address to get location specific data from any database in your existing architecture.
Note: It is really important to set ContentType to text\plain as that is required by the web playlists module.
Playlist XML Format
The playlist is stored in an XML format. There is one file per playlist. Here is an example of a simple playlist that shows all elements possible in a playlist. In this case as we are using ASX as the output format, we have extra params (parameters) below that cater to ASX format.
<?xml version="1.0" encoding="UTF-8"?>
<playlist name="test" title="Hello Playlist!" description="This info is server only" timeToLive="1440" enabled="true">
<extraParam>
<ASX>
<![CDATA[<AUTHOR>IIS Team</AUTHOR>]]>
</ASX>
</extraParam>
<entry location="http://sam-iis/racecar_300.wmv" clientSkipFwd="False" clientSkipBack="True" clientSeek="True" locationType="remoteURL" >
<extraParam>
<ASX>
<![CDATA[<DURATION VALUE="00:00:05" />]]>
</ASX>
</extraParam>
</entry>
<entry location="D:\inetpub\wwwroot\powered_by_300.wmv" clientSkipFwd="True" clientSkipBack="True" clientSeek="True" locationType="physicalPath" >
<extraParam>
<ASX>
<![CDATA[<COPYRIGHT>IIS Media Pack</COPYRIGHT>]]>
</ASX>
</extraParam>
</entry>
<entry location="dir/powered_by_300.wmv" clientSkipFwd="True" clientSkipBack="True" clientSeek="True" locationType="relativeURI"/>
<entry location="file:///\\FileServer\media\abc.wmv" clientSkipFwd="True" clientSkipBack="True" clientSeek="True" locationType="physicalPath"/>
</playlist>
Here is a table explaining each of the XML tags / attributes in a little more detail
|
Tag / Attribute |
Value Type |
Description |
|
Playlist |
XML Element |
This is the main root element marking the playlist |
|
Playlist:Name |
XML Attribute – String |
This is the name for the playlist |
|
Playlist:Title |
XML Attribute – String |
This is the title for the playlist and maps to Title in ASX |
|
Playlist:Description |
XML Attribute – String |
This is a visual indicator for the admin and is therefore NOT mapped to any ASX element/attribute |
|
Playlist:timeToLive |
XML Attribute – Uint |
This the life span of the playlist session. An active session for this playlist will end after this time period (in seconds). |
|
Playlist:enabled |
XMLAttribute – Bool |
This tells whether the playlist is visible to the site visitors. In other words, it tells whether the playlist is live or not |
|
Playlist:extraParam |
XML Element |
Additional parameters for the playlist |
|
Playlist:extraParam:ASX |
XML Element |
Additional parameters for the playlist when output in ASX format |
|
Playlist:Entry |
XML Element |
Entry for a playlist |
|
Playlist:Entry:Location |
XML Attribute – String |
Location for the media entry. This could be a UNC path, Absolute Path or an external web URL |
|
Playlist:Entry:ClientSkipFwd |
XML Attribute – Bool |
This attribute specifies if a user is allowed to skip this entry and go to the next entry in the playlist |
|
Playlist:Entry:ClientSkipBack |
XML Attribute – Bool |
This attribute specifies if a user is allowed to skip this entry and go to the previous entry in the playlist |
|
Playlist:Entry:ClientSeek |
XML Attribute – Bool |
This attribute specifies if a user is allowed to seek within this entry in the playlist |
|
Playlist:Entry:locationType |
XML Attribute – Enum |
There are three values possible
physicalPath – An absolute/UNC path to the location of the media file
remoteURL – A valid http:// URL
relativeURL – A path to the media file. This path is relative to the site root |
|
Playlist:Entry:extraParam |
XML Element |
Additional parameters for the playlist entry |
|
Playlist:extraParam:ASX |
XML Element |
Additional parameters for the playlist entry when output in ASX format |
Adding Entries Protected with Credentials
It may happen in certain cases that entries that need to be added to the playlist are protected by a username / password. Playlist allows accessing these entries using the Impersonation Settings option in the playlist configuration. These settings can be accessed through the UI and set from there.
These settings are mapping of a path to username and password. These are global settings and applicable to all playlist at that level or below in the site hierarchy.
Here is a series of steps to add credentials for a specific path:
1. Click on “Edit Impersonation Settings

2. Click “Add”

3. Enter the path you wish to provide credentials for and chose a Log on method. This path could be a UNC path or a simple local path. The Log on methods are same as used for Virtual Directories. See Additional Information below for more details
4. Click Connect as...

5. Provide the username and password for the path given earlier
6. Click OK
7. Click OK

8. The Impersonation Setting for the path are now set.

9. Now you can simply use this path in your playlist and the playlist handler is smart enough to figure out the right credentials to use. See screen shot below:

Playing the Playlist
The playlist above is read by the server and send the client in the form of a client-side ASX playlist. Here is how the final ASX file is created by the Playlist handler.
- Playlist Name is mapped to Playlist name attribute in the ASX syntax.
- Playlist Extra Param is mapped as-is without any processing as sub-elements to the playlist in the ASX syntax.
- Entry Name is mapped to Entry Name in the ASX syntax.
- Entry Location is translated by the server into a obfuscated URL and then passed on using the location attribute in the ASX syntax.
- The attribute “ClientSkipFwd” if False, maps to the PARAM tag CANSKIPFORWARD in ASX.
- The attribute “ClientSkipBack” if False, maps to PARAM tag CANSKIPBACK in ASX.
- The attribute “ClienSeek” if False, maps to PARAM tag CANSEEK in ASX.
- If all three “ClientSkipFwd”, “ClientSkipBack” and “ClientSeek” are set to False, they map to ASX ENTRY attribute CLIENTSKIP.
- The session ID is added to output format to obfuscate the URLs and associate them to a server session that keeps track of what has been downloaded by the client. This is used by the server to enforce seek/skip options.
The playlist in the example above results in the following ASX when accessed by the client:
<ASX VERSION="3.0">
<AUTHOR>IIS Team</AUTHOR>
<TITLE>Hello Playlist!</TITLE>
<ENTRY>
<PARAM NAME="CANSKIPFORWARD" VALUE="NO"/><REF HREF="http://iismp-demo:80/play.isx?sessionId=7c1fbc29-3554-43d4-87f1-50fafddf6ead&entryId=1" /><DURATION VALUE="00:00:05" />
</ENTRY>
<ENTRY>
<REF HREF="http://iismp-demo:80/play.isx?sessionId=7c1fbc29-3554-43d4-87f1-50fafddf6ead&entryId=2" /><COPYRIGHT>IIS Media Pack</COPYRIGHT>
</ENTRY>
<ENTRY>
<REF HREF="http://iismp-demo:80/play.isx?sessionId=7c1fbc29-3554-43d4-87f1-50fafddf6ead&entryId=3" />
</ENTRY>
<ENTRY>
<REF HREF="http://iismp-demo:80/play.isx?sessionId=7c1fbc29-3554-43d4-87f1-50fafddf6ead&entryId=4" />
</ENTRY>
</ASX>
When the player tries to play the playlist, The param tags above act as hints to player / developer writing the player. If there is an attempt to ignore the hints, then the server side logic takes care of ensuring the sanctity of the media controls: “Disable Skip Forward”, “Disable Skip Backward” and “Disable Seek”.
Additional Information
- ASX Elements – http://msdn2.microsoft.com/en-us/library/ms910265.aspx
- PARAM Tags in ASX - http://msdn2.microsoft.com/en-us/library/bb249281(VS.85).aspx
- ClientSkip Attribute for ENTRY - http://msdn2.microsoft.com/en-us/library/ms910279.aspx
- Logon Type - http://msdn2.microsoft.com/en-us/library/ms691229(VS.85).aspx
Related Content
Comments