Expand Minimize

Player.currentMedia

The currentMedia property specifies or retrieves the current Media object.

Syntax

player .currentMedia

Possible Values

This property is a read/write Media object.

Remarks

If the Settings.autoStart property is true, playback begins automatically whenever you set currentMedia.

This property takes a Media object, which can be acquired by using Playlist.item. To load a Media item using a file name, set the URL property or use newMedia.

Examples

The following JScript example retrieves the first media item in the library. It then uses currentMedia to make the retrieved media item the current media item, and then to display the name of the current media item. The Player object was created with ID = "Player".



// Retrieve the first media item from the library.
var firstMedia = Player.mediaCollection.getAll().item(0);

// Make the retrieved media item the current media item.
Player.currentMedia = firstMedia;

// Display the name of the current media item.
document.write("Found first media item. Name = " + Player.currentMedia.name);


Requirements

Version

Windows Media Player version 7.0 or later.

DLL

Wmp.dll

See also

Media Object
Player Object
Player.newMedia
Playlist.item
Settings.autoStart

 

 

Community Additions

ADD
Show:
© 2015 Microsoft