Windows Media Player 11 SDK Downloading Media ContentÂ
Previous | Next |
Downloading Media Content
Windows Media Player handles music file downloads for the online store. A download can be initiated when the discovery page calls External.download or when the user chooses, in the Player, to download a set of tracks. In either case, Windows Media Player calls IWMPContentPartner::Download, passing a content container list that describes the set of tracks to be downloaded and a cookie that represents the download transaction. The content partner plug-in must then call IWMPContentPartnerCallback::DownloadTrack once for each track in the set. When the plug-in calls DownloadTrack, it passes an HRESULT in the hrDownload parameter. If the plug-in passes a success code in hrDownload, Windows Media Player downloads the track. If the plug-in passes a failure code in hrDownload, the Player does not download the track. For each call to Download, the plug-in must supply the transaction cookie and the ID of the track in question. For tracks that will actually be downloaded, the plug-in must also supply the URL of the track.
After a file is downloaded, Windows Media Player automatically updates the library to reflect the newly purchased music. The Player provides status information to the plug-in about the download operation by calling IWMPContentPartner::DownloadTrackComplete. In this method, the Player provides an HRESULT to indicate success or failure of the download, the track ID, and the custom parameters string that the online store provided when it called DownloadTrack.
See Also
Previous | Next |