tags:

views:

256

answers:

3

How can i play windows media audio/video file(wmv) in windows media control in vb6? I tried playing it through this code but it didn't work

wmp.URL = App.Path & "filename"
wmp.Controls.play
A: 

The statement you show is correct. Are you sure of the file path, file type, and that the file is okay? The URL is specified without double quotes even if it has spaces in the path. Can you play the file in Windows Media Player if you just open it? If none of these help, can you post the actual code and the actual url you are setting?

Beaner
+1  A: 

You forgot the backslash between App.Path and "filename".

wmp.URL = App.Path & "\" & "filename"
wmp.Controls.play
raven
For me the Play command was unnecessary as assigning the file to the URL property caused the control to immediately begin playing.
Beaner
A: 

wmp.URL = App.Path & "\" & "filename"
wmp.Controls.play

you dont need the & "\" just leave it how you had it and put the \ before filename like this

wmp.URL = App.Path & "\filename"
wmp.Controls.play

blah