Compartir a través de


Matching the Windows Media Player Colors

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

Making your online store webpage match the Windows Media Player color scheme is easy. Simply handle the External.OnColorChange event. To specify a function to handle the event, use code like the following when your webpage loads:

// Set up the color change event.
external.OnColorChange = OnAppColor;

Each time the user changes the color scheme of Windows Media Player, the Player will call your function. The following example shows a simple function that sets the webpage background to match the External.appColorLight property:

// Match the current color.
function OnAppColor()
{
    window.document.bgColor = external.appColorLight;
}

There are other color properties available for your use as well. See External Object for Type 2 Online Stores.

External.appColorLight

External.OnColorChange Event

Information Common to Type 1 and Type 2 Online Stores