Using the Download Manager
[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
The Windows Media Player SDK includes a sample webpage that demonstrates using the Download Manager to download files to the user's computer. You can locate the sample in the folder named WebPage where you installed the SDK. The name of the file is sample.asp. The sample provides the following functionality:
- Creates the DownloadManager object.
- Creates a DownloadCollection object.
- Starts downloading five files when the user clicks Download. Default file paths are provided in the sample. You should replace these default paths with the locations of files on your own server. You can change the paths by changing the values assigned to the global array named g_sFiles.
- Shows status information for a download when the user selects it.
- Provides controls to pause, resume, cancel, and remove a download item.
- Maintains information about download collections between sessions by using cookies. This is important because the user can close the Player at any time. Also, if the user switches task panes in the Player, the online store session ends.
- Uses real-time downloading by default. You can change the behavior to background downloading by changing the value of the variable named g_sDLType. Background downloading is available for use with the Microsoft Windows XP operating system.
- Synchronizes the background color with the Player color. You can use this feature to make your online store change appearance when the user chooses to change the color of the Player.
The following sections provide more information:
- Initializing the Page
- Starting the Downloads
- Retrieving Status Information
- Maintaining Session Information
- Debugging the Page
Related topics