Media.sourceURL

The sourceURL property retrieves the URL of the media item.

Syntax

player.currentMedia.sourceURL

Possible Values

This property is a read-only String.

Examples

The following JScript example uses Media.sourceURL to retrieve the URL of the first media item in the sample playlist; the URL of the media item is then assigned to the player object URL property. The Player object was created with ID = "Player".

// Store the sample playlist object in a variable. 
var pl = Player.playlistCollection.getByName("Sample Playlist").item(0);

// Store the first media item from the sample playlist.
var media = pl.item(0);

// Change the URL property of the player to the URL of the media item.
Player.URL = media.sourceURL;

// Play the media item.
Player.controls.play();

Requirements

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

See also

Media Object