This was my morning project i did today. It was going to go on my Anime Streamer but WMP video went black when i hooked up the components to the player, so i got screwed over on that part, since i can't really use it, so i'm releasing it, because i hope someone can use it.
Example i was going off:
[img]http://images.macworld.com/images/news/graphics/142424-quicktime-player-x_original.jpg[/img]
The re-created version:
(remember this was going to go on a Project of mine.)
Controls:
[+]Player Template
(Main Control that contains most of the features)
[+]Volume Control
(by Mava, modified by Nettro)
Download - Code
Download - Pastebin
Code that i used to hook up the Sound, Trackbar, Pause & play button, fastforward button, and the fastreverse button.
Code
Private Sub AxWindowsMediaPlayer1_PlayStateChange(sender As Object, e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange
If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsBuffering Or AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then
' set trackbar1 min and maximum values
ThemeContainer1.Maxnum = AxWindowsMediaPlayer1.currentMedia.duration
Me.Timer1.Start()
ThemeContainer1.PlayState2 = True
ThemeContainer1.Refresh()
ElseIf AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsMediaEnded Or AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Or AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsReady Then
Me.Timer1.Stop()
ThemeContainer1.PlayState2 = False
ThemeContainer1.Refresh()
End If
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then
ThemeContainer1.Destination = AxWindowsMediaPlayer1.Ctlcontrols.currentPosition
ThemeContainer1.VolString = AxWindowsMediaPlayer1.Ctlcontrols.currentPositionString
ThemeContainer1.VolString2 = AxWindowsMediaPlayer1.currentMedia.durationString.ToString
End If
End Sub
Private Sub ThemeContainer1_FastForward(sender As Object) Handles ThemeContainer1.FastForward
If AxWindowsMediaPlayer1.Ctlcontrols.isAvailable("fastForward") Then
AxWindowsMediaPlayer1.Ctlcontrols.fastForward()
End If
End Sub
Private Sub ThemeContainer1_PlaystateChanged(sender As Object) Handles ThemeContainer1.PlaystateChanged
If ThemeContainer1.PlayState2 = True Then
AxWindowsMediaPlayer1.Ctlcontrols.pause()
Else
AxWindowsMediaPlayer1.Ctlcontrols.play()
End If
End Sub
Private Sub ThemeContainer1_VolumeChanged2(sender As Object) Handles ThemeContainer1.DestinationChanged
AxWindowsMediaPlayer1.Ctlcontrols.currentPosition = ThemeContainer1.Destination
End Sub
Private Sub SoundCloudVolumeSlider1_VolumeChanged2(sender As Object) Handles SoundCloudVolumeSlider1.VolumeChanged2
AxWindowsMediaPlayer1.settings.volume = SoundCloudVolumeSlider1.Volume
End Sub
Private Sub ThemeContainer1_Revious(sender As Object) Handles ThemeContainer1.Revious
If AxWindowsMediaPlayer1.Ctlcontrols.isAvailable("fastReverse") Then
AxWindowsMediaPlayer1.Ctlcontrols.fastReverse()
End If
End Sub
If you know any solution to WMP going black, i would greatly appreciate any help.