user187573
user187573

Reputation: 171

vb6 windows media player

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

Upvotes: 1

Views: 8226

Answers (4)

ksyx
ksyx

Reputation: 41

First, put a \ before the filename(with extension name, like filename.wmv), like this:

wmp.URL=path & "\filename" 

Second, make Windows Media Player to play multimedia file, use object.controls.play, the "object" is your Windows Media Player control's name. In your question,use this:

wmp.controls.play

So,the full code are:

wmp.URL=path & "\filename"
wmp.controls.play

Upvotes: 0

blah
blah

Reputation: 11

Put a \ before filename like this:

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

Upvotes: 1

raven
raven

Reputation: 18125

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

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

Upvotes: 2

jac
jac

Reputation: 9726

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?

Upvotes: 0

Related Questions