Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

The Windows Media Player control supports several attributes for manipulating playback of content.

Playback

The Windows Media Player control provides two techniques for specifying the media title ( clip) to be played:

After either technique is used, what happens next depends on the AutoStartproperty:

  • If AutoStart is true, the clip begins to play when the FileName property is set to the URL of that clip.

  • If AutoStart is false, playback does not start until the Playmethod is called.

The Openmethod opens a file asynchronously; it returns from the call immediately.

This is unlike setting the FileName property that does not return control to your program until the file is open. If the file must be downloaded, setting the FileNameproperty will only wait until the file begins to download, not when it ends downloading.

The Windows Media Player control provides the following VCR-like attributes for controlling stream playback:

  • Play, Stop, and Pausemethods, to start, stop, and pause the stream.

  • PlayCountproperty to set the number of times a file plays.

  • AutoRewindproperty to determine whether to return to the start of the clip when it stops playing.

Audio Control

The Windows Media Player control provides the following properties for regulating audio.

  • Balanceproperty, for determining the balance of sound between left and right speakers.

  • Volumeproperty, for raising or lowering volume.

  • Muteproperty, for turning audio on and off.

You can display the Volume and Mute controls on the control bar by setting the ShowControlsand the ShowAudioControlsproperties both to TRUE.

Scanning

The Windows Media Player control provides the following attributes for scanning:

  • FastForwardmethod, to rapidly scan forward through a clip.

  • FastReversemethod, to rapidly scan backward through a clip.

  • Rateproperty, to change the rate at which playback occurs. Only use the Rate property for media that support playback at multiple rates.

The CanScanand AllowScanproperties must be true before a clip can be scanned.

Seeking

Some types of multimedia streams support seeking to arbitrary times in the presentation, as well as seeking to markers.

A marker is a pointer to a specific time in a multimedia stream file, written into the file at authoring time. The Windows Media Player control can seek directly to the time specified by a marker, enabling viewers to skip forward or backward in the presentation.

Attributes supported for seeking include the following:

  • MarkerCountproperty, which specifies the total number of markers in the clip.

  • CurrentMarker, GetMarkerName, and GetMarkerTimemethods, which retrieve marker information.

  • MarkerHitevent, which provides notification when a marker is encountered.

  • CurrentPositionproperty, which can be used to set playback to a specified point in the clip. CurrentPosition is measured in seconds from the start of the clip.

  • PositionChangeevent, which notifies your application when the CurrentPosition property is set.

To seek to an arbitrary time, the media must be seekable (the CanSeekproperty is true).

To seek to a marker, the media must have markers encoded into it (the CanSeekToMarkersproperty is true).

See Also