Share via


IWMPPlaylist::insertItem 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 insertItem method inserts a media item at a specified location in a playlist.

Syntax

public void insertItem(
  System.Int32 lIndex,
  IWMPMedia pIWMPMedia
);

Public Sub insertItem( _
  ByVal lIndex As System.Int32, _
  ByVal pIWMPMedia As IWMPMedia _
)
Implements IWMPPlaylist.insertItem

Parameters

lIndex [in]

A System.Int32 that is the zero-based index at which the media item will be inserted in the playlist.

pIWMPMedia [in]

A WMPLib.IWMPMedia interface that represents the media item to be inserted.

Return value

This method does not return a value.

Remarks

All media items after the inserted item will have their indexes increased by one.

Before calling this method, you must have full access to the library. For more information, see Library Access.

Requirements

Requirement Value
Version
Windows Media Player 9 Series or later
Namespace
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

See also

IWMPMedia Interface (VB and C#)

IWMPPlaylist Interface (VB and C#)

IWMPPlaylist.removeItem (VB and C#)