The playState property retrieves a value indicating the state of the Windows Media Player operation.


player .playState

Possible Values

This property is a read-only Number (long). The C-style enumeration constant can be derived by prefixing the state value with "wmpps". For example, the constant for the Playing state is wmppsPlaying.

0UndefinedWindows Media Player is in an undefined state.
1StoppedPlayback of the current media item is stopped.
2PausedPlayback of the current media item is paused. When a media item is paused, resuming playback begins from the same location.
3PlayingThe current media item is playing.
4ScanForwardThe current media item is fast forwarding.
5ScanReverseThe current media item is fast rewinding.
6BufferingThe current media item is getting additional data from the server.
7WaitingConnection is established, but the server is not sending data. Waiting for session to begin.
8MediaEndedMedia item has completed playback.
9TransitioningPreparing new media item.
10ReadyReady to begin playing.
11ReconnectingReconnecting to stream.



Windows Media Player states are not guaranteed to occur in any particular order. Furthermore, not every state necessarily occurs during a sequence of events. You should not write code that relies upon state order.


The following JScript code shows the use of the player.playState property. An HTML text element, named "myText", displays the current status. The Player object was created with ID = "Player".

// Test whether Windows Media Player is in the playing state.
if (3 == Player.playState)
    myText.value = "Windows Media Player is playing!";
    myText.value = "Windows Media Player is NOT playing!";



Windows Media Player version 7.0 or later.



See also

Player Object
Player.PlayStateChange Event