Question Media Player Stop And Pause

crystaluz

Well-known member
Joined
Feb 17, 2009
Messages
55
Programming Experience
Beginner
Helllo there..

I have a problem with media player playback control.. When I click stop button, it stopped, but when I click play, it will continue playing at the same point (like Pause function).

I use this behind stop button :

AxmediaPlayer1.Stop()

I want if the stop button is clicked, it will clear the playback scene. How?

Thank you :)
 
RE: Media Player Stop and Pause

This code is what I use.

VB.NET:
Private Sub player_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles player.PlayStateChange
If Me.player.playState = WMPLib.WMPPlayState.wmppsMediaEnded Or Me.player.playState = WMPLib.WMPPlayState.wmppsStopped Then
Me.player.currentMedia = Nothing
End If
End Sub

Note that in the above code you would need to change "player" to whatever your media player control is named. The above clears the current media from the player control.

Hope this helps.
Regards
Colin
 
Back
Top