Using Windows Media Player Playlist Files in Web Playlists
[LEFT][CODE]http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists/[/CODE]
[B]Using Windows Media Player Playlist Files in Web Playlists [/B]
[LIST][*]Author: David Nelson[/LIST]
By default, [URL="http://www.microsoft.com/windows/products/winfamily/mediaplayer/default.mspx"]Windows Media Player 11[/URL] in [URL="http://www.microsoft.com/windowsserver2008/default.aspx"]Windows Server 2008[/URL] creates playlists in WPL format (files with .wpl file name extensions). This article describes how to create copies of the playlist files in ASX format (files with .asx file name extensions) so that you can import them into the [URL="http://www.iis.net/extensions/WebPlaylists"]Web Playlists[/URL] extension for Internet Information Services (IIS) 7.0. When you import the ASX files in Web Playlists, the equivalent Web playlist files (files with .isx file name extension) are created, which you must then edit to enable them in the Web Playlists feature. This article describes how to edit ISX files in two different ways, depending upon whether you want to serve the media files referenced in the playlist media entries either from the original user folder or from a Web site directory.
This article contains the following sections:
[LIST][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#reqs"]Prerequisites[/URL][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#wpl"]Saving WPL Playlist Files as ASX Playlist Files in Windows Media Player[/URL][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#asx"]Importing ASX Playlist Files to the Web Playlists Feature[/URL][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#isx"]Enabling your Imported Web Playlist[/URL][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#playback"]Setting Playback Options[/URL][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#related"]Related Articles[/URL][/LIST]
[B]Prerequisites[/B]
To install the Web Playlists extension for IIS 7.0, see the [B]Installation Notes[/B] section in the [URL="http://www.iis.net/downloads/files/media/playlist_readme.htm"][COLOR=#034af3]Web Playlists Readme[/COLOR][/URL].
[INDENT] [B]Note[/B] This article assumes that you have created playlists in Windows Media Player on the local server computer using default Player settings. For more information about installing Windows Media Player 11 and creating Windows Media Player playlists, see the [URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#related"]Related Articles[/URL] section.[/INDENT][B]Saving WPL Playlist Files as ASX Playlist Files in Windows Media Player[/B]
Windows Media Player creates its playlists in WPL format by default. This section shows how to create an ASX-formatted version of a Windows Media Player playlist (.wpl) file to import into the Web Playlists feature.
[B]To create ASX-formatted playlist files[/B]
[LIST=1][*]In the Windows Media Player Library, in the Contents pane, select the playlist that you want to add to the Web Playlists feature. Then, in the Details pane, click [B]Edit in List Pane[/B].
[IMG]http://learn.iis.net/file.axd?i=1798[/IMG]
This will add the playlist to the List pane in Windows Media Player. In the following example, we show in the List pane a simple playlist (named [B]playlist1[/B]) that contains two tracks (named [B]track1[/B] and [B]track2[/B]).
[IMG]http://learn.iis.net/file.axd?i=1799[/IMG][*]Click the down arrow next to the playlist name, and then click [B]Save Playlist As[/B].
[URL="http://learn.iis.net/file.axd?i=1800"][IMG]http://learn.iis.net/file.axd?i=1800[/IMG][/URL]
This action will open the [B]Save As[/B] dialog box with default values.
[URL="http://learn.iis.net/file.axd?i=1801"][IMG]http://learn.iis.net/file.axd?i=1801[/IMG][/URL][*]In the [B]Save As[/B] dialog box, in [B]Save as type[/B], select [B]Any Playlist (*.wpl, *.asx, *.m3u)[/B].
[URL="http://learn.iis.net/file.axd?i=1802"][IMG]http://learn.iis.net/file.axd?i=1802[/IMG][/URL][*]In the [B]Save As[/B] dialog box, in [B]File name[/B], change the file name extension from [B]wpl[/B] to [B]asx[/B].
[URL="http://learn.iis.net/file.axd?i=1803"][IMG]http://learn.iis.net/file.axd?i=1803[/IMG][/URL][*]In the [B]Save As[/B] dialog box, click [B]Save[/B].
[URL="http://learn.iis.net/file.axd?i=1804"][IMG]http://learn.iis.net/file.axd?i=1804[/IMG][/URL][/LIST]
[B]Importing ASX Playlist Files to the Web Playlists Feature[/B]
This section shows how to import the ASX-formatted Windows Media Player playlist file that you created in the [URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#wpl"]previous section[/URL].
[B]To import ASX-formatted playlist files[/B]
[LIST=1][*]In IIS Manager, select the Web site or virtual directory from which you want to serve your Windows Media Player playlist files (.wpl files), and then in the Contents pane, click the [B]Web Playlists[/B] icon.
[IMG]http://learn.iis.net/file.axd?i=1805[/IMG][*]In the [B]Actions[/B] pane, click [B]Open Feature[/B].
[URL="http://learn.iis.net/file.axd?i=1806"][IMG]http://learn.iis.net/file.axd?i=1806[/IMG][/URL]
This action displays the [B]Web Playlists[/B] feature page. If you have not previously created Web playlists for the site or virtual directory, the page will be empty as shown below.
[URL="http://learn.iis.net/file.axd?i=1807"][IMG]http://learn.iis.net/file.axd?i=1807[/IMG][/URL][*]In the [B]Actions[/B] pane, click [B]Import ASX Playlist[/B].
[URL="http://learn.iis.net/file.axd?i=1808"][IMG]http://learn.iis.net/file.axd?i=1808[/IMG][/URL][*]In the [B]Open[/B] dialog box, navigate to the location where the playlist file in ASX format is stored, select it, and then click [B]Open[/B].
[URL="http://learn.iis.net/file.axd?i=1809"][IMG]http://learn.iis.net/file.axd?i=1809[/IMG][/URL]
The Windows Media Player playlist file (playlist1.asx) in imported to the [B]Web Playlists[/B] feature as a Web playlist file (playlist1.isx), as shown below:
[URL="http://learn.iis.net/file.axd?i=1810"][IMG]http://learn.iis.net/file.axd?i=1810[/IMG][/URL][/LIST]
[B]Enabling your Imported Web Playlist[/B]
After you import your ASX-formatted Windows Media Player playlist file, there are a couple of approaches to take regarding how you want to serve the media that is referenced in it. You can either leave the media files where they reside in your user folder, or you can copy them to a folder in your Web site root directory or virtual directory. Your choice really depends on whether you want to maintain multiple copies of your media files.
If you choose the first option (leave the media files where they are), then you must do the following:
[LIST=1][*]In the Web Playlists feature, set impersonation settings so that it can access the files in the user folder.[*]In the Web Playists feature, enable Absolute/UNC paths.[*]In the ISX file, change relative URIs for the media entries to physical paths.[*]In the ISX file, change the [B]srcType[/B] from relative URI to physical path.[*]In the ISX file, remove the [B]param[/B] container with invalid [B]extraparam[/B] attributes.[/LIST]
If you choose the second option (copy the media files to your Web site or virtual directory), then you must do the following:
[LIST=1][*]Copy your media files to a folder in the Web root directory or to the virtual directory.[*]In the ISX file, update the relative URIs for the media entries.[*]In the ISX file, remove the [B]param[/B] container with invalid [B]extraparam[/B] attributes.[/LIST]
The following sections provide details on both approaches:
[LIST][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#user"]Serve the media files from user folders[/URL][*][URL="http://learn.iis.net/page.aspx/631/using-windows-media-player-playlist-files-in-web-playlists#web"]Serve the media files from the Web site[/URL][/LIST]
[B]Serve the media files from user folders[/B]
[LIST=1][*]In the Web Playlists feature, set impersonation settings so that it can access the files in the user folder. For detailed instructions, see [URL="http://learn.iis.net/page.aspx/524/web-playlists-for-iis-70---serving-media-content-from-user-folders/"]Web Playlists for IIS 7.0 - Serving Media Content from User Folders[/URL].[*]In the Web Playlists feature, enable Absolute/UNC paths.
a. In the [B]Actions[/B] pane, click [B]Edit Feature Settings[/B].
[IMG]http://learn.iis.net/file.axd?i=1811[/IMG]
b. In the [B]Edit Feature Settings[/B] dialog box, select [B]Allow absolute/UNC paths[/B].
[URL="http://learn.iis.net/file.axd?i=1812"][IMG]http://learn.iis.net/file.axd?i=1812[/IMG][/URL][*]In a text editor, such as Notepad, change the relative URI for each media entry in the ISX to a physical path. For example:
Change: [FONT=courier]<ref src="..\track1.wma">[/FONT]
To: [FONT=courier]<ref src="C:\Users\Administrator\Music\track1.wma">[/FONT]
[B] Tip[/B] You can use the [B]Replace[/B] feature in Notepad to make this change to all media entries at once.[*]In the text editor, change the [B]srcType[/B] for each media entry in the ISX to a physical path. For example:
Change: [FONT=courier]<param name="srcType" value="relativeURI" />[/FONT]
To: [FONT=courier]<param name="srcType" value="physicalPath" />[/FONT]
[B] Tip[/B] You can use the [B]Replace[/B] feature in Notepad to make this change to all media entries at once.[*]When you import the Windows Media Player ASX playlist file, the Web Playlists feature groups the unsupported playlist attributes as [B]extraParam[/B] values in a [B]param[/B] container in the ISX playlist file. You must remove (or comment-out) the [B]param[/B] container with invalid [B]extraParam[/B] attributes for each media entry in the ISX.
In the following example, we comment-out the [B]param[/B] (beginning and ending comment marks shown in [COLOR=red]red[/COLOR]). Also, for brevity, we show only the first and last [B]extraParam[/B] values (for the track length and number) in the example:
[FONT=courier][COLOR=red]<!--[/COLOR]<param name="extraParam" value="<Duration value="00:04:36.532" />
...
Value="4"" />[COLOR=red]-->[/COLOR][/FONT]
[B] Tip[/B] Because [B]extraParam[/B] values vary for each track, do the following when using the [B]Replace[/B] feature in Notepad:
Change: [FONT=courier]<param name="extraParam"[/FONT]
To: [FONT=courier]<!--<param name="extraParam"[/FONT]
-and-
Change: [FONT=courier]<param name="title"[/FONT]
To: [FONT=courier]--><param name="title"[/FONT][/LIST]
[INDENT] This will comment-out the [B]param[/B] container with the [B]extraParam[/B] attributes, as shown in the above example.[/INDENT][B]Serve the media files from the Web site[/B]
[LIST=1][*]Copy the media files referenced in the Windows Media Player playlist (.wpl) file to a folder in the Web site directory or to a virtual directory. For example, if you imported the .asx version of the playlist to the Default Web site, copy the files to: <[I]systemdrive[/I]>\inetpub\wwwroot\media.[*]In a text editor, such as Notepad, update the relative URI for each media entry in the ISX. For example:
Change: <ref src="..\track1.wma">
To: <ref src="media/track1.wma">
[B] Tip[/B] You can use the [B]Replace[/B] feature in Notepad to make this change to all media entries at once.[*]When you import the Windows Media Player ASX playlist file, the Web Playlists feature groups the unsupported playlist attributes as [B]extraParam[/B] values in a [B]param[/B] container in the ISX playlist file. You must remove (or comment-out) the [B]param[/B] container with invalid [B]extraParam[/B] attributes for each media entry in the ISX.
In the following example, we comment-out the [B]param[/B] (beginning and ending comment marks shown in [COLOR=red]red[/COLOR]). Also, for brevity, we show only the first and last [B]extraParam[/B] values (for the track length and number) in the example:
[FONT=courier][COLOR=red]<!--[/COLOR]<param name="extraParam" value="<Duration value="00:04:36.532" />
...
Value="4"" />[COLOR=red]-->[/COLOR][/FONT]
[B] Tip[/B] Because [B]extraParam[/B] values vary for each track, do the following when using the [B]Replace[/B] feature in Notepad:
Change: [FONT=courier]<param name="extraParam"[/FONT]
To: [FONT=courier]<!--<param name="extraParam"[/FONT]
-and-
Change: [FONT=courier]<param name="title"[/FONT]
To: [FONT=courier]--><param name="title"[/FONT][/LIST]
[INDENT] This will comment-out the [B]param[/B] container with the [B]extraParam[/B] attributes, as shown in the above example.[/INDENT][B]Setting Playback Options[/B]
After updating the ISX, clients will be able to play the media items referenced in it. By default, clients will have full control of the playback experience, such as the ability to skip (both forward and backward) to different entries in the playlist and to seek within a currently playing track. You can limit a client's ability to seek or skip playlist media entries by configuring media entry settings in the Web Playlists feature. For more information, see IIS Media Services Help.
To access this help, press F1 while using the Web Playlists feature in IIS Manager.
[/LEFT]