Media player 1.0
Submitted By:
chandru_be
Rating:





(
Rate It)
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "FLASH.OCX"
Begin VB.Form Video_ActiveMovie
BackColor = &H00E1B8AA&
BorderStyle = 1 'Fixed Single
Caption = "CHO PLAYER"
ClientHeight = 8355
ClientLeft = 150
ClientTop = 720
ClientWidth = 10860
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 557
ScaleMode = 3 'Pixel
ScaleWidth = 724
StartUpPosition = 3 'Windows Default
WhatsThisButton = -1 'True
WhatsThisHelp = -1 'True
WindowState = 2 'Maximized
Begin VB.CommandButton afile
Caption = "audio files"
Height = 375
Left = 9120
TabIndex = 21
Top = 7200
Visible = 0 'False
Width = 1095
End
Begin VB.ListBox List1
BackColor = &H00E1B8AA&
Height = 2985
Left = 8760
TabIndex = 20
Top = 3960
Visible = 0 'False
Width = 1815
End
Begin VB.CommandButton load
Caption = "video files"
Height = 375
Left = 6720
TabIndex = 19
Top = 7200
Visible = 0 'False
Width = 1215
End
Begin VB.ListBox List
BackColor = &H00E1B8AA&
Height = 2985
Left = 6360
TabIndex = 18
Top = 3960
Visible = 0 'False
Width = 1815
End
Begin VB.CommandButton opeen
Caption = "&OPEN"
Height = 375
Left = 1440
TabIndex = 14
Top = 7080
Width = 750
End
Begin MSComDlg.CommonDialog cmd
Left = 5880
Top = 7560
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Timer RefreshTimer
Interval = 250
Left = 5880
Top = 120
End
Begin VB.CommandButton Pause_but
Caption = "&PAUSE"
Height = 375
Left = 3360
TabIndex = 7
Top = 7080
Width = 750
End
Begin VB.CommandButton Stop_but
Caption = "&STOP"
Height = 375
Left = 4320
TabIndex = 6
Top = 7080
Width = 750
End
Begin VB.CommandButton Play_but
Caption = "&PLAY"
Height = 375
Left = 2400
TabIndex = 5
Top = 7080
Width = 750
End
Begin VB.CheckBox FullScreen_c
BackColor = &H00E1B8AA&
Caption = "Run Full Screen"
Height = 255
Left = 1200
TabIndex = 4
Top = 6480
Width = 1695
End
Begin VB.CheckBox Ratio_c
BackColor = &H00E1B8AA&
Caption = "Maintain Aspect Ratio"
Height = 255
Left = 3480
TabIndex = 3
Top = 6480
Value = 1 'Checked
Width = 1935
End
Begin VB.Frame Frame2
BackColor = &H00E1B8AA&
Height = 1335
Left = 1200
TabIndex = 1
Top = 4680
Width = 4455
Begin VB.TextBox namtxt
Height = 375
Left = 960
TabIndex = 16
Top = 840
Width = 3135
End
Begin VB.TextBox Path_t
Height = 405
Left = 960
TabIndex = 2
Text = "CHO PLAYER"
Top = 360
Width = 3135
End
Begin VB.Label Label1
BackColor = &H00E1B8AA&
Caption = "NAME :"
Height = 375
Left = 120
TabIndex = 17
Top = 840
Width = 615
End
Begin VB.Label PATTH
BackColor = &H00E1B8AA&
Caption = "PATH :"
Height = 375
Left = 120
TabIndex = 15
Top = 360
Width = 735
End
End
Begin VB.Timer StateTimer
Interval = 250
Left = 6600
Top = 120
End
Begin VB.PictureBox Video
BackColor = &H00000000&
Height = 4095
Left = 960
ScaleHeight = 4035
ScaleWidth = 4755
TabIndex = 0
Top = 360
Width = 4815
Begin ShockwaveFlashObjectsCtl.ShockwaveFlash Flash1
Height = 2895
Left = 600
TabIndex = 22
Top = 480
Visible = 0 'False
Width = 3615
_cx = 6376
_cy = 5106
FlashVars = ""
Movie = "App.path""\movie4.swf"""
Src = "App.path""\movie4.swf"""
WMode = "Window"
Play = -1 'True
Loop = -1 'True
Quality = "High"
SAlign = ""
Menu = -1 'True
Base = ""
AllowScriptAccess= "always"
Scale = "ShowAll"
DeviceFont = 0 'False
EmbedMovie = 0 'False
BGColor = ""
SWRemote = ""
MovieData = ""
SeamlessTabbing = -1 'True
End
End
Begin MSComctlLib.Slider Balance_s
Height = 495
Left = 8640
TabIndex = 10
Top = 960
Width = 1815
_ExtentX = 3201
_ExtentY = 873
_Version = 393216
Min = -5000
Max = 5000
TickFrequency = 500
End
Begin MSComctlLib.Slider Volume_s
Height = 495
Left = 8640
TabIndex = 12
Top = 1680
Width = 1815
_ExtentX = 3201
_ExtentY = 873
_Version = 393216
Min = -4000
Max = 0
TickStyle = 3
TickFrequency = 250
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H00E1B8AA&
Caption = "Volume"
Height = 375
Left = 6600
TabIndex = 13
Top = 1800
Width = 1575
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H00E1B8AA&
Caption = "Balance"
Height = 375
Left = 6600
TabIndex = 11
Top = 1080
Width = 1575
End
Begin VB.Label Length_l
BackColor = &H00E1B8AA&
Caption = "Length:"
Height = 375
Left = 7080
TabIndex = 9
Top = 2520
Width = 2775
End
Begin VB.Label CurrentPos_l
BackColor = &H00E1B8AA&
Caption = "Current Pos:"
Height = 375
Left = 6840
TabIndex = 8
Top = 3120
Width = 2895
End
Begin VB.Menu filees
Caption = "&File"
Begin VB.Menu ope
Caption = "&open"
End
Begin VB.Menu en
Caption = "&end"
End
End
Begin VB.Menu tol
Caption = "&Tools"
Begin VB.Menu adf
Caption = "&add video files"
End
Begin VB.Menu adau
Caption = "add a&udio files"
End
Begin VB.Menu li
Caption = "&list box "
Begin VB.Menu slb
Caption = "show video list box"
End
Begin VB.Menu sli
Caption = "show audio list box"
End
End
Begin VB.Menu co
Caption = "&colors"
Begin VB.Menu ro
Caption = "rose"
End
Begin VB.Menu ye
Caption = "yellow"
End
Begin VB.Menu gr
Caption = "green"
End
Begin VB.Menu de
Caption = "Default"
End
End
End
Begin VB.Menu hp
Caption = "&help"
Begin VB.Menu abu
Caption = "a&bout us"
End
End
End
Attribute VB_Name = "Video_ActiveMovie"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public db As New ADODB.Connection
Public rs As New ADODB.Recordset
Public rs1 As New ADODB.Recordset
Dim temp As String
Dim op As Integer
Dim op1 As Integer
Dim str As String
Dim Paused
Const NormalWidth = 5280
Dim temp1 As Variant
Private Sub filee_Click()
End Sub
Private Sub abu_Click()
help.Show
End Sub
Private Sub adau_Click()
audio_add.Show
End Sub
Private Sub adf_Click()
video_add.Show
End Sub
Private Sub afile_Click()
Set rs1 = New ADODB.Recordset
'db.ConnectionString = "provider=Microsoft.Jet.OLEDB.3.51;data source=" & App.path & "\player.mdb;"
rs1.Open "afile", db, adOpenDynamic, adLockOptimistic
rs1.MoveFirst
Do
List1.AddItem (rs1.Fields(0))
rs1.MoveNext
Loop While (rs1.EOF <> True)
End Sub
Private Sub de_Click()
Video_ActiveMovie.BackColor = &HE1B8AA
PATTH.BackColor = &HE1B8AA
Label1.BackColor = &HE1B8AA
FullScreen_c.BackColor = &HE1B8AA
Ratio_c.BackColor = &HE1B8AA
Label4.BackColor = &HE1B8AA
Label3.BackColor = &HE1B8AA
Length_l.BackColor = &HE1B8AA
CurrentPos_l.BackColor = &HE1B8AA
Frame2.BackColor = &HE1B8AA
List1.BackColor = &HE1B8AA
List.BackColor = &HE1B8AA
End Sub
Private Sub en_Click()
End
End Sub
Private Sub Form_Load()
Set db = New ADODB.Connection
db.ConnectionString = "provider=Microsoft.Jet.OLEDB.3.51;data source=" & App.path & "\player.mdb;"
'db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source="&app.Path&"\player.mdb"
db.Open
op = 1
op1 = 1
Me.Width = NormalWidth
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
rs.Close
rs1.Close
End Sub
Private Sub FullScreen_c_Click()
'RunFullScreen = (FullScreen_c.Value = 2
End Sub
Private Sub FullScreen_c_KeyPress(KeyAscii As Integer)
If (KeyAscii = 27) Then
MsgBox "Iam in esc mode"
RunFullScreen = (FullScreen_c.Value = 1)
End If
End Sub
Private Sub gr_Click()
Video_ActiveMovie.BackColor = &HACF183
PATTH.BackColor = &HACF183
Label1.BackColor = &HACF183
FullScreen_c.BackColor = &HACF183
Ratio_c.BackColor = &HACF183
Label4.BackColor = &HACF183
Label3.BackColor = &HACF183
Length_l.BackColor = &HACF183
CurrentPos_l.BackColor = &HACF183
Frame2.BackColor = &HACF183
List1.BackColor = &HACF183
List.BackColor = &HACF183
End Sub
Private Sub List_Click()
rs.MoveFirst
Dim t As String
t = List.Text
While Not rs.EOF
If t = rs.Fields(0) Then
Path_t = rs.Fields(1)
rs.MoveNext
Else
rs.MoveNext
End If
Wend
End Sub
Private Sub List1_Click()
rs1.MoveFirst
Dim t As String
t = List1.Text
While Not rs1.EOF
If t = rs1.Fields(0) Then
Path_t = rs1.Fields(1)
rs1.MoveNext
Else
rs1.MoveNext
End If
Wend
Flash1.Movie = App.path & "\movie4.swf"
'Flash1.Movie = "G:\PROGRAMS\sd lab\final\Saved1\movie4.swf"
Flash1.Visible = True
Flash1.Playing = True
End Sub
Private Sub load_Click()
Flash1.Visible = False
Flash1.Playing = False
Set rs = New ADODB.Recordset
'db.ConnectionString = "provider=Microsoft.Jet.OLEDB.3.51;data source=" & App.path & "\player.mdb;"
rs.Open "vfile", db, adOpenDynamic, adLockOptimistic
rs.MoveFirst
Do
List.AddItem (rs.Fields(0))
rs.MoveNext
Loop While (rs.EOF <> True)
End Sub
Private Sub ope_Click()
cmd.ShowOpen
temp = cmd.FileName
Path_t.Text = temp
namtxt.Text = cmd.FileTitle
End Sub
Private Sub opeen_Click()
Flash1.Visible = False
Flash1.Playing = False
cmd.ShowOpen
temp = cmd.FileName
Path_t.Text = temp
namtxt.Text = cmd.FileTitle
Flash1.Playing = False
Flash1.Visible = False
End Sub
' **
' ** Control Buttons
' **
Private Sub Play_But_Click() ' Play
If Paused Then ' Check if paused
ActiveMovieControl.PlayActiveMovie
Else ' if not, new content
DontMaintainRatio = (Ratio_c.Value = 0)
RunFullScreen = (FullScreen_c.Value = 1)
ActiveMovieControl.RunVideoContent Path_t.Text, DontMaintainRatio, RunFullScreen
End If
End Sub
Private Sub ro_Click()
Video_ActiveMovie.BackColor = &HC0C0FF
PATTH.BackColor = &HC0C0FF
Label1.BackColor = &HC0C0FF
FullScreen_c.BackColor = &HC0C0FF
Ratio_c.BackColor = &HC0C0FF
Label4.BackColor = &HC0C0FF
Label3.BackColor = &HC0C0FF
Length_l.BackColor = &HC0C0FF
CurrentPos_l.BackColor = &HC0C0FF
Frame2.BackColor = &HC0C0FF
List1.BackColor = &HC0C0FF
List.BackColor = &HC0C0FF
End Sub
Private Sub slb_Click()
If op = 1 Then
List.Visible = True
load.Visible = True
op = 0
slb.Caption = "Hide video list box"
Else
op = 1
List.Visible = False
load.Visible = False
slb.Caption = "show video list box"
End If
End Sub
Private Sub sli_Click()
If op1 = 1 Then
List1.Visible = True
afile.Visible = True
op1 = 0
sli.Caption = "Hide audio list box"
Else
op1 = 1
List1.Visible = False
afile.Visible = False
sli.Caption = "show audio list box"
Flash1.Visible = False
Flash1.Playing = False
End If
End Sub
Private Sub Stop_But_Click() ' Stop
Paused = False
ActiveMovieControl.StopActiveMovie
End Sub
Private Sub Pause_But_Click()
' Setting Flag
Paused = True
' ---------------
ActiveMovieControl.PauseActiveMovie
End Sub
Private Sub Text1_Change()
End Sub
' **
' ** Audio Control Slides
' **
' ** Note: The 'Click' event in slides will only capture 'drags'
' ** that finishes inside the control's area, to get events
' ** during the drag use the 'mouseMove' event for smooth handling
Private Sub Volume_s_Click()
ActiveMovieControl.SetActiveMovieVolume Volume_s.Value
End Sub
Private Sub Balance_s_Click()
ActiveMovieControl.SetActiveMovieBalance Balance_s.Value
End Sub
' **
' ** Timer Events
' **
Private Sub RefreshTimer_Timer()
If ActiveMovieControl.VideoRunning Then
Length_l.Caption = "Length: " & ActiveMovieControl.GetVideoLength
CurrentPos_l.Caption = "Current Pos: " & ActiveMovieControl.GetVideoPos
End If
End Sub
Private Sub StateTimer_Timer()
ActiveMovieControl.ActiveMovieTimerEvent
End Sub
' **
' ** Video Finished Event
' **
Public Sub VideoFinishedEvent()
CurrentPos_l.Caption = "Video Gets End!"
End Sub
Private Sub ye_Click()
Video_ActiveMovie.BackColor = &HC0FFFF
PATTH.BackColor = &HC0FFFF
Label1.BackColor = &HC0FFFF
FullScreen_c.BackColor = &HC0FFFF
Ratio_c.BackColor = &HC0FFFF
Label4.BackColor = &HC0FFFF
Label3.BackColor = &HC0FFFF
Length_l.BackColor = &HC0FFFF
CurrentPos_l.BackColor = &HC0FFFF
Frame2.BackColor = &HC0FFFF
List1.BackColor = &HC0FFFF
List.BackColor = &HC0FFFF
End Sub