开发者

vb6 windows media player

开发者 https://www.devze.com 2022-12-11 03:27 出处:网络
How can i play windows media audio/video file(wmv) in windo开发者_C百科ws media control in vb6? I tried playing it through this code but it didn\'t work

How can i play windows media audio/video file(wmv) in windo开发者_C百科ws media control in vb6? I tried playing it through this code but it didn't work

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


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

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


Put a \ before filename like this:

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


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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消