Windows Media Player 11 SDK AxWindowsMediaPlayer.playState (VB and C#)
Previous | Next |
AxWindowsMediaPlayer.playState (VB and C#)
The playState property gets an enumeration value indicating the state of the Windows Media Player operation.
[Visual Basic] Public Overridable ReadOnly Property playState As WMPPlayState [C#] public virtual WMPPlayState playState {get;}
Property Value
The WMPLib.WMPPlayState enumeration value**.**
Remarks
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.
Example Code
The following example uses the playState property to display the current playing status of the player in a label. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
[Visual Basic]
' Test whether Windows Media Player is in the playing state. If (player.playState = WMPLib.WMPPlayState.wmppsPlaying) Then playStateLabel.Text = "Windows Media Player is playing!" Else playStateLabel.Text = "Windows Media Player is NOT playing!" End If
FakePre-b39dcd6ee71240aba5f3665793e5a188-16ac13dcd1f44b9ba8b33e52e7080143
// Test whether Windows Media Player is in the playing state. if (player.playState == WMPLib.WMPPlayState.wmppsPlaying) { playStateLabel.Text = "Windows Media Player is playing!"; } else { playStateLabel.Text = "Windows Media Player is NOT playing!"; }
Requirements
Version: Windows Media Player 9 Series or later
Namespace: AxWMPLib
Assembly: AxInterop.WMPLib.dll (automatically generated by Visual Studio)
See Also
- AxWindowsMediaPlayer Object (VB and C#)
- AxWindowsMediaPlayer.PlayStateChange Event (VB and C#)
- WMPPlayState
Previous | Next |