次の方法で共有


Player.launchURL 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.]

The launchURL method sends a URL to the user's default browser to be rendered.

Syntax

Player.launchURL(
  URL
)

Parameters

URL [in]

String value representing the URL to launch.

Return value

This method does not return a value.

Remarks

This method only opens webpages using the HTTP or HTTPS protocols.

Windows Media Player 10 Mobile: This method is not supported.

Examples

The following example creates an HTML BUTTON element that, when clicked, displays the Microsoft website in a new browser window. The Player element was created with ID = "Player".

<INPUT  TYPE = "BUTTON"  ID = "GOTOMS"  VALUE = "Microsoft.com"  onClick = "

    /* Open the Microsoft website. */
    Player.launchURL('https://www.microsoft.com');
">

Requirements

Requirement Value
Version
Windows Media Player version 7.0 or later.
DLL
Wmp.dll

See also

Player Object