I'm making a media player with visual basic 6 and im having trouble on adding the video feature(so that i can not only play the music but i can see the video with it) to the media player? could any1 help me?

i 4got to add : that when i select a mid file in the project with the media player, it starts to play but an error pops up

Post your code (not someone else's) and we'll try to help you out.
Deital & Deital have that project in their book.
ISBN 0-13-456955-5

Well my media player is more advanced and has some other code but That is what im having trouble with and basically i know all the basic stuff to visual basic and what some of that stuff means on that tutorial.


So can you all please help me out?

I'm making a media player with visual basic 6 and im having trouble on adding the video feature(so that i can not only play the music but i can see the video with it) to the media player? could any1 help me?

have you copied exactly from that site or made some modifications?
i mean to say that site uses a picture box to display the video clips. but you can also use
the windows media control to play video files. i recommend you to go and use this control. this control has more powerful functions and methods than the mmc control and more easier to use.

check out the code to play both video and audio files :-
(if u use media player control)

[B]mediaplayer1.filename="c:\my video.dat"
mediaplayer1.play[/B]

if u use microsoft multimedia control then u can try this :-

mmc.FileName = "F:\Richik\GNR videos\Guns N' Roses - Civil War (Video).mpg"
mmc.Command = "open"
mmc.hWndDisplay = Picture1.hWnd
mmc.Command = "play"
End Sub

Private Sub mmc_Done(NotifyCode As Integer)
If NotifyCode = 1 Then mmc.Command = "close"
End Sub

see whether this helps you to get your problem solved or not.

regards
Shouvik

Okay i uploaded a screenshot of my media form
i dont wanna use the mmcontrol(even though its visible on the form, ill make it invisible later) nor the play or stop command buttons(that is visible on the form), i just want to use the fancy play button image at the bottom of the form. Also i would like to be able to fast foward or rewind the music or video, and change the volumes with those fancy picture buttons at the bottom of the page

Basically my code, so far, is the attachment

Will i still have to keep mmcontrol on the form? i tried ur code and it dint work and idk what i did wrong...could u help me?

oops it dint add the code

let me give some time.
i'll attach the code till tomorrow

regards
Shouvik

bye

okay, thanx

test this simple player:

okay i will for sure tuesday(cause we r out monday) because i dont have visual basic at home,...i just have it only at school

can i beg a vb app. to you?

yes please lol

May I suggest a slight coding change for efficiency and readability?

Instead of :
Private Sub File1_Click()
If Combo1.ListIndex = 0 Then
File1.Pattern = ("*.wav")
ElseIf Combo1.ListIndex = 1 Then
File1.Pattern = ("*.mid")
ElseIf Combo1.ListIndex = 2 Then
File1.Pattern = ("*.avi;*.mpg")
Else
File1.Pattern = ("*.*")
End If

Use:
Private Sub File1_Click()
Select Case Combo1.ListIndex
Case 0
File1.Pattern = "*.wav"
Case 1
File1.Pattern = "*.mid"
Case 2
File1.Pattern = "*.avi;*.mpg"
Case Else
File1.Pattern = "*.*"
End Select

yes please lol

can i please hir is my ripway account www.ripway.com
username:snipermark0420
pass:adapongsky

can i please hir is my ripway account www.ripway.com
username:snipermark0420
pass:adapongsky

so what do i do next after i log on to it? and wait, what am i doing again?

May I suggest a slight coding change for efficiency and readability?

Instead of :
Private Sub File1_Click()
If Combo1.ListIndex = 0 Then
File1.Pattern = ("*.wav")
ElseIf Combo1.ListIndex = 1 Then
File1.Pattern = ("*.mid")
ElseIf Combo1.ListIndex = 2 Then
File1.Pattern = ("*.avi;*.mpg")
Else
File1.Pattern = ("*.*")
End If

Use:
Private Sub File1_Click()
Select Case Combo1.ListIndex
Case 0
File1.Pattern = "*.wav"
Case 1
File1.Pattern = "*.mid"
Case 2
File1.Pattern = "*.avi;*.mpg"
Case Else
File1.Pattern = "*.*"
End Select

oh thanx, i learned something new, ive seen the "case" thing but i wasnt real too sure about how to use it
but yeah, ill use that.
it is easier to read the code with that

test this simple player:

Okay, I was finally able to check it and:
So i need ocx files to make the player to play video? and if i use a similiar code with ur add cmdOpen command, will it allow the player to open and play the videos?
and i think im totally lost with this player(as to with some of the code) like with the cmdFor

is your code already ok

Okay, I was finally able to check it and:
So i need ocx files to make the player to play video? and if i use a similiar code with ur add cmdOpen command, will it allow the player to open and play the videos?
and i think im totally lost with this player(as to with some of the code) like with the cmdFor

yes , it need 3 ocx file that you can find it in "Need" Folder.

if i use a similiar code with ur add cmdOpen command, will it allow the player to open and play the videos?

yes.

i think im totally lost with this player(as to with some of the code) like with the cmdFor

i donwload it again , it's complete.

is your code already ok

no, im still having a lot of trouble with it

what am i suppose to be doing with the ripway.com thing again?

yes , it need 3 ocx file that you can find it in "Need" Folder.

yes.


i donwload it again , it's complete.

well, how can i see the project in visual basic form? because when i try to play it it says:
User Defined Type not defined
and it shows this highlighted:
Private Sub TimeCounter1_ChangeTime(TypeChange As METimeCounter.enumChangeType)

and what i meant by that im lost with the code, i meant i dont know some of the code so its not really simple to me, but i understand some of the code

download this

i did and i opened it and its like the file is corrupted or invalid

i did and i opened it and its like the file is corrupted or invalid

I Remove all it's activex unless SMButton.ocx
already must run correctly.

hm, okay thanx

could u or any1 else show me a more easier media player project please?

hm, okay thanx

could u or any1 else show me a more easier media player project please?

see this:

it wont open in visual basic
it says theres a problem and i could either debug it or terminate it

it wont open in visual basic
it says theres a problem and i could either debug it or terminate it

program dont have any problem .
i dont know what is your problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.