Properties, Methods and Events

Each object has methods and properties through which you can program the Windows Media Player control. A method is an action that the object can take. A property is a data value that you can read or change. For example, the Play method starts the content playing, and the frameRate property indicates the current frame rate of the content that is playing.

In addition, the Player object raises events that give you the opportunity to carry out actions at specific times. You write code in an event handler that will execute when Windows Media Player raises the corresponding event. For example, you can write code in a PlayStateChange event handler that determines whether the change in state is that the media ended and if so display a dialog box asking users if they want to play the media again.


All of the methods in the Windows Media Player object model are asynchronous. If you call two methods in the same procedure, the second method cannot rely on the first method having completed its action.


About the Player Object Model