Share via


Discovery Pages

[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.]

If the active online store is a type 1 store, Windows Media Player displays the store's content in its user interface. The library tree-view control has a node for the online store. When the user clicks that node or any of its subnodes, Windows Media Player displays content from the online store in the details pane.

As the user interacts with online store content in the tree-view control or in the details pane, Windows Media Player displays webpages, called discovery pages, provided by the online store. Discovery pages provide additional information about the music as the user browses the online store's catalog. Discovery pages communicate with Windows Media Player through the properties, methods, and events of the External object.

Whenever Windows Media Player changes its view of the online store's content, it calls IWMPContentPartner::GetTemplate, implemented by the online store's plug-in, to get the URL of the discovery page to display with the new view.

The view of online store content in Windows Media Player is characterized by five pieces of information: task, location type, location ID, selected item type, and selected item ID. Windows Media Player supplies those five items to the GetTemplate method in the task, location, pContext, clickLocation, and pClickContext parameters. Windows Media Player makes those five items available to discovery pages in the task, libraryLocationType, libraryLocationID, selectedItemType, and selectedItemID properties of the External object. For more information about how Windows Media Player specifies its view of online store content, see Location and Selected Item.

In addition to enabling a discovery page to communicate with Windows Media Player, the External object enables a discovery page to communicate with the online store's plug-in. When that happens, Windows Media Player acts as a bridge between the discovery page and the plug-in. For example, the discovery page can call External.sendMessage to send a custom message to the plug-in. Windows Media Player receives this method call and in turn calls IWMPContentPartner::SendMessage to pass the message to the plug-in. When the plug-in has finished processing the message, it calls IWMPContentPartnerCallback::SendMessageComplete. Windows Media Player then notifies the discovery page by raising the External.OnSendMessageComplete event.

The External object also provides a way for a discovery page to communicate with another discovery page. When script on a discovery page calls External.changeView, the script can supply a string in the ViewParams parameter. Windows Media Player does not interpret the ViewParams string, but it makes the string available to the next discovery page in the External.viewParameters property.

About Type 1 Online Stores

Location and Selected Item