Windows Media Player 11 SDK Controls.playItem 

Windows Media Player SDK banner art

Previous Next

Controls.playItem

The playItem method plays the specified media item.

Syntax

  

Parameters

theMediaItem

Media object to be played.

Return Values

This method does not return a value.

Remarks

The media item will be loaded and played automatically, regardless of the value of the Settings.autoStart property. To load an item without playing it automatically, set Settings.autoStart** to false and assign a value to *Player.*URL, after which play can be called to start playing the item.

Note   playItem works only with items in currentPlaylist. Calling playItem with a reference to a saved media item is not supported.

Example Code

The following JScript example uses playItem to play a media item from the current playlist. The item to play is chosen based upon its position in the playlist. The Player object was created with ID = "Player".

  

Requirements

Version: Windows Media Player version 7.0 or later.

Library: Use wmp.dll.

See Also

Previous Next