# Simple Media Player Code.



## Glitched System (May 12, 2007)

*(VB6) Simple Media Player Code.*

' Code Written By Jordan aka Glitched
' Simple media player code
' Sorry if you see the code as a mess
' Enjoy
'
' On Form 1 Place a WindowsMediaPlayer DLL,
' Place TWO timers. This is for the form caption
' Place Two Labels One for the "Server IP:" caption and for "Volume:" Caption
' Place ONE TextBox, This is where you enter your url.
'
' Button That Makes Media Player Start.
Private Sub Command1_Click()
WindowsMediaPlayer1.URL = Text1.Text
WindowsMediaPlayer1.Enabled = True
If Text1.Text = "" Then
MsgBox ("Enter A URL Dummy ")
End If
If Text1.Text = "" Then
Command1.Enabled = True
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command2.Enabled = False
Else
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command1.Enabled = False
End If
End Sub

' Button that makes media player stop
Private Sub Command2_Click()
If WindowsMediaPlayer1.Enabled = False Then
MsgBox (" You are not listening to music!")
End If
WindowsMediaPlayer1.Enabled = False
WindowsMediaPlayer1.Controls.Stop
Command1.Enabled = True
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command2.Enabled = False

End Sub

' Volume Control
Private Sub Command3_Click()
Form1.WindowsMediaPlayer1.settings.volume = 25
Label2.Caption = "Volume Level: " & Command3.Caption
End Sub

Private Sub Command4_Click()
Form1.WindowsMediaPlayer1.settings.volume = 50
Label2.Caption = "Volume Level: " & Command4.Caption
End Sub

Private Sub Command5_Click()
Form1.WindowsMediaPlayer1.settings.volume = 75
Label2.Caption = "Volume Level: " & Command5.Caption
End Sub

Private Sub Command6_Click()
Label2.Caption = "Volume Level: " & Command6.Caption
Form1.WindowsMediaPlayer1.settings.volume = 100
End Sub

Private Sub Command7_Click()
Form1.WindowsMediaPlayer1.settings.volume = 0
Label2.Caption = "Volume Level: " & Command7.Caption
End Sub

Private Sub Form_Load()
Command1.Caption = " Click Me To Play "
Timer1.Enabled = True
Timer1.Interval = 300
Form1.Caption = " Jordan's Online Media Player Version 2 "
Timer2.Enabled = True
Timer2.Interval = 300
Command1.Enabled = True
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command2.Enabled = False
Command1.Caption = "Click Me to Play"
Command2.Caption = "Music Off"
Command3.Caption = "25 %"
Command4.Caption = "50 %"
Command5.Caption = "75 %"
Command6.Caption = "100 %"
Command7.Caption = "Mute"
Label2.Caption = "Volume: 50 %"
Label1.Caption = "Server IP:"
Form1.Height = "1770"
End Sub

' Scrolls Form1 Caption
Private Sub Timer2_Timer()
Dim str As String
str = Form1.Caption
str = Mid$(str, 2, Len(str)) + Left(str, 1)
Form1.Caption = str
End Sub


----------

