Share via


Network.getProxySettings 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 getProxySettings method retrieves the proxy setting for a given protocol.

Syntax

retVal = Network.getProxySettings(
  protocol
)

Parameters

protocol [in]

String specifying the protocol name. For a list of supported protocols, see Supported Protocols and File Types.

Return value

This method returns a Number (long) containing one of the following values.

Value Description
0 A proxy server is not being used.
1 The proxy settings for the current browser are being used (only valid for HTTP).
2 The manually specified proxy settings are being used.
3 The proxy settings are being auto-detected.

Remarks

This method fails unless the calling application is running on the local computer or intranet.

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

Examples

The following JScript example uses Network.getProxySettings to display a message, which gives information about the current proxy settings of the Player, in the browser window. The Player object was created with ID = "Player".

// Retrieve a number representing the current proxy settings.
var proxySetting = Player.network.getProxySettings("MMS");

// Display the message the corresponds to the current settings.
switch(proxySetting){

   case 0:
     document.write("A proxy server is not being used");
     break;

   case 1: 
     document.write("The proxy settings for the current browser are being used.");
     break;

   case 2:
     document.write("The manually specified proxy settings are being used.");
     break;

case 3:
     document.write("The proxy settings are being auto-detected.");
     break;

   default:
     document.write("Unable to determine proxy setting, try again.");
}

Requirements

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

See also

Network Object