Skip to content

Latest commit

 

History

History
92 lines (54 loc) · 2.5 KB

controls-currentitem.md

File metadata and controls

92 lines (54 loc) · 2.5 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date ms.custom
Controls.currentItem
The currentItem property specifies or retrieves the current media item.
77e21585-3cc8-41f5-97b5-da6eb992c7bc
Controls.currentItem Windows Media Player
apiref
Controls.currentItem
wmp.dll
DllExport
reference
4/26/2023
UpdateFrequency5

Controls.currentItem

[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 currentItem property specifies or retrieves the current media item.

player.controls.currentItem
      

Possible Values

This property is a read/write Media object.

Remarks

This method works only with items in Player.currentPlaylist. Calling currentItem with a reference to a saved media item is not supported.

Examples

The following JScript example uses currentItem to set the player control current media item to the selected value in an HTML SELECT element. The current playlist was first specified by using PlaylistCollection.getByName. The Player object was created with ID = "Player".

<SELECT ID = playItem  NAME = "playItem"  LANGUAGE = "JScript"

    /* Specify the current item when the selected list value changes. */
    onChange = "Player.controls.currentItem = Player.currentPlaylist.item(playItem.value);">

    /* Fill the SELECT element list with three items that match
       the songs in the playlist. */
    <OPTION VALUE = 0 >Laure
    <OPTION VALUE = 1 >Jeanne
    <OPTION VALUE = 2 >House
</SELECT>

Requirements

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

See also

Controls Object

Media Object

PlaylistCollection.getByName