Compartir a través de


DVD

[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 Windows Media Player 6.4 ActiveX control contains a DVD object that exposes a variety of methods and properties, and one event, for dealing specifically with DVD content. For instance, to determine the number of DVD titles available, you use the Player6.titlesAvailable property:

var numTitles = WMP64.DVD.TitlesAvailable;

The Windows Media Player 7 or later object model implements a more integrated approach to DVD. DVD-specific properties, methods, and events are implemented only where needed. Otherwise, existing object model functionality works with DVD media as you might expect. For example, to determine the number of DVD titles available when using Windows Media Player 7 or later, you retrieve a Playlist object from the Cdrom object:

var dvdTitles = WMP9.cdromCollection.item(0).playlist;

The preceding example retrieves a Playlist object with a first entry representing the DVD media in the first drive. Additional entries represent individual DVD titles. Therefore, the number of titles available can be calculated as follows:

var numTitles = dvdTitles.count - 1;

Here are the main differences to keep in mind when migrating from version 6.4:

  • DVD playback is supported only when using Windows Media Player for Windows XP or later and the Windows XP operating system or later.
  • DVD-ROM drives are enumerated exactly like CD-ROM drives using the CdromCollection object.
  • Individual DVD-ROM drives are managed using the Cdrom object.
  • The DVD object extends the object model with methods and one property specifically for working with DVD.
  • There are two new events, OpenPlaylistSwitch and DomainChange, specifically for working with DVD.
  • DVD content is organized using Playlist objects and Media objects.
  • DVD languages are managed using the language functionality available from the Controls object (Windows Media Player 9 Series or later).
  • Transport controls and position information for DVD work the same as for other digital media types.

Object Model Migration Guide

Using the Windows Media Player Control with Visual Basic