Bagikan melalui


External.OnViewChange Event

[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 OnViewChange event occurs when the view changes in Windows Media Player.

window.external.OnViewChange = FunctionName

Possible Values

This is a write-only property that specifies the name of the function in script that Windows Media Player calls when the event occurs.

Parameters

The function that handles this event takes no parameters.

Remarks

The view in Windows Media Player can change for any of the following reasons:

  • The user interacts with the Windows Media Player user interface.
  • The user interacts with a discovery page, and script on the discovery page calls External.changeView.
  • The user interacts with a discovery page, and script on the discovery page calls External.changeViewOnlineList.

When the view changes in Windows Media Player, the Player calls IWMPContentPartner::GetTemplate to get the URL of the next discovery page to display. However, before the Player displays the new discovery page, it raises the OnViewChange event. If the OnViewChange event handler calls External.cancelNavigate, Windows Media Player does not display the new discovery page. Instead, it continues to display the current discovery page.

Requirements

Requirement Value
Version
Windows Media Player 11
DLL
Wmp.dll

See also

External Object for Type 1 Online Stores

External.changeView

External.changeViewOnlineList