Partager via


External.changeView method

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

Note

This topic describes functionality designed for use by online stores. Use of this functionality outside the context of an online store is not supported.

The changeView method changes the view in Windows Media Player.

Syntax

External.changeView(
  LibraryLocationType,
  LibraryLocationID,
  Filter,
  ViewParams
)

Parameters

LibraryLocationType [in]

A library location constant that specifies the type of the new view. For example, the constant CPGenreID specifies that the new view will show a particular genre.

LibraryLocationID [in]

String containing the ID of the specific item to show in the new view. For example, if LibraryLocationType is CPGenreID, then this parameter specifies the ID of the genre to show in the new view. This string can be empty. See Remarks.

Filter [in]

String containing the filter for the new view. The view will be filtered as if the user had entered this text in the Player's word wheel control. This string can be empty.

ViewParams [in]

String containing parameters that Windows Media Player makes available to the new discovery page that is displayed with the new view. These parameters are not interpreted by Windows Media Player. They are created by the online store and have meaning only to the online store.

Return value

This method does not return a value.

Remarks

In some cases, it makes sense to set the LibraryLocationID parameter to the empty string. For example, if you set the LibraryLocationType parameter to AllCPAlbumIDs, the new view will represent all albums. No individual album will be the focus of the new view, so there is no need to supply an album ID in the LibraryLocationID parameter.

The ViewParams parameter provides a way for a discovery page to communicate with another discovery page. When script on a discovery page calls changeView, Windows Media Player adjusts its user interface. That adjustment causes the Player to call the plug-in's IWMPContentPartner::GetTemplate method to get the URL of a new discovery page. The string that the original discovery page passes in the ViewParams parameter does not get passed to GetTemplate. However, the new discovery page can retrieve the ViewParams string by calling External.viewParameters.

Requirements

Requirement Value
Version
Windows Media Player 11.
DLL
Wmp.dll

See also

External Object for Type 1 Online Stores

External.changeViewOnlineList

External.libraryLocationID

External.libraryLocationType

External.viewParameters