Share via


Windows Media Player 11 SDK IWMPMedia.isIdentical (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPMedia.isIdentical (VB and C#)

The isIdentical property (the get_isIdentical method in C#) gets a value indicating whether the specified media item is the same as the current one.

[Visual Basic]
ReadOnly Property isIdentical(
  pIWMPMedia As IWMPMedia
) As Boolean

[C#]
bool get_isIdentical (
  IWMPMedia pIWMPMedia
);

Parameters

pIWMPMedia

A WMPLib.IWMPMedia interface to the media item to be compared with the current media item.

Property Value

A System.Boolean value that indicates whether the two media items are identical.

Remarks

IWMPMedia.isIdentical is a property in Visual Basic that takes a parameter. In C# it is referred to as the IWMPMedia.get_isIdentical method.

Example Code

The following example uses the isIdentical property (the get_isIdentical method in C#) to check whether a media item named newMedia is the same as the current media item. If they are not the same, the new media item is played. Otherwise, the current media continues to play uninterrupted. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

[Visual Basic]
If (newMedia.isIdentical(player.currentMedia) <> True) Then

    ' Change the current media to the new media item.
    player.currentMedia = newMedia

    ' Play the new media item.
    player.Ctlcontrols.play()

End If

FakePre-1367fc7a47624b21aa63051135dadb64-2744052118aa45ad94036778be8244db

if (newMedia.get_isIdentical(player.currentMedia) != true)
{
    // Change the current media to the new media item.
    player.currentMedia = newMedia;

    // Play the new media item.
    player.Ctlcontrols.play();
}

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next