![]() |
Previous | Next |
This topic applies to Windows Media Player version 6.4 only.
When you open Windows Media Player as a stand-alone application, you are presented with a video display window and standard control buttons that mimic the functions of most VCRs and compact disc players. These buttons control basic playback operations for all media; listed from left to right (see illustration), these are:
Scripts can perform these operations by invoking methods on the Windows Media Player control. The correspondence between the operations and methods is shown in the table below.
Operation | Method |
Play | MediaPlayer.Play(); |
Pause | MediaPlayer.Pause(); |
Stop | MediaPlayer.Stop(); |
Previous Track | MediaPlayer.Previous(); |
Fast Reverse | MediaPlayer.FastReverse(); |
Fast Forward | MediaPlayer.FastForward(); |
Next Track | MediaPlayer.Next(); |
Another element of the Windows Media Player interface is the position trackbar, a slider control that displays the elapsed time of the current track. For scripting, this position is stored in a read/write property called CurrentPosition. While a track is playing, the value of this property is the current elapsed time, in seconds. Comparing this value with the value of the Duration property yields the percentage of the total track time that has elapsed. To jump to an arbitrary time in a track, assign a new value to CurrentPosition.
Volume is also controlled by a slider, and is handled in script in a similar way. The read/write Volume property stores a value for the current volume setting. To change the volume, assign a new value to this property. Valid values range from -10,000 for the lowest setting to zero for the loudest setting. There is also a mute button on the control panel, which turns off all sound output from Windows Media Player. You can toggle muting in script by assigning a Boolean value of either true or false to the Mute property.
Previous | Next |