次の方法で共有


Properties, Methods and Events

[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.]

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.

Note

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