Compartilhar via


Controls Object

[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 Controls object provides a way to manipulate the playback of media using the following properties and methods.

The Controls object supports the following properties.

Property Description
audioLanguageCount Retrieves the number of supported audio languages.
currentAudioLanguage Specifies or retrieves the locale identifier (LCID) of the audio language for playback
currentAudioLanguageIndex Specifies or retrieves the one-based index that corresponds to the audio language for playback.
currentItem Specifies or retrieves the current media item.
currentMarker Specifies or retrieves the current marker number.
currentPosition Specifies or retrieves the current position in the media item in seconds from the beginning.
currentPositionString Retrieves the current position in the media item as a String.
currentPositionTimecode Specifies or retrieves the current position in the current media item using a time code format. This property currently supports SMPTE time code.
isAvailable Retrieves whether a specified type of information is available or a given action can be performed.

 

The Controls object supports the following methods.

Method Description
fastForward Starts fast play of the media item in the forward direction.
fastReverse Starts fast play of the media item in the reverse direction.
getAudioLanguageDescription Retrieves the description for the audio language corresponding to the specified one-based index.
getAudioLanguageID Retrieves the LCID for a specified audio language index.
getLanguageName Retrieves the name of the audio language with the specified LCID.
next Sets the current item to the next item in the playlist.
pause Pauses the playing of the media item.
play Causes the media item to start playing.
playItem Causes the current media item to start playing, or resumes play of a paused item.
previous Sets the current item to the previous item in the playlist.
step Causes the current video media item to freeze playback on the next frame.
stop Stops the playing of the media item.

 

The Controls object is accessed through the following property.

Object Property
Player controls

 

See also

Object Model Reference for Scripting